From f7cfc8f319935cbed44703ce0614504fa186aa51 Mon Sep 17 00:00:00 2001 From: Artturin Date: Tue, 26 Oct 2021 13:48:51 +0300 Subject: [PATCH] perl: build reproducibly --- pkgs/development/interpreters/perl/default.nix | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/perl/default.nix b/pkgs/development/interpreters/perl/default.nix index 45c12b9720c4..9b1b4d612196 100644 --- a/pkgs/development/interpreters/perl/default.nix +++ b/pkgs/development/interpreters/perl/default.nix @@ -100,9 +100,22 @@ let enableParallelBuilding = !crossCompiling; + # perl includes the build date, the uname of the build system and the + # username of the build user in some files. + # We override these to make it build deterministically. + # other distro solutions + # https://github.com/bmwiedemann/openSUSE/blob/master/packages/p/perl/perl-reproducible.patch + # https://github.com/archlinux/svntogit-packages/blob/packages/perl/trunk/config.over + # https://salsa.debian.org/perl-team/interpreter/perl/blob/debian-5.26/debian/config.over + # A ticket has been opened upstream to possibly clean some of this up: https://rt.perl.org/Public/Bug/Display.html?id=133452 preConfigure = '' - substituteInPlace ./Configure --replace '`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`' 'Thu Jan 1 00:00:01 UTC 1970' - substituteInPlace ./Configure --replace '$uname -a' '$uname --kernel-name --machine --operating-system' + cat > config.over <