Source: sbt
Version: 0.13.13-1
Severity: wishlist
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org

Hi,

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

Patch attached.

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


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      la...@debian.org / chris-lamb.co.uk
       `-
--- a/debian/patches/reproducible_build.patch   1970-01-01 01:00:00.000000000 
+0100
--- b/debian/patches/reproducible_build.patch   2017-05-01 13:31:44.909639506 
+0100
@@ -0,0 +1,17 @@
+Description: Make the build reproducible
+Author: Chris Lamb <la...@debian.org>
+Last-Update: 2017-05-01
+
+--- sbt-0.13.13.orig/project/Util.scala
++++ sbt-0.13.13/project/Util.scala
+@@ -62,7 +62,9 @@ object Util {
+       import java.util.{ Date, TimeZone }
+       val formatter = new java.text.SimpleDateFormat("yyyyMMdd'T'HHmmss")
+       formatter.setTimeZone(TimeZone.getTimeZone("GMT"))
+-      val timestamp = formatter.format(new Date)
++      var timestamp = formatter.format(new Date)
++      try { timestamp = formatter.format(new 
Date(sys.env("SOURCE_DATE_EPOCH").toLong * 1000L)) }
++      catch { case e: Exception => s.log.warn("Could not read 
SOURCE_DATE_EPOCH"); Nil }
+       val content = versionLine(version) + "\ntimestamp=" + timestamp
+       val f = dir / "xsbt.version.properties"
+       if (!f.exists || f.lastModified < lastCompilationTime(analysis) || 
!containsVersion(f, version)) {
--- a/debian/patches/series     2017-05-01 13:31:30.973574029 +0100
--- b/debian/patches/series     2017-05-01 13:31:44.909639506 +0100
@@ -4,3 +4,4 @@
 #add-default-local-debian-resolver.patch
 add-local-debian-maven-repo.patch
 base-on-scala211.patch
+reproducible_build.patch
__
This is the maintainer address of Debian's Java team
<http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-java-maintainers>. 
Please use
debian-j...@lists.debian.org for discussions and questions.

Reply via email to