Merge pull request #281059 from onemoresuza/haredo

haredo: wrap program with a shell
This commit is contained in:
Thiago Kenji Okada 2024-01-23 10:28:49 +00:00 committed by GitHub
commit 6284c22db2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,6 +4,8 @@
, hare
, scdoc
, nix-update-script
, makeWrapper
, bash
}:
stdenv.mkDerivation (finalAttrs: {
pname = "haredo";
@ -20,9 +22,16 @@ stdenv.mkDerivation (finalAttrs: {
nativeBuildInputs = [
hare
makeWrapper
scdoc
];
enableParallelChecking = true;
doCheck = true;
dontConfigure = true;
preBuild = ''
HARECACHE="$(mktemp -d --tmpdir harecache.XXXXXXXX)"
export HARECACHE
@ -40,7 +49,7 @@ stdenv.mkDerivation (finalAttrs: {
checkPhase = ''
runHook preCheck
./bin/haredo test
./bin/haredo ''${enableParallelChecking:+-j$NIX_BUILD_CORES} test
runHook postCheck
'';
@ -53,8 +62,10 @@ stdenv.mkDerivation (finalAttrs: {
runHook postInstall
'';
dontConfigure = true;
doCheck = true;
postFixup = ''
wrapProgram $out/bin/haredo \
--prefix PATH : "${lib.makeBinPath [bash]}"
'';
setupHook = ./setup-hook.sh;