diff --git a/java-21-openjdk.spec b/java-21-openjdk.spec index 2febf5b..6e0030d 100644 --- a/java-21-openjdk.spec +++ b/java-21-openjdk.spec @@ -154,6 +154,7 @@ Patch4: PStack-808293.patch Patch5: multiple-pkcs11-library-init.patch # Fix instantiation of VM on ZERO Patch8: zero-ranges.patch +Patch9: reproducible-javadoc-timestamp.patch # From icedtea: Increase default memory limits Patch10: memory-limits.patch Patch11: reproducible-properties.patch @@ -389,6 +390,7 @@ rm -rvf src/java.desktop/share/native/liblcms/lcms2* %patch -P 4 -p1 %patch -P 5 -p1 %patch -P 8 -p1 +%patch -P 9 -p1 %patch -P 10 -p1 %patch -P 11 -p1 %patch -P 12 -p1 diff --git a/reproducible-javadoc-timestamp.patch b/reproducible-javadoc-timestamp.patch new file mode 100644 index 0000000..aa1f92c --- /dev/null +++ b/reproducible-javadoc-timestamp.patch @@ -0,0 +1,28 @@ +diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java +index 6bff863e178..60c01d18320 100644 +--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java ++++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java +@@ -25,7 +25,9 @@ + + package jdk.javadoc.internal.doclets.formats.html; + ++import java.time.Instant; + import java.time.ZonedDateTime; ++import java.time.ZoneId; + import java.util.ArrayList; + import java.util.EnumSet; + import java.util.HashMap; +@@ -264,8 +266,12 @@ public class HtmlConfiguration extends BaseConfiguration { + return false; + } + ++ ZonedDateTime now = ZonedDateTime.now(); ++ if ( System.getenv("SOURCE_DATE_EPOCH") != null ) { ++ now = ZonedDateTime.ofInstant(Instant.ofEpochMilli(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH"))), ZoneId.of("UTC")); ++ } + ZonedDateTime zdt = options.date(); +- buildDate = zdt != null ? zdt : ZonedDateTime.now(); ++ buildDate = zdt != null ? zdt : now; + + if (!getSpecifiedTypeElements().isEmpty()) { + Map map = new HashMap<>();