2023-01-11 07:51:40 +00:00
|
|
|
|
{ lib
|
|
|
|
|
, stdenv
|
|
|
|
|
, file
|
|
|
|
|
, fetchFromGitLab
|
|
|
|
|
, buildPerlPackage
|
|
|
|
|
, ArchiveZip
|
|
|
|
|
, ArchiveCpio
|
|
|
|
|
, SubOverride
|
|
|
|
|
, shortenPerlShebang
|
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
buildPerlPackage rec {
|
|
|
|
|
pname = "strip-nondeterminism";
|
2023-03-04 12:14:45 +00:00
|
|
|
|
version = "1.13.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" ]; # no "devdoc"
|
|
|
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
|
owner = "reproducible-builds";
|
|
|
|
|
repo = "strip-nondeterminism";
|
|
|
|
|
domain = "salsa.debian.org";
|
|
|
|
|
rev = version;
|
2023-03-04 12:14:45 +00:00
|
|
|
|
sha256 = "czx9UhdgTsQSfDNo1mMOXCM/3/nuNe+cPZeyy2xdnKs=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
|
strictDeps = true;
|
2021-02-05 17:12:51 +00:00
|
|
|
|
nativeBuildInputs = lib.optionals stdenv.isDarwin [ shortenPerlShebang ];
|
2023-01-11 07:51:40 +00:00
|
|
|
|
buildInputs = [
|
|
|
|
|
ArchiveZip
|
|
|
|
|
ArchiveCpio
|
2023-07-15 17:15:38 +00:00
|
|
|
|
SubOverride
|
2023-01-11 07:51:40 +00:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
|
substituteInPlace lib/File/StripNondeterminism.pm \
|
|
|
|
|
--replace "exec('file'" "exec('${lib.getExe file}'"
|
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
|
patchShebangs ./bin
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
postInstall = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
|
# we don’t need the debhelper script
|
|
|
|
|
rm $out/bin/dh_strip_nondeterminism
|
2023-01-11 07:51:40 +00:00
|
|
|
|
rm $out/share/man/man1/dh_strip_nondeterminism.1
|
2023-03-15 16:39:30 +00:00
|
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
|
|
|
|
shortenPerlShebang $out/bin/strip-nondeterminism
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
installCheckPhase = ''
|
|
|
|
|
runHook preInstallCheck
|
|
|
|
|
($out/bin/strip-nondeterminism --help 2>&1 | grep -q "verbose") || (echo "'$out/bin/strip-nondeterminism --help' failed" && exit 1)
|
|
|
|
|
runHook postInstallCheck
|
2020-04-24 23:36:52 +00:00
|
|
|
|
'';
|
|
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
|
# running shortenPerlShebang in postBuild results in non-functioning binary 'exec format error'
|
|
|
|
|
doCheck = !stdenv.isDarwin;
|
|
|
|
|
doInstallCheck = true;
|
2020-08-20 17:08:02 +00:00
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
|
description = "Perl module for stripping bits of non-deterministic information";
|
2024-04-21 15:54:59 +00:00
|
|
|
|
mainProgram = "strip-nondeterminism";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
homepage = "https://reproducible-builds.org/";
|
2022-09-09 14:08:57 +00:00
|
|
|
|
license = licenses.gpl3Only;
|
2023-01-11 07:51:40 +00:00
|
|
|
|
maintainers = with maintainers; [ pSub artturin ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
}
|