Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

imv: add patch for libnsgif (#388255)

authored by

Peder Bergebakken Sundt and committed by
GitHub
e02cdfcf 1e364930

+16 -15
+16 -15
pkgs/by-name/im/imv/package.nix
··· 2 2 stdenv, 3 3 lib, 4 4 fetchFromSourcehut, 5 + fetchpatch, 5 6 asciidoc, 6 7 cmocka, 7 8 docbook_xsl, ··· 12 13 icu75, 13 14 pango, 14 15 inih, 15 - withWindowSystem ? null, 16 + withWindowSystem ? if stdenv.hostPlatform.isLinux then "all" else "x11", 16 17 xorg, 17 18 libxkbcommon, 18 19 libGLU, 19 20 wayland, 20 - # "libnsgif" is disabled until https://todo.sr.ht/~exec64/imv/55 is solved 21 21 withBackends ? [ 22 22 "libjxl" 23 23 "libtiff" ··· 25 25 "libpng" 26 26 "librsvg" 27 27 "libheif" 28 + "libnsgif" 28 29 ], 29 30 freeimage, 30 31 libtiff, ··· 37 38 }: 38 39 39 40 let 40 - # default value of withWindowSystem 41 - withWindowSystem' = 42 - if withWindowSystem != null then 43 - withWindowSystem 44 - else if stdenv.hostPlatform.isLinux then 45 - "all" 46 - else 47 - "x11"; 48 - 49 41 windowSystems = { 50 42 all = windowSystems.x11 ++ windowSystems.wayland; 51 43 x11 = [ ··· 75 67 in 76 68 77 69 # check that given window system is valid 78 - assert lib.assertOneOf "withWindowSystem" withWindowSystem' (builtins.attrNames windowSystems); 70 + assert lib.assertOneOf "withWindowSystem" withWindowSystem (builtins.attrNames windowSystems); 79 71 # check that every given backend is valid 80 72 assert builtins.all ( 81 73 b: lib.assertOneOf "each backend" b (builtins.attrNames backends) ··· 97 89 }; 98 90 99 91 mesonFlags = [ 100 - "-Dwindows=${withWindowSystem'}" 92 + "-Dwindows=${withWindowSystem}" 101 93 "-Dtest=enabled" 102 94 "-Dman=enabled" 103 95 ] ++ backendFlags; ··· 121 113 pango 122 114 inih 123 115 ] 124 - ++ windowSystems."${withWindowSystem'}" 116 + ++ windowSystems."${withWindowSystem}" 125 117 ++ builtins.map (b: backends."${b}") withBackends; 126 118 119 + patches = [ 120 + (fetchpatch { 121 + # https://lists.sr.ht/~exec64/imv-devel/patches/55937 122 + name = "update libnsgif backend"; 123 + url = "https://lists.sr.ht/~exec64/imv-devel/%3C20241113012702.30521-2-reallyjohnreed@gmail.com%3E/raw"; 124 + hash = "sha256-/OQeDfIkPtJIIZwL8jYVRy0B7LSBi9/NvAdPoDm851k="; 125 + }) 126 + ]; 127 + 127 128 postInstall = '' 128 129 install -Dm644 ../files/imv.desktop $out/share/applications/ 129 130 ''; 130 131 131 - postFixup = lib.optionalString (withWindowSystem' == "all") '' 132 + postFixup = lib.optionalString (withWindowSystem == "all") '' 132 133 # The `bin/imv` script assumes imv-wayland or imv-x11 in PATH, 133 134 # so we have to fix those to the binaries we installed into the /nix/store 134 135