From 0fe41576631d899c62141f510a1010be517472e707573bc5eb1516dd2ef3c058 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Wed, 20 Mar 2024 07:29:36 +0000 Subject: [PATCH 1/2] OBS-URL: https://build.opensuse.org/package/show/Java:Factory/java-21-openjdk?expand=0&rev=42 --- java-21-openjdk.spec | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/java-21-openjdk.spec b/java-21-openjdk.spec index af0a6e4..07a7f34 100644 --- a/java-21-openjdk.spec +++ b/java-21-openjdk.spec @@ -99,6 +99,9 @@ %global package_version %{featurever}.%{interimver}.%{?updatever:%{updatever}}%{!?updatever:0}.%{?patchver:%{patchver}}%{!?patchver:0}~%{buildver} %endif %global NSS_LIBDIR %(pkg-config --variable=libdir nss) +%if 0%{?gcc_version} < 7 +%global with_gcc 7 +%endif %bcond_with zero %if ! %{with zero} %global with_systemtap 1 @@ -179,6 +182,8 @@ BuildRequires: desktop-file-utils BuildRequires: fdupes BuildRequires: fontconfig-devel BuildRequires: freetype2-devel +BuildRequires: gcc%{?with_gcc} +BuildRequires: gcc%{?with_gcc}-c++ BuildRequires: giflib-devel BuildRequires: hicolor-icon-theme BuildRequires: java-ca-certificates @@ -232,13 +237,6 @@ Provides: jre1.7.x Provides: jre1.8.x Provides: jre1.9.x %endif -%if 0%{?suse_version} < 1500 -BuildRequires: gcc7 -BuildRequires: gcc7-c++ -%else -BuildRequires: gcc >= 7 -BuildRequires: gcc-c++ >= 7 -%endif %if %{with_system_lcms} BuildRequires: liblcms2-devel %endif @@ -452,11 +450,11 @@ mkdir -p %{buildoutputdir} pushd %{buildoutputdir} bash ../configure \ -%if 0%{?suse_version} < 1500 - CPP=cpp-7 \ - CXX=g++-7 \ - CC=gcc-7 \ - NM=gcc-nm-7 \ +%if 0%{?with_gcc} + CPP="cpp-%{with_gcc}" \ + CXX="g++-%{with_gcc}" \ + CC="gcc-%{with_gcc}" \ + NM="gcc-nm-%{with_gcc}" \ %endif %if %{is_release} --with-version-pre="" \ From bb54d40400258dae915a4fec3c65dfea0ec9e311c16cebd6359c9907d8943564 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Mon, 1 Apr 2024 07:12:52 +0000 Subject: [PATCH 2/2] OBS-URL: https://build.opensuse.org/package/show/Java:Factory/java-21-openjdk?expand=0&rev=43 --- java-21-openjdk.changes | 7 +++++++ java-21-openjdk.spec | 2 ++ reproducible-jlink.patch | 11 +++++++++++ 3 files changed, 20 insertions(+) create mode 100644 reproducible-jlink.patch diff --git a/java-21-openjdk.changes b/java-21-openjdk.changes index 1ea5f2f..1d730f9 100644 --- a/java-21-openjdk.changes +++ b/java-21-openjdk.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Apr 1 07:12:05 UTC 2024 - Fridrich Strba + +- Added patch: + * reproducible-jlink.patch + + make the timestamp in jmods reproducible + ------------------------------------------------------------------- Thu Mar 7 12:44:28 UTC 2024 - Fridrich Strba diff --git a/java-21-openjdk.spec b/java-21-openjdk.spec index 07a7f34..06a86cf 100644 --- a/java-21-openjdk.spec +++ b/java-21-openjdk.spec @@ -161,6 +161,7 @@ Patch11: reproducible-properties.patch Patch12: adlc-parser.patch # Fix: implicit-pointer-decl Patch13: implicit-pointer-decl.patch +Patch14: reproducible-jlink.patch Patch15: system-pcsclite.patch Patch16: fips.patch # @@ -391,6 +392,7 @@ rm -rvf src/java.desktop/share/native/liblcms/lcms2* %patch -P 11 -p1 %patch -P 12 -p1 %patch -P 13 -p1 +%patch -P 14 -p1 %if %{with_system_pcsc} %patch -P 15 -p1 diff --git a/reproducible-jlink.patch b/reproducible-jlink.patch new file mode 100644 index 0000000..01e28a3 --- /dev/null +++ b/reproducible-jlink.patch @@ -0,0 +1,11 @@ +--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java ++++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java +@@ -763,7 +763,7 @@ public class JlinkTask { + + private String getSaveOpts() { + StringBuilder sb = new StringBuilder(); +- sb.append('#').append(new Date()).append("\n"); ++ sb.append('#').append(System.getenv("SOURCE_DATE_EPOCH") != null ? new Date(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH"))) : new Date()).append("\n"); + for (String c : optionsHelper.getInputCommand()) { + sb.append(c).append(" "); + }