summaryrefslogtreecommitdiff
path: root/gnu/packages
diff options
context:
space:
mode:
authorGábor Boskovits <boskovits@gmail.com>2018-12-09 12:41:15 +0100
committerGábor Boskovits <boskovits@gmail.com>2018-12-09 12:55:36 +0100
commitaccb5c310001339bb4956632db89b1654c6431f1 (patch)
treebc69a0dd0a875eb01a769fceeaf01fe935bf89e9 /gnu/packages
parent99c39c28f9a5040c82693eea9c09be3a17a0dfcb (diff)
gnu: openjdk: Make idlj respect SOURCE_DATE_EPOCH.
* gnu/packages/patches/openjdk-10-idlj-reproducibility.patch: New file. * gnu/packages/java.scm (openjdk10)[source]: Use it. * gnu/locale.mk (dist_patch_DATA): Register it.
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/java.scm2
-rw-r--r--gnu/packages/patches/openjdk-10-idlj-reproducibility.patch36
2 files changed, 38 insertions, 0 deletions
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index a09bcfabe5..951c1f4fd3 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -1820,6 +1820,8 @@ new Date();"))
(sha256
(base32
"0zywq2203b4hx4jms9vbwvjcj1d3k2v3qpx4s33729fkpmid97r4"))
+ (patches (search-patches
+ "openjdk-10-idlj-reproducibility.patch"))
(modules '((guix build utils)))
(snippet
`(begin
diff --git a/gnu/packages/patches/openjdk-10-idlj-reproducibility.patch b/gnu/packages/patches/openjdk-10-idlj-reproducibility.patch
new file mode 100644
index 0000000000..b29a06f272
--- /dev/null
+++ b/gnu/packages/patches/openjdk-10-idlj-reproducibility.patch
@@ -0,0 +1,36 @@
+From a0a0c6a43b88d946f2b5484892cf0209bd7c0e68 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?G=C3=A1bor=20Boskovits?= <boskovits@gmail.com>
+Date: Sat, 8 Dec 2018 21:25:31 +0100
+Subject: [PATCH] Make idlj respect SOURCE_DATE_EPOCH.
+
+---
+ .../sun/tools/corba/se/idl/toJavaPortable/Util.java | 13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Util.java b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Util.java
+index 7397619f2..583d6b8e4 100644
+--- a/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Util.java
++++ b/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Util.java
+@@ -1146,7 +1146,18 @@ public class Util extends com.sun.tools.corba.se.idl.Util
+ else
+ formatter.setTimeZone (java.util.TimeZone.getDefault ());
+
+- stream.println ("* " + formatter.format (new Date ()));
++ try {
++ String epoch = System.getenv("SOURCE_DATE_EPOCH");
++ if(epoch != null) {
++ long unixTime = Long.parseLong(epoch);
++ stream.println ("* " + formatter.format (new Date (unixTime*1000L)));
++ } else {
++ stream.println ("* " + formatter.format (new Date ()));
++ }
++ } catch (Exception e) {
++ //in case of error fall back to default
++ stream.println ("* " + formatter.format (new Date ()));
++ }
+
+ // <daz>
+ ///////////////
+--
+2.19.2
+