Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nvimpager: 0.9 -> 0.10 #126027

Merged
merged 3 commits into from
Jun 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions pkgs/tools/misc/nvimpager/default.nix
Original file line number Diff line number Diff line change
@@ -1,36 +1,43 @@
{ fetchFromGitHub
, lib, stdenv
, ncurses, neovim, procps
, pandoc, lua51Packages, util-linux
, scdoc, lua51Packages, util-linux
}:

stdenv.mkDerivation rec {
pname = "nvimpager";
version = "0.9";
version = "0.10";

src = fetchFromGitHub {
owner = "lucc";
repo = pname;
rev = "v${version}";
sha256 = "1xy5387szfw0bp8dr7d4z33wd4xva7q219rvz8gc0vvv1vsy73va";
sha256 = "sha256-okYnPwuxU/syxcKIMUBc25r791D6Bug2w2axH4vvmAY=";
};

buildInputs = [
ncurses # for tput
procps # for nvim_get_proc() which uses ps(1)
];
nativeBuildInputs = [ pandoc ];
nativeBuildInputs = [ scdoc ];

makeFlags = [ "PREFIX=$(out)" ];
buildFlags = [ "nvimpager.configured" ];
buildFlags = [ "nvimpager.configured" "nvimpager.1" ];
preBuild = ''
patchShebangs nvimpager
substituteInPlace nvimpager --replace ':-nvim' ':-${neovim}/bin/nvim'
# remove git command from makefile as we run from a tarball
# replace with actual timestamp of the commit
substituteInPlace makefile --replace '$(shell git log -1 --no-show-signature --pretty="%ct")' 1623019602
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to update this number?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That number is the output of the shell command that it replaces. The makefile assumes that it is run in a git checkout and inspects the last commit date. That is the unix timestamp of the commit.

'';

doCheck = true;
checkInputs = [ lua51Packages.busted util-linux neovim ];
checkPhase = ''script -c "busted --lpath './?.lua' test"'';
checkPhase = ''
runHook preCheck
script -c "busted --lpath './?.lua' test"
runHook postCheck
'';

meta = with lib; {
description = "Use neovim as pager";
Expand Down