2022-03-05 16:20:37 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2022-08-12 12:06:08 +00:00
|
|
|
, fetchFromGitea
|
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";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "31";
|
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}";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-X1ZMr5OADs9GIe/kp/kEqKMMHZMymd58m9+f0SPzn7s=";
|
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;
|
2023-07-15 17:15:38 +00:00
|
|
|
changelog = "https://codeberg.org/nsxiv/nsxiv/src/tag/${src.rev}/etc/CHANGELOG.md";
|
2022-03-05 16:20:37 +00:00
|
|
|
};
|
|
|
|
}
|