--- a/debian/patches/reproducible_build.patch 1970-01-01 01:00:00.000000000 +0100 --- b/debian/patches/reproducible_build.patch 2016-08-27 22:53:24.536392067 +0100 @@ -0,0 +1,27 @@ +Description: Make the build reproducible +Author: Chris Lamb +Last-Update: 2016-08-27 + +--- cp2k-3.0.0.orig/makefiles/Makefile ++++ cp2k-3.0.0/makefiles/Makefile +@@ -412,12 +412,20 @@ endif + + # some practical variables for the build + ifeq ($(CPPSHELL),) ++ifdef SOURCE_DATE_EPOCH ++CPPSHELL := -D__COMPILE_ARCH="\"$(ARCH)\""\ ++ -D__COMPILE_DATE="\"$(shell LC_ALL=C date --utc --date=@$${SOURCE_DATE_EPOCH})\""\ ++ -D__COMPILE_HOST="\"generic\""\ ++ -D__COMPILE_REVISION="\"$(strip $(REVISION))\""\ ++ -D__DATA_DIR="\"$(DATA_DIR)\"" ++else + CPPSHELL := -D__COMPILE_ARCH="\"$(ARCH)\""\ + -D__COMPILE_DATE="\"$(shell date)\""\ + -D__COMPILE_HOST="\"$(shell hostname)\""\ + -D__COMPILE_REVISION="\"$(strip $(REVISION))\""\ + -D__DATA_DIR="\"$(DATA_DIR)\"" + endif ++endif + + ifneq ($(CPP),) + # always add the SRCDIR to the include path (-I here might not be portable) --- a/debian/patches/series 2016-08-27 21:36:37.629174836 +0100 --- b/debian/patches/series 2016-08-27 22:53:22.348369738 +0100 @@ -1,3 +1,4 @@ makeflags.patch testsuite_output.patch libxc3_support.patch +reproducible_build.patch