From 2e363860c6cdc82e6ccb36ee342a81fd4aa029bf Mon Sep 17 00:00:00 2001 From: Markus Kowalewski Date: Thu, 4 Apr 2019 14:51:33 +0200 Subject: [PATCH] openmpi: make build reproducible fix: * build and configure time stamps * build and configure user --- pkgs/development/libraries/openmpi/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/libraries/openmpi/default.nix b/pkgs/development/libraries/openmpi/default.nix index 06e4726054e..974e98ad209 100644 --- a/pkgs/development/libraries/openmpi/default.nix +++ b/pkgs/development/libraries/openmpi/default.nix @@ -30,6 +30,13 @@ in stdenv.mkDerivation rec { postPatch = '' patchShebangs ./ + + # Ensure build is reproducible + ts=`date -d @$SOURCE_DATE_EPOCH` + sed -i 's/OPAL_CONFIGURE_USER=.*/OPAL_CONFIGURE_USER="nixbld"/' configure + sed -i 's/OPAL_CONFIGURE_HOST=.*/OPAL_CONFIGURE_HOST="localhost"/' configure + sed -i "s/OPAL_CONFIGURE_DATE=.*/OPAL_CONFIGURE_DATE=\"$ts\"/" configure + find -name "Makefile.in" -exec sed -i "s/\`date\`/$ts/" \{} \; ''; buildInputs = with stdenv; [ gfortran zlib ]