Winter a19cd4ffb1 Revert "treewide: replace rev with tag"
This reverts commit 65a333600d5c88a98d674f637d092807cfc12253.

This wasn't tested for correctness with something like fodwatch [0],
and should not have been (self-)merged so quickly, especially without
further review.

It also resulted in the breakage of at least one package [1] (and that's
the one we know of and was caught).

A few packages that were updated in between this commit and this revert
were not reverted back to using `rev`, but other than that, this is a
1:1 revert.

[0]: https://codeberg.org/raphaelr/fodwatch
[1]: https://github.com/NixOS/nixpkgs/pull/396904 / 758551e4587d75882aebc21a04bee960418f8ce9
2025-04-08 02:57:25 -04:00

76 lines
1.7 KiB
Nix

{
fetchFromGitHub,
lib,
stdenv,
bash,
ncurses,
neovim,
procps,
scdoc,
lua51Packages,
util-linux,
}:
stdenv.mkDerivation rec {
pname = "nvimpager";
version = "0.13.0";
src = fetchFromGitHub {
owner = "lucc";
repo = "nvimpager";
rev = "v${version}";
sha256 = "sha256-Au9rRZMZfU4qHi/ng6JO8FnMpySKDbKzr75SBPY3QiA=";
};
buildInputs = [
bash
];
nativeBuildInputs = [ scdoc ];
strictDeps = true;
makeFlags = [ "PREFIX=$(out)" ];
buildFlags = [
"nvimpager.configured"
"nvimpager.1"
];
preBuild = ''
patchShebangs nvimpager
substituteInPlace nvimpager --replace-fail ':-nvim' ':-${lib.getExe neovim}'
'';
doCheck = true;
nativeCheckInputs = [
lua51Packages.busted
ncurses # for tput
neovim
procps # for nvim_get_proc() which uses ps(1)
util-linux
];
# filter out one test that fails in the sandbox of nix or with neovim v0.10
# or on macOS
preCheck = ''
checkFlagsArray+=('BUSTED=busted --output TAP --exclude-tags=${
"nix,v10" + lib.optionalString stdenv.hostPlatform.isDarwin ",mac"
}')
'';
postFixup = ''
patchShebangs --update --host $out/bin/nvimpager
'';
meta = with lib; {
description = "Use neovim as pager";
longDescription = ''
Use neovim as a pager to view manpages, diffs, etc with nvim's syntax
highlighting. Includes a cat mode to print highlighted files to stdout
and a ansi esc mode to highlight ansi escape sequences in neovim.
'';
homepage = "https://github.com/lucc/nvimpager";
license = licenses.bsd2;
platforms = platforms.unix;
maintainers = [ maintainers.lucc ];
mainProgram = "nvimpager";
};
}