Source: node-uplot
Version: 1.6.32+ds3-1
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: timestamps
X-Debbugs-Cc: [email protected]

Hi,

Whilst working on the Reproducible Builds effort [0], we noticed that
node-uplot could not be built reproducibly. This is because the .js files
shipped in the binary embed the current build year for the copyright year
range.

A patch is attached that seeds this date from SOURCE_DATE_EPOCH (if it is
available).

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


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      [email protected] / chris-lamb.co.uk
       `-
--- a/debian/patches/reproducible-build.patch   1969-12-31 16:00:00.000000000 
-0800
--- b/debian/patches/reproducible-build.patch   2026-10-21 15:20:13.286291714 
-0700
@@ -0,0 +1,26 @@
+Description: Make the build reproducible
+Author: Chris Lamb <[email protected]>
+Last-Update: 2026-10-21
+
+--- node-uplot-1.6.32+ds3.orig/rollup.config.js
++++ node-uplot-1.6.32+ds3/rollup.config.js
+@@ -18,9 +18,11 @@ import terser from '@rollup/plugin-terse
+ const pkg = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
+ const ver = "v" + pkg.version;
+ const urlVer = "https://github.com/leeoniya/uPlot (" + ver + ")";
++const epoch = Number(process.env["SOURCE_DATE_EPOCH"]);
++const timestamp = Number.isInteger(epoch) ? new Date(epoch * 1000) : new 
Date();
+ const banner = [
+       "/**",
+-      "* Copyright (c) " + new Date().getFullYear() + ", Leon Sorokin",
++      "* Copyright (c) " + timestamp.getFullYear() + ", Leon Sorokin",
+       "* All rights reserved. (MIT Licensed)",
+       "*",
+       "* uPlot.js (\u03bcPlot)",
+@@ -112,4 +112,4 @@ export default [
+                       terser(terserOpts),
+               ]
+       },
+-];
+\ No newline at end of file
++];
--- a/debian/patches/series     1969-12-31 16:00:00.000000000 -0800
--- b/debian/patches/series     2026-10-21 15:19:20.231617821 -0700
@@ -0,0 +1 @@
+reproducible-build.patch
--- a/rollup.config.js  2026-10-21 15:07:37.029063808 -0700
--- b/rollup.config.js  2026-10-21 15:19:20.000000000 -0700
@@ -18,9 +18,11 @@
 const pkg = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
 const ver = "v" + pkg.version;
 const urlVer = "https://github.com/leeoniya/uPlot (" + ver + ")";
+const epoch = Number(process.env["SOURCE_DATE_EPOCH"]);
+const timestamp = Number.isInteger(epoch) ? new Date(epoch * 1000) : new 
Date();
 const banner = [
        "/**",
-       "* Copyright (c) " + new Date().getFullYear() + ", Leon Sorokin",
+       "* Copyright (c) " + timestamp.getFullYear() + ", Leon Sorokin",
        "* All rights reserved. (MIT Licensed)",
        "*",
        "* uPlot.js (\u03bcPlot)",
@@ -110,4 +112,4 @@
                        terser(terserOpts),
                ]
        },
-];
\ No newline at end of file
+];
-- 
Pkg-javascript-devel mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-javascript-devel

Reply via email to