nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 file,
5 fetchFromGitLab,
6 buildPerlPackage,
7 ArchiveZip,
8 ArchiveCpio,
9 SubOverride,
10 gitUpdater,
11}:
12
13buildPerlPackage rec {
14 pname = "strip-nondeterminism";
15 version = "1.14.1";
16
17 outputs = [
18 "out"
19 "dev"
20 ]; # no "devdoc"
21
22 src = fetchFromGitLab {
23 owner = "reproducible-builds";
24 repo = "strip-nondeterminism";
25 domain = "salsa.debian.org";
26 rev = version;
27 sha256 = "C/812td9BX1YRqFpD9QYgBfzE+biZeAKgxoNcxpb6UU=";
28 };
29
30 strictDeps = true;
31 buildInputs = [
32 ArchiveZip
33 ArchiveCpio
34 SubOverride
35 ];
36
37 postPatch = ''
38 substituteInPlace lib/File/StripNondeterminism.pm \
39 --replace "exec('file'" "exec('${lib.getExe file}'"
40 '';
41
42 postBuild = ''
43 patchShebangs ./bin
44 '';
45
46 postInstall = ''
47 # we don’t need the debhelper script
48 rm $out/bin/dh_strip_nondeterminism
49 rm $out/share/man/man1/dh_strip_nondeterminism.1
50 '';
51
52 installCheckPhase = ''
53 runHook preInstallCheck
54 ($out/bin/strip-nondeterminism --help 2>&1 | grep -q "verbose") || (echo "'$out/bin/strip-nondeterminism --help' failed" && exit 1)
55 runHook postInstallCheck
56 '';
57
58 doInstallCheck = true;
59
60 passthru = {
61 updateScript = gitUpdater { };
62 };
63
64 meta = {
65 description = "Perl module for stripping bits of non-deterministic information";
66 mainProgram = "strip-nondeterminism";
67 homepage = "https://reproducible-builds.org/";
68 license = lib.licenses.gpl3Only;
69 maintainers = with lib.maintainers; [
70 pSub
71 artturin
72 ];
73 };
74}