From 98ef04fc5db8108b3e248de33ee8ef158a139365 Mon Sep 17 00:00:00 2001 From: Lucy Phipps Date: Tue, 17 Aug 2021 11:59:13 +0100 Subject: [PATCH] imagemagick: really use libjxl --- .../imagemagick/allow-static-libjxl.patch | 56 +++++++++++++++++++ packages/imagemagick/build.sh | 8 ++- 2 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 packages/imagemagick/allow-static-libjxl.patch diff --git a/packages/imagemagick/allow-static-libjxl.patch b/packages/imagemagick/allow-static-libjxl.patch new file mode 100644 index 000000000..9080ffb87 --- /dev/null +++ b/packages/imagemagick/allow-static-libjxl.patch @@ -0,0 +1,56 @@ +--- 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 =========================================================================== diff --git a/packages/imagemagick/build.sh b/packages/imagemagick/build.sh index c7774cf4a..9e44b9529 100644 --- a/packages/imagemagick/build.sh +++ b/packages/imagemagick/build.sh @@ -3,10 +3,10 @@ TERMUX_PKG_DESCRIPTION="Suite to create, edit, compose, or convert images in a v TERMUX_PKG_LICENSE="ImageMagick" TERMUX_PKG_MAINTAINER="@termux" TERMUX_PKG_VERSION=7.1.0.4 -TERMUX_PKG_REVISION=8 +TERMUX_PKG_REVISION=9 TERMUX_PKG_SRCURL=https://download.imagemagick.org/ImageMagick/download/ImageMagick-$(echo $TERMUX_PKG_VERSION | sed 's/\(.*\)\./\1-/').tar.lz TERMUX_PKG_SHA256=5959267fe286698ad1f249dd85a8776f121a1a181012b3358b5142957da58b3a -TERMUX_PKG_DEPENDS="fftw, fontconfig, freetype, fribidi, glib, harfbuzz, libandroid-support, libbz2, libcairo, libffi, libgraphite, libheif, libjpeg-turbo, liblzma, libpixman, libpng, librsvg, libtiff, libuuid, libwebp, libx11, libxau, libxcb, libxdmcp, libxext, libxml2, littlecms, openjpeg, pango, pcre, zlib" +TERMUX_PKG_DEPENDS="fftw, fontconfig, freetype, fribidi, glib, harfbuzz, libandroid-support, libbz2, libcairo, libffi, libgraphite, libheif, libjpeg-turbo, libjxl, liblzma, libpixman, libpng, librsvg, libtiff, libuuid, libwebp, libx11, libxau, libxcb, libxdmcp, libxext, libxml2, littlecms, openjpeg, pango, pcre, zlib" TERMUX_PKG_BREAKS="imagemagick-dev, imagemagick-x" TERMUX_PKG_REPLACES="imagemagick-dev, imagemagick-x" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" @@ -17,6 +17,7 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --with-xml=yes --with-rsvg=yes --with-lzma +--with-jxl=yes --disable-openmp ac_cv_func_ftime=no " @@ -30,4 +31,7 @@ termux_step_pre_configure() { #Avoid "libMagickCore-7.Q16HDRI.so: error: undefined reference to '__atomic_load'" LDFLAGS+=" -latomic" fi + + # for allow-static-libjxl.patch + autoconf }