Skip to content

Commit

Permalink
gimp: fix compatibility with libheif 1.18.0 and newer
Browse files Browse the repository at this point in the history
  • Loading branch information
mmuetzel committed Nov 17, 2024
1 parent 039f4e8 commit cf8a4d4
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
56 changes: 56 additions & 0 deletions mingw-w64-gimp/0010-fix-compatibility-with-libheif-1.18.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
Since libheif 1.18.0, codecs can be dynamically loaded at runtime and it is
not possible anymore to determine the available codecs at compile-time.
You'll get an unknown codec error at runtime if you try to use an
unavailable codec.

See: https://github.com/strukturag/libheif/commit/cf0d89c6e0809427427583290547a7757428cf5a

diff -urN gimp-2.10.38/configure.ac.orig gimp-2.10.38/configure.ac
--- gimp-2.10.38/configure.ac.orig 2024-11-17 14:10:59.244775200 +0100
+++ gimp-2.10.38/configure.ac 2024-11-17 14:11:10.329184400 +0100
@@ -1815,10 +1815,15 @@
# these as last resort, outputting a warning.
have_libheif=no
have_libheif_1_4_0=no
+have_libheif_1_14_0=no
if test "x$with_libheif" != xno; then
+ have_libheif_1_14_0=yes
have_libheif_1_4_0=yes
have_libheif=yes
- PKG_CHECK_MODULES(LIBHEIF, libheif > 1.5.1,,
+ PKG_CHECK_MODULES(LIBHEIF, libheif > 1.5.1,
+ [
+ PKG_CHECK_MODULES(LIBHEIF, libheif > 1.14.0,,[have_libheif_1_14_0=no])
+ ],
[
PKG_CHECK_MODULES(LIBHEIF, libheif = 1.4.0,,
[
@@ -1843,13 +1848,24 @@
can_import_avif=no
can_export_avif=no
if test "x$have_libheif" = xyes; then
- can_import_heic=`$PKG_CONFIG --variable=builtin_h265_decoder libheif`
- can_export_heic=`$PKG_CONFIG --variable=builtin_h265_encoder libheif`
+ if test "x$have_libheif_1_14_0" = xyes; then
+ # Since libheif 1.14.0, codecs can be dynamically loaded at runtime and it is
+ # not possible anymore to determine the available codecs at compile-time.
+ # You'll get an unknown codec error at runtime if you try to use an
+ # unavailable codec.
+ can_import_heic=yes
+ can_export_heic=yes
+ can_import_avif=yes
+ can_export_avif=yes
+ else
+ can_import_heic=`$PKG_CONFIG --variable=builtin_h265_decoder libheif`
+ can_export_heic=`$PKG_CONFIG --variable=builtin_h265_encoder libheif`
+ can_import_avif=`$PKG_CONFIG --variable=builtin_avif_decoder libheif`
+ can_export_avif=`$PKG_CONFIG --variable=builtin_avif_encoder libheif`
+ fi
if test "x$can_import_heic" = xyes; then
MIME_TYPES="$MIME_TYPES;image/heif;image/heic"
fi
- can_import_avif=`$PKG_CONFIG --variable=builtin_avif_decoder libheif`
- can_export_avif=`$PKG_CONFIG --variable=builtin_avif_encoder libheif`
if test "x$can_import_avif" = xyes; then
MIME_TYPES="$MIME_TYPES;image/avif"
fi
3 changes: 3 additions & 0 deletions mingw-w64-gimp/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ source=(https://download.gimp.org/pub/gimp/v${pkgver%.*}/${_realname}-${pkgver}.
0007-clang-rc-files-fix.patch
0008-avoid-incompatible-pointer-cast.patch::https://gitlab.gnome.org/GNOME/gimp/-/commit/24df4f1fc800f11e44c44f8036e7d8d7ee90b62a.patch
0009-build-fix-svg-pixbuf-loader-check-with-librsvg-2.59.patch
0010-fix-compatibility-with-libheif-1.18.0.patch
https://gitlab.gnome.org/GNOME/gimp/-/commit/13284c8953b43e349dc94a6c5bcc9dbf4e98533f.patch)
sha256sums=('50a845eec11c8831fe8661707950f5b8446e35f30edfb9acf98f85c1133f856e'
'f7f9badc547f1a0317b95e012530db8df63b7c7038c9d9ff8d0b510c86f43439'
Expand All @@ -67,6 +68,7 @@ sha256sums=('50a845eec11c8831fe8661707950f5b8446e35f30edfb9acf98f85c1133f856e'
'f4f8258b352530b0f9dd1ebd4f4730125caa4d047ca17bf9e5180b52be19c117'
'49f8078b10bcd5fe98236e51a3272651f80be630ae97ab2ec9aa00bd9c7ef503'
'1a733dec028116e2d891a830e7935a84bde22a31fa58759bf43bdf751c77e3b8'
'e1787a1cfb796973a3d711db9dc60b7606126bfc4b8a4365d8d32b743c60c8c6'
'3d346b0d7cb9ab534501f5e1a5d543a54dc16bb16b884a2fc42382c6a5b82cbf')

apply_patch_with_msg() {
Expand All @@ -88,6 +90,7 @@ prepare() {
0007-clang-rc-files-fix.patch \
0008-avoid-incompatible-pointer-cast.patch \
0009-build-fix-svg-pixbuf-loader-check-with-librsvg-2.59.patch \
0010-fix-compatibility-with-libheif-1.18.0.patch \
13284c8953b43e349dc94a6c5bcc9dbf4e98533f.patch

sed -e "s|-Wl,-rpath '-Wl,\$\$ORIGIN/../lib'||g" -i app/Makefile.am
Expand Down

0 comments on commit cf8a4d4

Please sign in to comment.