diff --git a/pkgs/applications/graphics/gimp/default.nix b/pkgs/applications/graphics/gimp/default.nix index fe89869809e9..8faf717a147e 100644 --- a/pkgs/applications/graphics/gimp/default.nix +++ b/pkgs/applications/graphics/gimp/default.nix @@ -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 ]; diff --git a/pkgs/applications/graphics/gimp/force-enable-libheif.patch b/pkgs/applications/graphics/gimp/force-enable-libheif.patch new file mode 100644 index 000000000000..de3dfb09b95e --- /dev/null +++ b/pkgs/applications/graphics/gimp/force-enable-libheif.patch @@ -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