Merge pull request #306127 from uninsane/pr-libjxl-cross

libjxl: fix cross compilation by only conditionally enabling plugins
This commit is contained in:
Rick van Schijndel 2024-04-28 10:51:04 +02:00 committed by GitHub
commit f69fa2794f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -18,6 +18,7 @@
, doxygen
, python3
, lcms2
, enablePlugins ? stdenv.buildPlatform.canExecute stdenv.hostPlatform
}:
let
@ -106,7 +107,7 @@ stdenv.mkDerivation rec {
# TODO: Update this package to enable this (overridably via an option):
# Viewer tools for evaluation.
# "-DJPEGXL_ENABLE_VIEWERS=ON"
] ++ lib.optionals enablePlugins [
# Enable plugins, such as:
# * the `gdk-pixbuf` one, which allows applications like `eog` to load jpeg-xl files
# * the `gimp` one, which allows GIMP to load jpeg-xl files
@ -122,7 +123,7 @@ stdenv.mkDerivation rec {
--replace '/usr/bin/gdk-pixbuf-thumbnailer' "$out/libexec/gdk-pixbuf-thumbnailer-jxl"
'';
postInstall = ''
postInstall = lib.optionalString enablePlugins ''
GDK_PIXBUF_MODULEDIR="$out/${gdk-pixbuf.moduleDir}" \
GDK_PIXBUF_MODULE_FILE="$out/${loadersPath}" \
gdk-pixbuf-query-loaders --update-cache