gnu: Add kafs-client
[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 @@ -620,7 +620,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 @@ -720,14 +720,17 @@
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_copy(s, " rdf:about=\"\"");
29 - pdf_xml_attribute_name(s, "xmlns:xapMM");
30 - pdf_xml_attribute_value(s, "http://ns.adobe.com/xap/1.0/mm/");
31 - pdf_xml_attribute_name(s, "xapMM:DocumentID");
32 - pdf_xml_attribute_value(s, document_uuid);
33 - pdf_xml_tag_end_empty(s);
34 - pdf_xml_newline(s);
35 + if (!getenv("GS_GENERATE_UUIDS") || (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") != 0 && strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") != 0))
36 + {
37 + pdf_xml_tag_open_beg(s, "rdf:Description");
38 + pdf_xml_copy(s, " rdf:about=\"\"");
39 + pdf_xml_attribute_name(s, "xmlns:xapMM");
40 + pdf_xml_attribute_value(s, "http://ns.adobe.com/xap/1.0/mm/");
41 + pdf_xml_attribute_name(s, "xapMM:DocumentID");
42 + pdf_xml_attribute_value(s, document_uuid);
43 + pdf_xml_tag_end_empty(s);
44 + pdf_xml_newline(s);
45 + }
46
47 pdf_xml_tag_open_beg(s, "rdf:Description");
48 pdf_xml_copy(s, " rdf:about=\"\"");