From 44b7b8bb0e5dff1f60f7c69780e360772391982d Mon Sep 17 00:00:00 2001 From: Marcin Serwin Date: Sat, 8 Mar 2025 18:26:48 +0100 Subject: [PATCH 1/2] imv: add patch for libnsgif --- pkgs/by-name/im/imv/package.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/im/imv/package.nix b/pkgs/by-name/im/imv/package.nix index 45005c77bebb..e0bb48cd5c3e 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, @@ -17,7 +18,6 @@ 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, @@ -124,6 +125,15 @@ stdenv.mkDerivation rec { ++ 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/ ''; From 20aed51958a11dfdf80b165a1ec375a3a8cd3f64 Mon Sep 17 00:00:00 2001 From: Marcin Serwin Date: Sat, 8 Mar 2025 18:30:18 +0100 Subject: [PATCH 2/2] imv: use withWindowSystem default value directly --- pkgs/by-name/im/imv/package.nix | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/pkgs/by-name/im/imv/package.nix b/pkgs/by-name/im/imv/package.nix index e0bb48cd5c3e..95b2f8976c93 100644 --- a/pkgs/by-name/im/imv/package.nix +++ b/pkgs/by-name/im/imv/package.nix @@ -13,7 +13,7 @@ icu75, pango, inih, - withWindowSystem ? null, + withWindowSystem ? if stdenv.hostPlatform.isLinux then "all" else "x11", xorg, libxkbcommon, libGLU, @@ -38,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 = [ @@ -76,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) @@ -98,7 +89,7 @@ stdenv.mkDerivation rec { }; mesonFlags = [ - "-Dwindows=${withWindowSystem'}" + "-Dwindows=${withWindowSystem}" "-Dtest=enabled" "-Dman=enabled" ] ++ backendFlags; @@ -122,7 +113,7 @@ stdenv.mkDerivation rec { pango inih ] - ++ windowSystems."${withWindowSystem'}" + ++ windowSystems."${withWindowSystem}" ++ builtins.map (b: backends."${b}") withBackends; patches = [ @@ -138,7 +129,7 @@ stdenv.mkDerivation rec { 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