about summary refs log tree commit diff
path: root/pkgs/by-name/ns
diff options
context:
space:
mode:
authorAnderson Torres <torres.anderson.85@protonmail.com>2023-10-11 18:45:28 -0300
committerAnderson Torres <torres.anderson.85@protonmail.com>2023-10-12 01:30:41 -0300
commit7d44850eed96a2c0fc3ac99d811406c489d8ffe1 (patch)
treea4c4efed236b6c4e777c19fb2d77c3c9e5815f32 /pkgs/by-name/ns
parentd4e6bfe2972da4f69b48db2b36be70db8c1503f5 (diff)
downloadnixlib-7d44850eed96a2c0fc3ac99d811406c489d8ffe1.tar
nixlib-7d44850eed96a2c0fc3ac99d811406c489d8ffe1.tar.gz
nixlib-7d44850eed96a2c0fc3ac99d811406c489d8ffe1.tar.bz2
nixlib-7d44850eed96a2c0fc3ac99d811406c489d8ffe1.tar.lz
nixlib-7d44850eed96a2c0fc3ac99d811406c489d8ffe1.tar.xz
nixlib-7d44850eed96a2c0fc3ac99d811406c489d8ffe1.tar.zst
nixlib-7d44850eed96a2c0fc3ac99d811406c489d8ffe1.zip
nsxiv: migrate to by-name
Diffstat (limited to 'pkgs/by-name/ns')
-rw-r--r--pkgs/by-name/ns/nsxiv/package.nix67
1 files changed, 67 insertions, 0 deletions
diff --git a/pkgs/by-name/ns/nsxiv/package.nix b/pkgs/by-name/ns/nsxiv/package.nix
new file mode 100644
index 000000000000..9f9673faa2a3
--- /dev/null
+++ b/pkgs/by-name/ns/nsxiv/package.nix
@@ -0,0 +1,67 @@
+{ lib
+, stdenv
+, fetchFromGitea
+, giflib
+, imlib2
+, libXft
+, libexif
+, libwebp
+, libinotify-kqueue
+, conf ? null
+}:
+
+stdenv.mkDerivation rec {
+  pname = "nsxiv";
+  version = "31";
+
+  src = fetchFromGitea {
+    domain = "codeberg.org";
+    owner = "nsxiv";
+    repo = "nsxiv";
+    rev = "v${version}";
+    hash = "sha256-X1ZMr5OADs9GIe/kp/kEqKMMHZMymd58m9+f0SPzn7s=";
+  };
+
+  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
+  '';
+
+  NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-linotify";
+
+  makeFlags = [ "CC:=$(CC)" ];
+
+  installFlags = [ "PREFIX=$(out)" ];
+
+  installTargets = [ "install-all" ];
+
+  meta = with lib; {
+    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
+      drop-in replacement of sxiv, maintaining it and adding simple, sensible
+      features, like:
+
+      - Basic image operations, e.g. zooming, panning, rotating
+      - Customizable key and mouse button mappings (in config.h)
+      - Script-ability via key-handler
+      - Thumbnail mode: grid of selectable previews of all images
+      - Ability to cache thumbnails for fast re-loading
+      - Basic support for animated/multi-frame images (GIF/WebP)
+      - Display image information in status bar
+      - Display image name/path in X title
+    '';
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ AndersonTorres sikmir ];
+    platforms = platforms.unix;
+    changelog = "https://codeberg.org/nsxiv/nsxiv/src/tag/${src.rev}/etc/CHANGELOG.md";
+  };
+}