Source: hyperscan Version: 4.2.0-1 Severity: wishlist Tags: patch User: reproducible-bui...@lists.alioth.debian.org Usertags: locale X-Debbugs-Cc: reproducible-bui...@lists.alioth.debian.org
Hi, While working on the "reproducible builds" effort [1], we have noticed that hyperscan could not be built reproducibly. During the build a timestamp is embedded in the compiled binaries. The attached patch fixes this by using SOURCE_DATE_EPOCH as the timestamp. Once applied, hyperscan can be built reproducibly in our current experimental framework. [1]: https://wiki.debian.org/ReproducibleBuilds Regards, -- Dhole
diff -Nru hyperscan-4.2.0/debian/changelog hyperscan-4.2.0/debian/changelog --- hyperscan-4.2.0/debian/changelog 2016-07-25 21:15:48.000000000 +0200 +++ hyperscan-4.2.0/debian/changelog 2016-07-29 15:39:02.000000000 +0200 @@ -1,3 +1,11 @@ +hyperscan (4.2.0-1.1) UNRELEASED; urgency=medium + + * Non-maintainer upload. + * Use SOURCE_DATE_EPOCH as embedded timestamp to make the build + reproducible. + + -- Eduard Sanou <dh...@openmailbox.org> Fri, 29 Jul 2016 15:38:39 +0200 + hyperscan (4.2.0-1) unstable; urgency=medium * Initial release (Closes: #824838) diff -Nru hyperscan-4.2.0/debian/patches/reproducible-timestamp.patch hyperscan-4.2.0/debian/patches/reproducible-timestamp.patch --- hyperscan-4.2.0/debian/patches/reproducible-timestamp.patch 1970-01-01 01:00:00.000000000 +0100 +++ hyperscan-4.2.0/debian/patches/reproducible-timestamp.patch 2016-07-29 15:40:15.000000000 +0200 @@ -0,0 +1,27 @@ +Description: Reproducible timestamp + Use SOURCE_DATE_EPOCH as a timestamp to make the build reproducible. +Author: Eduard Sanou <dh...@openmailbox.org> + +Index: hyperscan-4.2.0/CMakeLists.txt +=================================================================== +--- hyperscan-4.2.0.orig/CMakeLists.txt ++++ hyperscan-4.2.0/CMakeLists.txt +@@ -6,7 +6,17 @@ set (HS_MINOR_VERSION 2) + set (HS_PATCH_VERSION 0) + set (HS_VERSION ${HS_MAJOR_VERSION}.${HS_MINOR_VERSION}.${HS_PATCH_VERSION}) + +-string (TIMESTAMP BUILD_DATE "%Y-%m-%d") ++if (DEFINED ENV{SOURCE_DATE_EPOCH}) ++ execute_process( ++ COMMAND "date" "-u" "-d" "@$ENV{SOURCE_DATE_EPOCH}" "+%Y-%m-%d" ++ OUTPUT_VARIABLE BUILD_DATE ++ OUTPUT_STRIP_TRAILING_WHITESPACE) ++else () ++ execute_process( ++ COMMAND "date" "+%Y-%m-%d" ++ OUTPUT_VARIABLE BUILD_DATE ++ OUTPUT_STRIP_TRAILING_WHITESPACE) ++endif () + + set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) + include(CheckCCompilerFlag) diff -Nru hyperscan-4.2.0/debian/patches/series hyperscan-4.2.0/debian/patches/series --- hyperscan-4.2.0/debian/patches/series 1970-01-01 01:00:00.000000000 +0100 +++ hyperscan-4.2.0/debian/patches/series 2016-07-29 15:39:15.000000000 +0200 @@ -0,0 +1 @@ +reproducible-timestamp.patch
signature.asc
Description: PGP signature