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
|
|
|
|
}:
|
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2022-03-05 16:20:37 +00:00
|
|
|
pname = "nsxiv";
|
2023-10-19 13:55:26 +00:00
|
|
|
version = "32";
|
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";
|
2023-10-19 13:55:26 +00:00
|
|
|
rev = "v${finalAttrs.version}";
|
|
|
|
hash = "sha256-UWaet7hVtgfuWTiNY4VcsMWTfS6L9r5w1fb/0dWz8SI=";
|
2022-03-05 16:20:37 +00:00
|
|
|
};
|
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
outputs = [ "out" "man" "doc" ];
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
buildInputs = [
|
|
|
|
giflib
|
|
|
|
imlib2
|
|
|
|
libXft
|
|
|
|
libexif
|
|
|
|
libwebp
|
2024-09-26 11:04:55 +00:00
|
|
|
] ++ lib.optional stdenv.hostPlatform.isDarwin libinotify-kqueue;
|
2022-03-05 16:20:37 +00:00
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
postPatch = lib.optionalString (conf != null) ''
|
2022-03-05 16:20:37 +00:00
|
|
|
cp ${(builtins.toFile "config.def.h" conf)} config.def.h
|
|
|
|
'';
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
env.NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-linotify";
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
makeFlags = [ "CC:=$(CC)" ];
|
|
|
|
|
|
|
|
installFlags = [ "PREFIX=$(out)" ];
|
|
|
|
|
|
|
|
installTargets = [ "install-all" ];
|
2022-03-05 16:20:37 +00:00
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
meta = {
|
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";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "nsxiv";
|
2022-03-05 16:20:37 +00:00
|
|
|
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
|
|
|
|
'';
|
2023-10-19 13:55:26 +00:00
|
|
|
changelog = "https://codeberg.org/nsxiv/nsxiv/src/tag/${finalAttrs.src.rev}/etc/CHANGELOG.md";
|
|
|
|
license = lib.licenses.gpl2Plus;
|
|
|
|
maintainers = with lib.maintainers; [ AndersonTorres sikmir ];
|
|
|
|
platforms = lib.platforms.unix;
|
2022-03-05 16:20:37 +00:00
|
|
|
};
|
2023-10-19 13:55:26 +00:00
|
|
|
})
|