Skip to content

Commit

Permalink
Merge pull request #306127 from uninsane/pr-libjxl-cross
Browse files Browse the repository at this point in the history
libjxl: fix cross compilation by only conditionally enabling plugins
  • Loading branch information
Mindavi authored Apr 28, 2024
2 parents f6bcc42 + 044b334 commit f69fa27
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkgs/development/libraries/libjxl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
, doxygen
, python3
, lcms2
, enablePlugins ? stdenv.buildPlatform.canExecute stdenv.hostPlatform
}:

let
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit f69fa27

Please sign in to comment.