From 3da0342d6dab31c61be5c3dbe92765875d8e0e84 Mon Sep 17 00:00:00 2001 From: Nikolay Korotkiy Date: Sun, 7 Aug 2022 08:35:13 +0300 Subject: [PATCH] =?UTF-8?q?nsxiv:=2029=20=E2=86=92=2030?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/applications/graphics/nsxiv/default.nix | 38 +++++++++++++------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/pkgs/applications/graphics/nsxiv/default.nix b/pkgs/applications/graphics/nsxiv/default.nix index c1ebbd57c0d6..019aaf86dc3b 100644 --- a/pkgs/applications/graphics/nsxiv/default.nix +++ b/pkgs/applications/graphics/nsxiv/default.nix @@ -1,43 +1,58 @@ { lib , stdenv -, fetchFromGitHub +, fetchFromGitea +, fetchpatch , giflib , imlib2 , libXft , libexif , libwebp +, libinotify-kqueue , conf ? null }: stdenv.mkDerivation rec { pname = "nsxiv"; - version = "29"; + version = "30"; - src = fetchFromGitHub { + src = fetchFromGitea { + domain = "codeberg.org"; owner = "nsxiv"; - repo = pname; + repo = "nsxiv"; rev = "v${version}"; - hash = "sha256-JUF2cF6QeAXk6G76uMu3reaMgxp2RcqHDbamkNufwqE="; + hash = "sha256-swzTdQ6ow1At4bKRORqz6fb0Ej92yU9rlI/OgcinPu4="; }; + patches = [ + # Fix build failure when _SC_PHYS_PAGES is not defined + (fetchpatch { + url = "https://codeberg.org/nsxiv/nsxiv/commit/1a50bff9f300f84e93a6e7035657e6029e7e8183.patch"; + hash = "sha256-PpUqGVWaJ06EVu3tBKVzOh8HYvT6wAG3bvY6wUD+dTM="; + }) + ]; + buildInputs = [ giflib imlib2 libXft libexif libwebp - ]; + ] ++ lib.optional stdenv.isDarwin libinotify-kqueue; preBuild = lib.optionalString (conf!=null) '' cp ${(builtins.toFile "config.def.h" conf)} config.def.h ''; - makeFlags = [ - "PREFIX=${placeholder "out"}" - ]; + NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-linotify"; + + makeFlags = [ "CC:=$(CC)" ]; + + installFlags = [ "PREFIX=$(out)" ]; + + installTargets = [ "install-all" ]; meta = with lib; { - homepage = "https://nsxiv.github.io/nsxiv/"; + homepage = "https://nsxiv.codeberg.page/"; description = "New Suckless X Image Viewer"; longDescription = '' nsxiv is a fork of now unmaintained sxiv with the purpose of being a @@ -54,8 +69,7 @@ stdenv.mkDerivation rec { - Display image name/path in X title ''; license = licenses.gpl2Plus; - maintainers = with maintainers; [ AndersonTorres ]; + maintainers = with maintainers; [ AndersonTorres sikmir ]; platforms = platforms.unix; - broken = stdenv.isDarwin; }; }