btrbk: add mainProgram
[NixPkgs.git] / pkgs / by-name / ns / nsxiv / package.nix
blobb54c8ce55f4ea1343a117738e113646fb969505f
1 { lib
2 , stdenv
3 , fetchFromGitea
4 , giflib
5 , imlib2
6 , libXft
7 , libexif
8 , libwebp
9 , libinotify-kqueue
10 , conf ? null
13 stdenv.mkDerivation (finalAttrs: {
14   pname = "nsxiv";
15   version = "32";
17   src = fetchFromGitea {
18     domain = "codeberg.org";
19     owner = "nsxiv";
20     repo = "nsxiv";
21     rev = "v${finalAttrs.version}";
22     hash = "sha256-UWaet7hVtgfuWTiNY4VcsMWTfS6L9r5w1fb/0dWz8SI=";
23   };
25   outputs = [ "out" "man" "doc" ];
27   buildInputs = [
28     giflib
29     imlib2
30     libXft
31     libexif
32     libwebp
33   ] ++ lib.optional stdenv.hostPlatform.isDarwin libinotify-kqueue;
35   postPatch = lib.optionalString (conf != null) ''
36     cp ${(builtins.toFile "config.def.h" conf)} config.def.h
37   '';
39   env.NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-linotify";
41   makeFlags = [ "CC:=$(CC)" ];
43   installFlags = [ "PREFIX=$(out)" ];
45   installTargets = [ "install-all" ];
47   meta = {
48     homepage = "https://nsxiv.codeberg.page/";
49     description = "New Suckless X Image Viewer";
50     mainProgram = "nsxiv";
51     longDescription = ''
52       nsxiv is a fork of now unmaintained sxiv with the purpose of being a
53       drop-in replacement of sxiv, maintaining it and adding simple, sensible
54       features, like:
56       - Basic image operations, e.g. zooming, panning, rotating
57       - Customizable key and mouse button mappings (in config.h)
58       - Script-ability via key-handler
59       - Thumbnail mode: grid of selectable previews of all images
60       - Ability to cache thumbnails for fast re-loading
61       - Basic support for animated/multi-frame images (GIF/WebP)
62       - Display image information in status bar
63       - Display image name/path in X title
64     '';
65     changelog = "https://codeberg.org/nsxiv/nsxiv/src/tag/${finalAttrs.src.rev}/etc/CHANGELOG.md";
66     license = lib.licenses.gpl2Plus;
67     maintainers = with lib.maintainers; [ AndersonTorres sikmir ];
68     platforms = lib.platforms.unix;
69   };