diff --git a/pkgs/by-name/im/imv/package.nix b/pkgs/by-name/im/imv/package.nix index 45005c77bebb..95b2f8976c93 100644 --- a/pkgs/by-name/im/imv/package.nix +++ b/pkgs/by-name/im/imv/package.nix @@ -2,6 +2,7 @@ stdenv, lib, fetchFromSourcehut, + fetchpatch, asciidoc, cmocka, docbook_xsl, @@ -12,12 +13,11 @@ icu75, pango, inih, - withWindowSystem ? null, + withWindowSystem ? if stdenv.hostPlatform.isLinux then "all" else "x11", xorg, libxkbcommon, libGLU, wayland, - # "libnsgif" is disabled until https://todo.sr.ht/~exec64/imv/55 is solved withBackends ? [ "libjxl" "libtiff" @@ -25,6 +25,7 @@ "libpng" "librsvg" "libheif" + "libnsgif" ], freeimage, libtiff, @@ -37,15 +38,6 @@ }: let - # default value of withWindowSystem - withWindowSystem' = - if withWindowSystem != null then - withWindowSystem - else if stdenv.hostPlatform.isLinux then - "all" - else - "x11"; - windowSystems = { all = windowSystems.x11 ++ windowSystems.wayland; x11 = [ @@ -75,7 +67,7 @@ let in # check that given window system is valid -assert lib.assertOneOf "withWindowSystem" withWindowSystem' (builtins.attrNames windowSystems); +assert lib.assertOneOf "withWindowSystem" withWindowSystem (builtins.attrNames windowSystems); # check that every given backend is valid assert builtins.all ( b: lib.assertOneOf "each backend" b (builtins.attrNames backends) @@ -97,7 +89,7 @@ stdenv.mkDerivation rec { }; mesonFlags = [ - "-Dwindows=${withWindowSystem'}" + "-Dwindows=${withWindowSystem}" "-Dtest=enabled" "-Dman=enabled" ] ++ backendFlags; @@ -121,14 +113,23 @@ stdenv.mkDerivation rec { pango inih ] - ++ windowSystems."${withWindowSystem'}" + ++ windowSystems."${withWindowSystem}" ++ builtins.map (b: backends."${b}") withBackends; + patches = [ + (fetchpatch { + # https://lists.sr.ht/~exec64/imv-devel/patches/55937 + name = "update libnsgif backend"; + url = "https://lists.sr.ht/~exec64/imv-devel/%3C20241113012702.30521-2-reallyjohnreed@gmail.com%3E/raw"; + hash = "sha256-/OQeDfIkPtJIIZwL8jYVRy0B7LSBi9/NvAdPoDm851k="; + }) + ]; + postInstall = '' install -Dm644 ../files/imv.desktop $out/share/applications/ ''; - postFixup = lib.optionalString (withWindowSystem' == "all") '' + postFixup = lib.optionalString (withWindowSystem == "all") '' # The `bin/imv` script assumes imv-wayland or imv-x11 in PATH, # so we have to fix those to the binaries we installed into the /nix/store