[med-svn] [jellyfish] 03/03: Enable reproducible builds
Andreas Tille
tille at debian.org
Fri Aug 25 12:03:06 UTC 2017
This is an automated email from the git hooks/post-receive script.
tille pushed a commit to branch master
in repository jellyfish.
commit 45fa1f6576c5792c51f7516a9272ec098ace5cb1
Author: Andreas Tille <tille at debian.org>
Date: Fri Aug 25 14:02:54 2017 +0200
Enable reproducible builds
---
debian/changelog | 3 +++
debian/patches/reproducible.patch | 43 +++++++++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 47 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 04efe37..df63e4b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,9 @@ jellyfish (2.2.6-2) UNRELEASED; urgency=medium
Closes: #865608
* Replace asm statements by C code to increase portability
Closes: #871697
+ * Enable reproducible builds (thanks for the patch to Chris Lamb
+ <lamby at debian.org>)
+ Closes: #863015
-- Andreas Tille <tille at debian.org> Fri, 25 Aug 2017 13:44:29 +0200
diff --git a/debian/patches/reproducible.patch b/debian/patches/reproducible.patch
new file mode 100644
index 0000000..122a8c1
--- /dev/null
+++ b/debian/patches/reproducible.patch
@@ -0,0 +1,43 @@
+Author: Chris Lamb <lamby at debian.org>
+Last-Update: Sat, 20 May 2017 07:39:01 UTC
+Bug-Debian: https://bugs.debian.org/863015
+Description: Enable reproducible build by avoiding the current
+ date with time zone in json output
+
+--- a/include/jellyfish/generic_file_header.hpp
++++ b/include/jellyfish/generic_file_header.hpp
+@@ -180,6 +180,8 @@ public:
+
+ protected:
+ std::string get_hostname() const {
++ if(std::getenv("SOURCE_DATE_EPOCH"))
++ return "";
+ struct utsname buf;
+ if(uname(&buf) == -1)
+ return "";
+@@ -187,6 +189,8 @@ protected:
+ }
+
+ std::string get_pwd() const {
++ if(std::getenv("SOURCE_DATE_EPOCH"))
++ return ".";
+ #ifdef PATH_MAX
+ size_t len = PATH_MAX;
+ #else
+@@ -202,6 +206,16 @@ protected:
+ std::string get_localtime() const {
+ time_t t = time(0);
+ std::string res(ctime(&t));
++ char *source_date_epoch = std::getenv("SOURCE_DATE_EPOCH");
++ if(source_date_epoch) {
++ std::istringstream iss(source_date_epoch);
++ iss >> t;
++ if(iss.fail() || !iss.eof()) {
++ std::cerr << "Error: Cannot parse SOURCE_DATE_EPOCH as integer\n";
++ exit(27);
++ }
++ res = asctime(gmtime(&t));
++ }
+ chomp(res);
+ return res;
+ }
diff --git a/debian/patches/series b/debian/patches/series
index 19cbb40..7b1331e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,3 +5,4 @@ spelling
rename-python-module-to-dna_jellyfish.patch
gcc-7.patch
portability.patch
+reproducible.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/jellyfish.git
More information about the debian-med-commit
mailing list