gimp: Fix AVIF/HEIC support (#341914)

This commit is contained in:
Fabián Heredia Montiel 2024-09-17 00:41:56 -06:00 committed by GitHub
commit ea15a9fbb4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 32 additions and 0 deletions

View File

@ -42,6 +42,7 @@
, mypaint-brushes1
, libwebp
, libheif
, libxslt
, libgudev
, openexr
, desktopToDarwinBundle
@ -76,6 +77,14 @@ in stdenv.mkDerivation (finalAttrs: {
# Use absolute paths instead of relying on PATH
# to make sure plug-ins are loaded by the correct interpreter.
./hardcode-plugin-interpreters.patch
# GIMP queries libheif.pc for builtin encoder/decoder support to determine if AVIF/HEIC files are supported
# (see https://gitlab.gnome.org/GNOME/gimp/-/blob/a8b1173ca441283971ee48f4778e2ffd1cca7284/configure.ac?page=2#L1846-1852)
# These variables have been removed since libheif 1.18.0
# (see https://github.com/strukturag/libheif/commit/cf0d89c6e0809427427583290547a7757428cf5a)
# This has already been fixed for the upcoming GIMP 3, but the fix has not been backported to 2.x yet
# (see https://gitlab.gnome.org/GNOME/gimp/-/issues/9080)
./force-enable-libheif.patch
];
nativeBuildInputs = [
@ -85,6 +94,7 @@ in stdenv.mkDerivation (finalAttrs: {
gettext
makeWrapper
gtk-doc
libxslt
] ++ lib.optionals stdenv.isDarwin [
desktopToDarwinBundle
];

View File

@ -0,0 +1,22 @@
diff --git a/configure.ac b/configure.ac
index 48c3c77892..3189781817 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1843,13 +1843,13 @@ can_export_heic=no
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`
+ can_import_heic=yes
+ can_export_heic=yes
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`
+ can_import_avif=yes
+ can_export_avif=yes
if test "x$can_import_avif" = xyes; then
MIME_TYPES="$MIME_TYPES;image/avif"
fi