nvimpager: init at 0.9 (#107057)

* nvimpager: init at 0.9

* nvimpager: fixup: doCheck can be overriden with `overrideAttrs`

* nvimpager: fixup: use patchShebangs instead of substituteInPlace

* nvimpager: fixup: move pandoc to nativeBuildInputs

* Fix typo

* nvimpager: fixup: run the tests in a pseudo tty

* nvimpager: fixup: make all dependencies overridable
This commit is contained in:
Lucas Hoffmann 2020-12-22 10:11:02 +01:00 committed by GitHub
parent ca8343d1b9
commit 4d0c6c645c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 55 additions and 0 deletions

View File

@ -4942,6 +4942,12 @@
githubId = 45168934;
name = "Louis Blin";
};
lucc = {
email = "lucc+nix@posteo.de";
github = "lucc";
githubId = 1104419;
name = "Lucas Hoffmann";
};
ldelelis = {
email = "ldelelis@est.frba.utn.edu.ar";
github = "ldelelis";

View File

@ -0,0 +1,47 @@
{ fetchFromGitHub
, stdenv
, ncurses, neovim, procps
, pandoc, lua51Packages, util-linux
}:
stdenv.mkDerivation rec {
pname = "nvimpager";
version = "0.9";
src = fetchFromGitHub {
owner = "lucc";
repo = pname;
rev = "v${version}";
sha256 = "1xy5387szfw0bp8dr7d4z33wd4xva7q219rvz8gc0vvv1vsy73va";
};
buildInputs = [
ncurses # for tput
procps # for nvim_get_proc() which uses ps(1)
];
nativeBuildInputs = [ pandoc ];
makeFlags = [ "PREFIX=$(out)" ];
buildFlags = [ "nvimpager.configured" ];
preBuild = ''
patchShebangs nvimpager
substituteInPlace nvimpager --replace ':-nvim' ':-${neovim}/bin/nvim'
'';
doCheck = true;
checkInputs = [ lua51Packages.busted util-linux neovim ];
checkPhase = ''script -c "busted --lpath './?.lua' test"'';
meta = with stdenv.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 ];
};
}

View File

@ -6165,6 +6165,8 @@ in
nssmdns = callPackage ../tools/networking/nss-mdns { };
nvimpager = callPackage ../tools/misc/nvimpager { };
nwdiag = with python3Packages; toPythonApplication nwdiag;
nxdomain = python3.pkgs.callPackage ../tools/networking/nxdomain { };