Accepting request 866261 from home:bmwiedemann:branches:Java:packages

Add reproducible.patch to override build date (boo#1047218)

other issues in daps determinism remain

OBS-URL: https://build.opensuse.org/request/show/866261
OBS-URL: https://build.opensuse.org/package/show/Java:packages/xmlgraphics-fop?expand=0&rev=100
This commit is contained in:
Fridrich Strba 2021-01-24 18:05:54 +00:00 committed by Git OBS Bridge
parent db5216aa70
commit ec8af0a705
3 changed files with 41 additions and 0 deletions

34
reproducible.patch Normal file
View File

@ -0,0 +1,34 @@
https://github.com/apache/xmlgraphics-fop/pull/65
partial fix for
https://issues.apache.org/jira/browse/FOP-2854
https://github.com/openSUSE/daps/issues/482
commit 0d3f0f9a473aad6f315fd60cc6ed1447afb791ef
Author: Bernhard M. Wiedemann <bwiedemann@suse.de>
Date: Wed Dec 23 13:53:56 2020 +0100
FOP-2854: Allow to override CreationDate
Allow to override build date with SOURCE_DATE_EPOCH
in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.
This patch was done while working on reproducible builds for openSUSE.
diff --git a/fop-core/src/main/java/org/apache/fop/pdf/PDFMetadata.java b/fop-core/src/main/java/org/apache/fop/pdf/PDFMetadata.java
index 3af9af606..ff708e371 100644
--- a/fop-core/src/main/java/org/apache/fop/pdf/PDFMetadata.java
+++ b/fop-core/src/main/java/org/apache/fop/pdf/PDFMetadata.java
@@ -134,7 +134,9 @@ public class PDFMetadata extends PDFStream {
//Set creation date if not available, yet
if (info.getCreationDate() == null) {
- Date d = new Date();
+ Date d = System.getenv("SOURCE_DATE_EPOCH") == null ?
+ new Date() :
+ new Date(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH")));
info.setCreationDate(d);
}

View File

@ -5,6 +5,11 @@ Sun Jan 24 18:01:22 UTC 2021 - Fridrich Strba <fstrba@suse.com>
* Support OTF/TTF SVG fonts
* Allow overpaint of PDF border
-------------------------------------------------------------------
Sat Jan 23 18:39:32 UTC 2021 - Bernhard Wiedemann <bwiedemann@suse.com>
- Add reproducible.patch to override build date (boo#1047218)
-------------------------------------------------------------------
Thu Jun 4 05:13:44 UTC 2020 - Fridrich Strba <fstrba@suse.com>

View File

@ -42,6 +42,7 @@ Patch4: java8-compatibility.patch
# PATCH-FEATURE-OPENSUSE reproducible-build-manifest.patch -- boo#1110024
Patch5: reproducible-build-manifest.patch
Patch6: fop-2.5-QDox-2.0.patch
Patch7: reproducible.patch
BuildRequires: ant >= 1.8.4
BuildRequires: apache-pdfbox >= 2.0
BuildRequires: commons-io >= 2.4
@ -93,6 +94,7 @@ find -name "*.jar" | xargs -t rm
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
# Replace keyword "VERSION" in XML files with the real one:
for x in %{SOURCE10} %{SOURCE11} %{SOURCE12}; do