summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Le Vaillant <glv@posteo.net>2021-07-19 11:48:12 +0200
committerGuillaume Le Vaillant <glv@posteo.net>2021-07-19 12:43:15 +0200
commitdb5962c68099f835350c24c8a3f889b9fa1f8a8e (patch)
tree4258d4c39132008051e46c62d2b0bb128cf7354c
parent532b2d9a381e1b9dfeeb14795db630c23f6b0826 (diff)
gnu: ghostscript: Improve reproducibility of PDF document generation
* gnu/packages/patches/ghostscript-no-header-creationdate.patch: Disable writing "xmp:ModifyDate" and "xmp:CreateDate" if GS_GENERATE_UUIDS is set to "0" or "no".
-rw-r--r--gnu/packages/patches/ghostscript-no-header-creationdate.patch22
1 files changed, 22 insertions, 0 deletions
diff --git a/gnu/packages/patches/ghostscript-no-header-creationdate.patch b/gnu/packages/patches/ghostscript-no-header-creationdate.patch
index 92ddbdade0..b19f3ab5d9 100644
--- a/gnu/packages/patches/ghostscript-no-header-creationdate.patch
+++ b/gnu/packages/patches/ghostscript-no-header-creationdate.patch
@@ -20,3 +20,25 @@ index 0fb067e..b342e2c 100644
{
struct tm tms;
time_t t;
+--- orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c
++++ gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c
+@@ -692,6 +692,9 @@
+ pdf_xml_attribute_name(s, "xmlns:xmp");
+ pdf_xml_attribute_value(s, "http://ns.adobe.com/xap/1.0/");
+ pdf_xml_tag_end(s);
++ if (!getenv("GS_GENERATE_UUIDS") ||
++ (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") != 0 &&
++ strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") != 0))
+ {
+ pdf_xml_tag_open_beg(s, "xmp:ModifyDate");
+ pdf_xml_tag_end(s);
+@@ -700,6 +701,9 @@
+ pdf_xml_tag_close(s, "xmp:ModifyDate");
+ pdf_xml_newline(s);
+ }
++ if (!getenv("GS_GENERATE_UUIDS") ||
++ (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") != 0 &&
++ strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") != 0))
+ {
+ pdf_xml_tag_open_beg(s, "xmp:CreateDate");
+ pdf_xml_tag_end(s);