strip-nondeterminism: fix binary functioning on darwin

result/bin/strip-nondeterminism: bad interpreter: /nix/store/mym5b5zbzgny17ixqr8kgwmndc3k4y2r-perl-5.36.0/bin/perl -I/nix/store/mym5b5zbzgny17ixqr8kgwmndc3k4y2r-perl-5.36.0/lib: exec format error
This commit is contained in:
Artturin 2023-02-14 05:31:43 +02:00
parent fa169bb239
commit d707691b35

View File

@ -40,17 +40,25 @@ buildPerlPackage rec {
postBuild = ''
patchShebangs ./bin
'' + lib.optionalString stdenv.isDarwin ''
shortenPerlShebang bin/strip-nondeterminism
'';
postInstall = ''
# we dont need the debhelper script
rm $out/bin/dh_strip_nondeterminism
rm $out/share/man/man1/dh_strip_nondeterminism.1
'' + lib.optionalString stdenv.isDarwin ''
shortenPerlShebang $out/bin/strip-nondeterminism
'';
doCheck = true;
installCheckPhase = ''
runHook preInstallCheck
($out/bin/strip-nondeterminism --help 2>&1 | grep -q "verbose") || (echo "'$out/bin/strip-nondeterminism --help' failed" && exit 1)
runHook postInstallCheck
'';
# running shortenPerlShebang in postBuild results in non-functioning binary 'exec format error'
doCheck = !stdenv.isDarwin;
doInstallCheck = true;
meta = with lib; {
description = "A Perl module for stripping bits of non-deterministic information";