Bug#842050: tj3: please make the build reproducible

Chris Lamb lamby at debian.org
Tue Oct 25 14:10:58 UTC 2016


Source: tj3
Version: 3.6.0-3.1
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-builds at lists.alioth.debian.org

Hi,

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

Patch attached.

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


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org / chris-lamb.co.uk
       `-
-------------- next part --------------
--- a/debian/patches/reproducible-build2.patch	1970-01-01 01:00:00.000000000 +0100
--- b/debian/patches/reproducible-build2.patch	2016-10-25 15:06:00.777006822 +0100
@@ -0,0 +1,39 @@
+Description: Make the build reproducible
+Author: Chris Lamb <lamby at debian.org>
+Last-Update: 2016-10-25
+
+--- tj3-3.6.0.orig/lib/taskjuggler/TjTime.rb
++++ tj3-3.6.0/lib/taskjuggler/TjTime.rb
+@@ -42,7 +42,11 @@ class TaskJuggler
+     def initialize(t = nil)
+       case t
+       when nil
+-        @time = Time.now
++        if ENV['SOURCE_DATE_EPOCH'].nil?
++          @time = Time.now
++        else
++          @time = Time.at(ENV['SOURCE_DATE_EPOCH'].to_i).gmtime
++        end
+       when Time
+         @time = t
+       when TjTime
+--- tj3-3.6.0.orig/lib/taskjuggler/VimSyntax.rb
++++ tj3-3.6.0/lib/taskjuggler/VimSyntax.rb
+@@ -61,11 +61,16 @@ class TaskJuggler
+     def header
+       # Generate the header section. Mostly consists of comments and a check
+       # if we have source the syntax file already.
++      if ENV['SOURCE_DATE_EPOCH'].nil?
++        now = Time.now
++      else
++        now = Time.at(ENV['SOURCE_DATE_EPOCH'].to_i).gmtime
++      end
+       @file.write <<"EOT"
+ " Vim syntax file
+ " Language:     TaskJuggler
+ " Maintainer:   TaskJuggler Developers <taskjuggler-devel at googlegroups.com>
+-" Last Change:  #{Time.now}
++" Last Change:  #{now}
+ " This file was automatically generated by VimSyntax.rb
+ 
+ if exists("b:current_syntax")
--- a/debian/patches/series	2016-10-25 14:52:07.738648300 +0100
--- b/debian/patches/series	2016-10-25 15:02:07.399223323 +0100
@@ -6,3 +6,4 @@
 data-search-dirs-debian.patch
 reproducible-build.patch
 manual-path.patch
+reproducible-build2.patch


More information about the Reproducible-builds mailing list