2023-03-27 19:17:25 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
zig,
|
|
|
|
testers,
|
2023-07-15 17:15:38 +00:00
|
|
|
installShellFiles,
|
2023-03-27 19:17:25 +00:00
|
|
|
zf,
|
|
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "zf";
|
|
|
|
version = "0.8.0";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "natecraddock";
|
|
|
|
repo = pname;
|
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
fetchSubmodules = true;
|
|
|
|
hash = "sha256-MzlSU5x2lb6PJZ/iNAi2aebfuClBprlfHMIG/4OPmuc=";
|
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
nativeBuildInputs = [ zig installShellFiles ];
|
2023-03-27 19:17:25 +00:00
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
'';
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
zig build -Drelease-safe -Dcpu=baseline
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
zig build test
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
2023-03-27 19:17:25 +00:00
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
zig build -Drelease-safe -Dcpu=baseline --prefix $out install
|
2023-07-15 17:15:38 +00:00
|
|
|
installManPage doc/zf.1
|
|
|
|
installShellCompletion \
|
|
|
|
--bash complete/zf \
|
|
|
|
--fish complete/zf.fish \
|
|
|
|
--zsh complete/_zf
|
2023-03-27 19:17:25 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.tests.version = testers.testVersion {package = zf;};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/natecraddock/zf";
|
|
|
|
description = "A commandline fuzzy finder that prioritizes matches on filenames";
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ dit7ya mmlb ];
|
|
|
|
};
|
|
|
|
}
|