2020-12-22 09:11:02 +00:00
|
|
|
{ fetchFromGitHub
|
2021-01-11 07:54:33 +00:00
|
|
|
, lib, stdenv
|
2020-12-22 09:11:02 +00:00
|
|
|
, ncurses, neovim, procps
|
2021-06-07 21:27:37 +00:00
|
|
|
, scdoc, lua51Packages, util-linux
|
2020-12-22 09:11:02 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "nvimpager";
|
2023-05-10 06:08:13 +00:00
|
|
|
version = "0.12.0";
|
2020-12-22 09:11:02 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "lucc";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-05-10 06:08:13 +00:00
|
|
|
sha256 = "sha256-RmpPWS9gnBnR+Atw6uzBmeDSgoTOFSdKzHoJ84O+gyA=";
|
2020-12-22 09:11:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
ncurses # for tput
|
|
|
|
procps # for nvim_get_proc() which uses ps(1)
|
|
|
|
];
|
2021-06-07 21:27:37 +00:00
|
|
|
nativeBuildInputs = [ scdoc ];
|
2020-12-22 09:11:02 +00:00
|
|
|
|
|
|
|
makeFlags = [ "PREFIX=$(out)" ];
|
2021-06-07 21:27:37 +00:00
|
|
|
buildFlags = [ "nvimpager.configured" "nvimpager.1" ];
|
2020-12-22 09:11:02 +00:00
|
|
|
preBuild = ''
|
|
|
|
patchShebangs nvimpager
|
|
|
|
substituteInPlace nvimpager --replace ':-nvim' ':-${neovim}/bin/nvim'
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [ lua51Packages.busted util-linux neovim ];
|
2022-02-05 10:01:38 +00:00
|
|
|
# filter out one test that fails in the sandbox of nix
|
2021-06-07 21:27:37 +00:00
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
2023-05-10 06:08:13 +00:00
|
|
|
make test BUSTED='busted --output TAP --exclude-tags=nix'
|
2021-06-07 21:27:37 +00:00
|
|
|
runHook postCheck
|
|
|
|
'';
|
2020-12-22 09:11:02 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2022-05-28 13:22:26 +00:00
|
|
|
broken = stdenv.isDarwin;
|
2020-12-22 09:11:02 +00:00
|
|
|
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 ];
|
2023-11-27 01:17:53 +00:00
|
|
|
mainProgram = "nvimpager";
|
2020-12-22 09:11:02 +00:00
|
|
|
};
|
|
|
|
}
|