Bug#1072094: ruby-pgplot: please make the build reproducible

Chris Lamb lamby at debian.org
Tue May 28 12:36:48 BST 2024


Source: ruby-pgplot
Version: 0.2.0-4
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0], we noticed that
ruby-pgplot could not be built reproducibly.

The previous patch was not sufficient as we (apparently) can't
guarantee the mtime of the files in the build directory. A patch is
attached (that patches the existing patch!) that more reliably uses
SOURCE_DATE_EPOCH if its available.

 [0] https://reproducible-builds.org/


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org / chris-lamb.co.uk
       `-

-------------- next part --------------
--- a/debian/patches/0001-make-the-build-reproducible.patch	2024-05-28 12:29:06.077839737 +0100
--- b/debian/patches/0001-make-the-build-reproducible.patch	2024-05-28 12:33:57.999806104 +0100
@@ -7,16 +7,19 @@
  doc/myrd2html.rb | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/doc/myrd2html.rb b/doc/myrd2html.rb
-index 134dc39..a259103 100644
---- a/doc/myrd2html.rb
-+++ b/doc/myrd2html.rb
-@@ -13,7 +13,7 @@ while /^--/ =~ ARGV[0]
+--- ruby-pgplot-0.2.0.orig/doc/myrd2html.rb
++++ ruby-pgplot-0.2.0/doc/myrd2html.rb
+@@ -13,7 +13,12 @@ while /^--/ =~ ARGV[0]
  end
  
  rdfile = ARGV.shift
 -$date = File.mtime(rdfile).strftime("%b %d %Y")
-+$date = File.mtime(rdfile).utc.strftime("%b %d %Y ")
++if ENV['SOURCE_DATE_EPOCH'].nil?
++  build_date = Time.now
++else
++  build_date = Time.at(ENV['SOURCE_DATE_EPOCH'].to_i).gmtime
++end
++$date = build_date.utc.strftime("%b %d %Y ")
  
  case $lang
  when 'ja'
--- a/doc/myrd2html.rb	2024-05-28 12:29:06.077839737 +0100
--- b/doc/myrd2html.rb	2024-05-28 12:32:04.000000000 +0100
@@ -13,7 +13,7 @@
 end
 
 rdfile = ARGV.shift
-$date = File.mtime(rdfile).utc.strftime("%b %d %Y ")
+$date = File.mtime(rdfile).strftime("%b %d %Y")
 
 case $lang
 when 'ja'


More information about the Reproducible-bugs mailing list