Source: requirejs
Version: 2.3.6+ds-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
requirejs could not be built reproducibly.
This is because the build system was adding in the current build date
and time to the generated files:
- version = '2.3.6 Thu, 26 Nov 2020 10:12:52 GMT',
+ version = '2.3.6 Wed, 29 Dec 2021 16:36:37 GMT',
Patch attached that uses SOURCE_DATE_EPOCH.
[0] https://reproducible-builds.org/
[1] https://reproducible-builds.org/specs/source-date-epoch/
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 2020-11-27 10:41:14.529326867
+0000
@@ -0,0 +1,15 @@
+Description: Make the build reproducible
+Author: Chris Lamb <la...@debian.org>
+Last-Update: 2020-11-27
+
+--- requirejs-2.3.6+ds.orig/copydist.js
++++ requirejs-2.3.6+ds/copydist.js
+@@ -1,7 +1,7 @@
+ #!/usr/bin/env node
+
+ var fs = require('fs'),
+- stamp = (new Date()).toUTCString(),
++ stamp = (new Date(process.env.SOURCE_DATE_EPOCH ?
(process.env.SOURCE_DATE_EPOCH * 1000) : new Date().getTime())).toUTCString(),
+ exec = require('child_process').exec,
+ distFileName = 'dist/r.js',
+ count = 0,
--- a/debian/patches/series 2020-11-27 09:48:02.798412122 +0000
--- b/debian/patches/series 2020-11-27 10:41:13.677316276 +0000
@@ -0,0 +1 @@
+reproducible-build.patch