gnu: gnome-control-center: Update to 3.32.2.
[jackhill/guix/guix.git] / gnu / packages / patches / ghostscript-no-header-uuid.patch
1 This patch makes the UUIDs in the XMP header optional, depending on the
2 setting of the environment variable GS_GENERATE_UUIDS.
3
4 If the environment variable GS_GENERATE_UUIDS is set to "0" or "no", it will
5 not write out the Document UUID field and also will write the Instance ID
6 field value as "".
7
8 Upstream does not want to do this.
9
10 See: https://bugs.ghostscript.com/show_bug.cgi?id=698208
11 diff -ur orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c aa/gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c
12 --- orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c 2017-07-09 23:30:28.960479189 +0200
13 +++ gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c 2017-07-10 01:04:12.252478276 +0200
14 @@ -617,7 +617,7 @@
15 return code;
16
17 /* PDF/A XMP reference recommends setting UUID to empty. If not empty must be a URI */
18 - if (pdev->PDFA != 0)
19 + if (pdev->PDFA != 0 || (getenv("GS_GENERATE_UUIDS") && (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") == 0 || strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") == 0)))
20 instance_uuid[0] = 0x00;
21
22 cre_date_time_len = pdf_get_docinfo_item(pdev, "/CreationDate", cre_date_time, sizeof(cre_date_time));
23 @@ -719,15 +719,18 @@
24 pdf_xml_tag_close(s, "rdf:Description");
25 pdf_xml_newline(s);
26
27 - pdf_xml_tag_open_beg(s, "rdf:Description");
28 - pdf_xml_attribute_name(s, "rdf:about");
29 - pdf_xml_attribute_value(s, instance_uuid);
30 - pdf_xml_attribute_name(s, "xmlns:xapMM");
31 - pdf_xml_attribute_value(s, "http://ns.adobe.com/xap/1.0/mm/");
32 - pdf_xml_attribute_name(s, "xapMM:DocumentID");
33 - pdf_xml_attribute_value(s, document_uuid);
34 - pdf_xml_tag_end_empty(s);
35 - pdf_xml_newline(s);
36 + if (!getenv("GS_GENERATE_UUIDS") || (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") != 0 && strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") != 0))
37 + {
38 + pdf_xml_tag_open_beg(s, "rdf:Description");
39 + pdf_xml_attribute_name(s, "rdf:about");
40 + pdf_xml_attribute_value(s, instance_uuid);
41 + pdf_xml_attribute_name(s, "xmlns:xapMM");
42 + pdf_xml_attribute_value(s, "http://ns.adobe.com/xap/1.0/mm/");
43 + pdf_xml_attribute_name(s, "xapMM:DocumentID");
44 + pdf_xml_attribute_value(s, document_uuid);
45 + pdf_xml_tag_end_empty(s);
46 + pdf_xml_newline(s);
47 + }
48
49 pdf_xml_tag_open_beg(s, "rdf:Description");
50 pdf_xml_attribute_name(s, "rdf:about");