From d707691b3574998bcd10028c1419ca6695e8713d Mon Sep 17 00:00:00 2001 From: Artturin Date: Tue, 14 Feb 2023 05:31:43 +0200 Subject: [PATCH] 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 --- .../perl-modules/strip-nondeterminism/default.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pkgs/development/perl-modules/strip-nondeterminism/default.nix b/pkgs/development/perl-modules/strip-nondeterminism/default.nix index 806ad65b737..f867e843743 100644 --- a/pkgs/development/perl-modules/strip-nondeterminism/default.nix +++ b/pkgs/development/perl-modules/strip-nondeterminism/default.nix @@ -40,17 +40,25 @@ buildPerlPackage rec { postBuild = '' patchShebangs ./bin - '' + lib.optionalString stdenv.isDarwin '' - shortenPerlShebang bin/strip-nondeterminism ''; postInstall = '' # we don’t 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";