termux-packages/packages/imagemagick/allow-static-libjxl.patch

57 lines
2.0 KiB
Diff

--- ImageMagick-7.1.0-4/configure.ac 2021-07-18 16:47:31.000000000 +0100
+++ ImageMagick-7.1.0-4.mod/configure.ac 2021-08-17 11:52:56.748517700 +0100
@@ -2389,46 +2389,23 @@
if test "$with_jxl" != 'yes'; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jxl=$with_jxl "
fi
-if test "$enable_static" = 'yes'; then
- if test "$with_utilities" = 'yes'; then
- with_jxl='no'
- fi
-fi
-# Check for the JPEG-XL library.
have_jxl='no'
+JXL_CFLAGS=''
JXL_LIBS=''
+JXL_PKG=''
if test "$with_jxl" != 'no'; then
AC_MSG_RESULT([-------------------------------------------------------------])
- AC_MSG_CHECKING([for jpeg-xl])
+ PKG_CHECK_MODULES([JXL],[libjxl >= 0.5, libjxl_threads >= 0.5],[have_jxl=yes],[have_jxl=no])
AC_MSG_RESULT([])
- failed=0
- passed=0
- AC_CHECK_HEADER([jxl/decode.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
- AC_CHECK_HEADER([jxl/encode.h],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`])
- # This check should be changed once we have a .pc file for the JPEG-XL library.
- if test "$enable_static" != 'yes'; then
- AC_CHECK_LIB([jxl],[JxlDecoderCreate],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[])
- AC_CHECK_LIB([jxl],[JxlEncoderSetBasicInfo],[passed=`expr $passed + 1`],[failed=`expr $failed + 1`],[])
- fi
-
- AC_MSG_CHECKING([if jpeg-xl package is complete])
- if test $passed -gt 0; then
- if test $failed -gt 0; then
- AC_MSG_RESULT([no -- some components failed test])
- have_jxl='no (failed tests)'
- else
- JXL_LIBS='-ljxl -ljxl_threads'
+fi
+if test "$have_jxl" = 'yes'; then
+ CFLAGS="$JXL_CFLAGS $CFLAGS"
LIBS="$JXL_LIBS $LIBS"
AC_DEFINE([JXL_DELEGATE],[1],[Define if you have jpeg-xl library])
- AC_MSG_RESULT([yes])
- have_jxl='yes'
- fi
- else
- AC_MSG_RESULT([no])
- fi
fi
AM_CONDITIONAL([JXL_DELEGATE],[test "$have_jxl" = 'yes'])
+AC_SUBST([JXL_CFLAGS])
AC_SUBST([JXL_LIBS])
dnl ===========================================================================