From 044b3342d1500fb2b741e87e4d10894f4d8fd716 Mon Sep 17 00:00:00 2001 From: Colin Date: Mon, 22 Apr 2024 11:43:33 +0000 Subject: [PATCH] libjxl: fix cross compilation by only conditionally enabling plugins `gdk-pixbuf` does not always provide `gdk-pixbuf-thumbnailer`, particularly when cross compiling. without gdk-pixbuf-thumbnailer, gdk-pixbuf-thumbnailer-jxl fails to wrap. --- pkgs/development/libraries/libjxl/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/libjxl/default.nix b/pkgs/development/libraries/libjxl/default.nix index 38414e56d7d2..c91ae27f6805 100644 --- a/pkgs/development/libraries/libjxl/default.nix +++ b/pkgs/development/libraries/libjxl/default.nix @@ -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