gimp: Fix AVIF/HEIC support

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
Sefa Eyeoglu 2024-09-14 21:09:32 +01:00 committed by Mathias Sven
parent f5cb564fa1
commit 496c416b66
2 changed files with 30 additions and 0 deletions

View File

@ -77,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 = [

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