2022-03-05 16:20:37 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2022-08-12 12:06:08 +00:00
|
|
|
, fetchFromGitea
|
|
|
|
, fetchpatch
|
2022-03-05 16:20:37 +00:00
|
|
|
, giflib
|
|
|
|
, imlib2
|
|
|
|
, libXft
|
|
|
|
, libexif
|
|
|
|
, libwebp
|
2022-08-12 12:06:08 +00:00
|
|
|
, libinotify-kqueue
|
2022-03-05 16:20:37 +00:00
|
|
|
, conf ? null
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "nsxiv";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "30";
|
2022-03-05 16:20:37 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
src = fetchFromGitea {
|
|
|
|
domain = "codeberg.org";
|
2022-03-05 16:20:37 +00:00
|
|
|
owner = "nsxiv";
|
2022-08-12 12:06:08 +00:00
|
|
|
repo = "nsxiv";
|
2022-03-05 16:20:37 +00:00
|
|
|
rev = "v${version}";
|
2022-08-12 12:06:08 +00:00
|
|
|
hash = "sha256-swzTdQ6ow1At4bKRORqz6fb0Ej92yU9rlI/OgcinPu4=";
|
2022-03-05 16:20:37 +00:00
|
|
|
};
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
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=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
buildInputs = [
|
|
|
|
giflib
|
|
|
|
imlib2
|
|
|
|
libXft
|
|
|
|
libexif
|
|
|
|
libwebp
|
2022-08-12 12:06:08 +00:00
|
|
|
] ++ lib.optional stdenv.isDarwin libinotify-kqueue;
|
2022-03-05 16:20:37 +00:00
|
|
|
|
|
|
|
preBuild = lib.optionalString (conf!=null) ''
|
|
|
|
cp ${(builtins.toFile "config.def.h" conf)} config.def.h
|
|
|
|
'';
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-linotify";
|
|
|
|
|
|
|
|
makeFlags = [ "CC:=$(CC)" ];
|
|
|
|
|
|
|
|
installFlags = [ "PREFIX=$(out)" ];
|
|
|
|
|
|
|
|
installTargets = [ "install-all" ];
|
2022-03-05 16:20:37 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2022-08-12 12:06:08 +00:00
|
|
|
homepage = "https://nsxiv.codeberg.page/";
|
2022-03-05 16:20:37 +00:00
|
|
|
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;
|
2022-08-12 12:06:08 +00:00
|
|
|
maintainers = with maintainers; [ AndersonTorres sikmir ];
|
2022-03-05 16:20:37 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|