gnu: ghostscript: Update to 9.56.1.
* gnu/packages/ghostscript.scm (ghostscript): Update to 9.56.1. [arguments]: Remove #:parallel-tests?. Remove trailing #t's. * gnu/packages/patches/ghostscript-no-header-creationdate.patch, gnu/packages/patches/ghostscript-no-header-id.patch, gnu/packages/patches/ghostscript-no-header-uuid.patch: Rebase on 9.56.1.master
parent
55e3b5fa2a
commit
22b9a056ea
|
@ -148,7 +148,7 @@ printing, and psresize, for adjusting page sizes.")
|
||||||
(define-public ghostscript
|
(define-public ghostscript
|
||||||
(package
|
(package
|
||||||
(name "ghostscript")
|
(name "ghostscript")
|
||||||
(version "9.54.0")
|
(version "9.56.1")
|
||||||
(source
|
(source
|
||||||
(origin
|
(origin
|
||||||
(method url-fetch)
|
(method url-fetch)
|
||||||
|
@ -158,7 +158,7 @@ printing, and psresize, for adjusting page sizes.")
|
||||||
"/ghostscript-" version ".tar.xz"))
|
"/ghostscript-" version ".tar.xz"))
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"0fvfvv6di5s6j4sy4gaw65klm23dby39bkdjxxq4w3v0vqyb9dy2"))
|
"1r5qash65m6ignki6z72q4rlai9ka99xrxnmqd19n02has00cd6l"))
|
||||||
(patches (search-patches "ghostscript-no-header-creationdate.patch"
|
(patches (search-patches "ghostscript-no-header-creationdate.patch"
|
||||||
"ghostscript-no-header-id.patch"
|
"ghostscript-no-header-id.patch"
|
||||||
"ghostscript-no-header-uuid.patch"))
|
"ghostscript-no-header-uuid.patch"))
|
||||||
|
@ -170,19 +170,11 @@ printing, and psresize, for adjusting page sizes.")
|
||||||
;; Likewise for the thread-safe lcms2 fork called "lcms2art".
|
;; Likewise for the thread-safe lcms2 fork called "lcms2art".
|
||||||
'(begin
|
'(begin
|
||||||
(for-each delete-file-recursively '("freetype" "jbig2dec" "jpeg"
|
(for-each delete-file-recursively '("freetype" "jbig2dec" "jpeg"
|
||||||
"libpng" "tiff" "zlib"))
|
"libpng" "tiff" "zlib"))))))
|
||||||
#t))))
|
|
||||||
(build-system gnu-build-system)
|
(build-system gnu-build-system)
|
||||||
(outputs '("out" "doc")) ;19 MiB of HTML/PS doc + examples
|
(outputs '("out" "doc")) ;19 MiB of HTML/PS doc + examples
|
||||||
(arguments
|
(arguments
|
||||||
`(#:disallowed-references ("doc")
|
`(#:disallowed-references ("doc")
|
||||||
;; XXX: Starting with version 9.27, building the tests in parallel
|
|
||||||
;; occasionally fails like this:
|
|
||||||
;; In file included from ./base/memory_.h:23:0,
|
|
||||||
;; from ./obj/gsmd5.h:1,
|
|
||||||
;; from ./obj/gsmd5.c:56:
|
|
||||||
;; ./base/std.h:25:10: fatal error: arch.h: No such file or directory
|
|
||||||
#:parallel-tests? #f
|
|
||||||
#:configure-flags
|
#:configure-flags
|
||||||
(list (string-append "LDFLAGS=-Wl,-rpath="
|
(list (string-append "LDFLAGS=-Wl,-rpath="
|
||||||
(assoc-ref %outputs "out") "/lib")
|
(assoc-ref %outputs "out") "/lib")
|
||||||
|
@ -195,7 +187,6 @@ printing, and psresize, for adjusting page sizes.")
|
||||||
(string-append "--with-fontpath="
|
(string-append "--with-fontpath="
|
||||||
(assoc-ref %build-inputs "font-ghostscript")
|
(assoc-ref %build-inputs "font-ghostscript")
|
||||||
"/share/fonts/type1/ghostscript")
|
"/share/fonts/type1/ghostscript")
|
||||||
|
|
||||||
,@(if (%current-target-system)
|
,@(if (%current-target-system)
|
||||||
'(;; Specify the native compiler, which is used to build 'echogs'
|
'(;; Specify the native compiler, which is used to build 'echogs'
|
||||||
;; and other intermediary tools when cross-compiling; see
|
;; and other intermediary tools when cross-compiling; see
|
||||||
|
@ -212,8 +203,7 @@ printing, and psresize, for adjusting page sizes.")
|
||||||
(lambda* (#:key outputs #:allow-other-keys)
|
(lambda* (#:key outputs #:allow-other-keys)
|
||||||
;; The configure script refuses to function if the directory
|
;; The configure script refuses to function if the directory
|
||||||
;; specified as -rpath does not already exist.
|
;; specified as -rpath does not already exist.
|
||||||
(mkdir-p (string-append (assoc-ref outputs "out") "/lib"))
|
(mkdir-p (string-append (assoc-ref outputs "out") "/lib"))))
|
||||||
#t))
|
|
||||||
(add-after 'configure 'remove-doc-reference
|
(add-after 'configure 'remove-doc-reference
|
||||||
(lambda _
|
(lambda _
|
||||||
;; Don't retain a reference to the 'doc' output in 'gs'.
|
;; Don't retain a reference to the 'doc' output in 'gs'.
|
||||||
|
@ -221,21 +211,18 @@ printing, and psresize, for adjusting page sizes.")
|
||||||
;; 'gs --help', so this change is fine.
|
;; 'gs --help', so this change is fine.
|
||||||
(substitute* "base/gscdef.c"
|
(substitute* "base/gscdef.c"
|
||||||
(("GS_DOCDIR")
|
(("GS_DOCDIR")
|
||||||
"\"~/.guix-profile/share/doc/ghostscript\""))
|
"\"~/.guix-profile/share/doc/ghostscript\""))))
|
||||||
#t))
|
|
||||||
(add-after 'configure 'patch-config-files
|
(add-after 'configure 'patch-config-files
|
||||||
(lambda _
|
(lambda _
|
||||||
(substitute* "base/unixhead.mak"
|
(substitute* "base/unixhead.mak"
|
||||||
(("/bin/sh") (which "sh")))
|
(("/bin/sh") (which "sh")))))
|
||||||
#t))
|
|
||||||
,@(if (%current-target-system)
|
,@(if (%current-target-system)
|
||||||
`((add-after 'configure 'add-native-lz
|
`((add-after 'configure 'add-native-lz
|
||||||
(lambda _
|
(lambda _
|
||||||
;; Add missing '-lz' for native tools such as 'mkromfs'.
|
;; Add missing '-lz' for native tools such as 'mkromfs'.
|
||||||
(substitute* "Makefile"
|
(substitute* "Makefile"
|
||||||
(("^AUXEXTRALIBS=(.*)$" _ value)
|
(("^AUXEXTRALIBS=(.*)$" _ value)
|
||||||
(string-append "AUXEXTRALIBS = -lz " value "\n")))
|
(string-append "AUXEXTRALIBS = -lz " value "\n"))))))
|
||||||
#t)))
|
|
||||||
'())
|
'())
|
||||||
(replace 'build
|
(replace 'build
|
||||||
(lambda _
|
(lambda _
|
||||||
|
@ -250,8 +237,7 @@ printing, and psresize, for adjusting page sizes.")
|
||||||
(lambda* (#:key outputs #:allow-other-keys)
|
(lambda* (#:key outputs #:allow-other-keys)
|
||||||
(let ((out (assoc-ref outputs "out")))
|
(let ((out (assoc-ref outputs "out")))
|
||||||
;; Some programs depend on having a 'gs' binary available.
|
;; Some programs depend on having a 'gs' binary available.
|
||||||
(symlink "gsc" (string-append out "/bin/gs"))
|
(symlink "gsc" (string-append out "/bin/gs"))))))))
|
||||||
#t))))))
|
|
||||||
(native-inputs
|
(native-inputs
|
||||||
`(("perl" ,perl)
|
`(("perl" ,perl)
|
||||||
("pkg-config" ,pkg-config) ;needed for freetype
|
("pkg-config" ,pkg-config) ;needed for freetype
|
||||||
|
|
|
@ -6,11 +6,11 @@ not write out the "/ID" field (if that's permissible).
|
||||||
Upstream does not want to do this.
|
Upstream does not want to do this.
|
||||||
|
|
||||||
See: https://bugs.ghostscript.com/show_bug.cgi?id=698208
|
See: https://bugs.ghostscript.com/show_bug.cgi?id=698208
|
||||||
diff --git a/orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdf.c b/bb/gnu-ghostscript-9.14.0/devices/vector/gdevpdf.c
|
diff --git a/devices/vector/gdevpdf.c b/devices/vector/gdevpdf.c
|
||||||
index 0fb067e..b342e2c 100644
|
index cb268f62e..c5abefde2 100644
|
||||||
--- orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdf.c
|
--- a/devices/vector/gdevpdf.c
|
||||||
+++ gnu-ghostscript-9.14.0/devices/vector/gdevpdf.c
|
+++ b/devices/vector/gdevpdf.c
|
||||||
@@ -305,6 +305,9 @@ pdf_initialize_ids(gx_device_pdf * pdev)
|
@@ -425,6 +425,9 @@ pdf_initialize_ids(gx_device_pdf * pdev)
|
||||||
* date and time, rather than (for example) %%CreationDate from the
|
* date and time, rather than (for example) %%CreationDate from the
|
||||||
* PostScript file. We think this is wrong, but we do the same.
|
* PostScript file. We think this is wrong, but we do the same.
|
||||||
*/
|
*/
|
||||||
|
@ -20,9 +20,11 @@ index 0fb067e..b342e2c 100644
|
||||||
{
|
{
|
||||||
struct tm tms;
|
struct tm tms;
|
||||||
time_t t;
|
time_t t;
|
||||||
--- orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c
|
diff --git a/devices/vector/gdevpdfe.c b/devices/vector/gdevpdfe.c
|
||||||
+++ gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c
|
index ec011d8ba..f083f1e93 100644
|
||||||
@@ -692,6 +692,9 @@
|
--- a/devices/vector/gdevpdfe.c
|
||||||
|
+++ b/devices/vector/gdevpdfe.c
|
||||||
|
@@ -696,6 +696,9 @@ pdf_write_document_metadata(gx_device_pdf *pdev, const byte digest[6])
|
||||||
pdf_xml_attribute_name(s, "xmlns:xmp");
|
pdf_xml_attribute_name(s, "xmlns:xmp");
|
||||||
pdf_xml_attribute_value(s, "http://ns.adobe.com/xap/1.0/");
|
pdf_xml_attribute_value(s, "http://ns.adobe.com/xap/1.0/");
|
||||||
pdf_xml_tag_end(s);
|
pdf_xml_tag_end(s);
|
||||||
|
@ -32,7 +34,7 @@ index 0fb067e..b342e2c 100644
|
||||||
{
|
{
|
||||||
pdf_xml_tag_open_beg(s, "xmp:ModifyDate");
|
pdf_xml_tag_open_beg(s, "xmp:ModifyDate");
|
||||||
pdf_xml_tag_end(s);
|
pdf_xml_tag_end(s);
|
||||||
@@ -700,6 +701,9 @@
|
@@ -704,6 +707,9 @@ pdf_write_document_metadata(gx_device_pdf *pdev, const byte digest[6])
|
||||||
pdf_xml_tag_close(s, "xmp:ModifyDate");
|
pdf_xml_tag_close(s, "xmp:ModifyDate");
|
||||||
pdf_xml_newline(s);
|
pdf_xml_newline(s);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,38 +6,39 @@ not write out the "/ID" field (if that's permissible).
|
||||||
Upstream does not want to do this.
|
Upstream does not want to do this.
|
||||||
|
|
||||||
See: https://bugs.ghostscript.com/show_bug.cgi?id=698208
|
See: https://bugs.ghostscript.com/show_bug.cgi?id=698208
|
||||||
diff -ur orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdf.c gnu-ghostscript-9.14.0/devices/vector/gdevpdf.c
|
diff --git a/devices/vector/gdevpdf.c b/devices/vector/gdevpdf.c
|
||||||
--- orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdf.c 2017-07-09 23:30:28.960479189 +0200
|
index c5abefde2..3859fc088 100644
|
||||||
+++ gnu-ghostscript-9.14.0/devices/vector/gdevpdf.c 2017-07-09 23:34:34.306524488 +0200
|
--- a/devices/vector/gdevpdf.c
|
||||||
@@ -1810,8 +1810,11 @@
|
+++ b/devices/vector/gdevpdf.c
|
||||||
|
@@ -1909,8 +1909,11 @@ static int pdf_linearise(gx_device_pdf *pdev, pdf_linearisation_t *linear_params
|
||||||
* +1 for the linearisation dict and +1 for the primary hint stream.
|
* +1 for the linearisation dict and +1 for the primary hint stream.
|
||||||
*/
|
*/
|
||||||
linear_params->FirsttrailerOffset = gp_ftell(linear_params->Lin_File.file);
|
linear_params->FirsttrailerOffset = gp_ftell(linear_params->Lin_File.file);
|
||||||
- gs_sprintf(LDict, "\ntrailer\n<</Size %ld/Info %d 0 R/Root %d 0 R/ID[%s%s]/Prev %d>>\nstartxref\r\n0\n%%%%EOF\n \n",
|
- gs_snprintf(LDict, sizeof(LDict), "\ntrailer\n<</Size %ld/Info %d 0 R/Root %d 0 R/ID[%s%s]/Prev %d>>\nstartxref\r\n0\n%%%%EOF\n \n",
|
||||||
- linear_params->LastResource + 3, pdev->ResourceUsage[linear_params->Info_id].NewObjectNumber, pdev->ResourceUsage[linear_params->Catalog_id].NewObjectNumber, fileID, fileID, 0);
|
- linear_params->LastResource + 3, pdev->ResourceUsage[linear_params->Info_id].NewObjectNumber, pdev->ResourceUsage[linear_params->Catalog_id].NewObjectNumber, fileID, fileID, 0);
|
||||||
+ gs_sprintf(LDict, "\ntrailer\n<</Size %ld/Info %d 0 R/Root %d 0 R",
|
+ gs_snprintf(LDict, sizeof(LDict), "\ntrailer\n<</Size %ld/Info %d 0 R/Root %d 0 R",
|
||||||
+ linear_params->LastResource + 3, pdev->ResourceUsage[linear_params->Info_id].NewObjectNumber, pdev->ResourceUsage[linear_params->Catalog_id].NewObjectNumber);
|
+ linear_params->LastResource + 3, pdev->ResourceUsage[linear_params->Info_id].NewObjectNumber, pdev->ResourceUsage[linear_params->Catalog_id].NewObjectNumber);
|
||||||
+ if (pdev->OwnerPassword.size > 0 || !(!getenv("GS_GENERATE_UUIDS") || (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") != 0 && strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") != 0))) /* ID is mandatory when encrypting */
|
+ if (pdev->OwnerPassword.size > 0 || !(!getenv("GS_GENERATE_UUIDS") || (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") != 0 && strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") != 0))) /* ID is mandatory when encrypting */
|
||||||
+ gs_sprintf(LDict, "/ID[%s%s]", fileID, fileID);
|
+ gs_snprintf(LDict, sizeof(LDict), "/ID[%s%s]", fileID, fileID);
|
||||||
+ gs_sprintf(LDict, "/Prev %d>>\nstartxref\r\n0\n%%%%EOF\n \n", 0);
|
+ gs_snprintf(LDict, sizeof(LDict), "/Prev %d>>\nstartxref\r\n0\n%%%%EOF\n \n", 0);
|
||||||
gp_fwrite(LDict, strlen(LDict), 1, linear_params->Lin_File.file);
|
gp_fwrite(LDict, strlen(LDict), 1, linear_params->Lin_File.file);
|
||||||
|
|
||||||
/* Write document catalog (Part 4) */
|
/* Write document catalog (Part 4) */
|
||||||
@@ -2346,8 +2349,11 @@
|
@@ -2445,8 +2448,11 @@ static int pdf_linearise(gx_device_pdf *pdev, pdf_linearisation_t *linear_params
|
||||||
if (code != 0)
|
if (code != 0)
|
||||||
return_error(gs_error_ioerror);
|
return_error(gs_error_ioerror);
|
||||||
|
|
||||||
- gs_sprintf(LDict, "\ntrailer\n<</Size %ld/Info %d 0 R/Root %d 0 R/ID[%s%s]/Prev %"PRId64">>\nstartxref\r\n0\n%%%%EOF\n",
|
- gs_snprintf(LDict, sizeof(LDict), "\ntrailer\n<</Size %ld/Info %d 0 R/Root %d 0 R/ID[%s%s]/Prev %"PRId64">>\nstartxref\r\n0\n%%%%EOF\n",
|
||||||
- linear_params->LastResource + 3, pdev->ResourceUsage[linear_params->Info_id].NewObjectNumber, pdev->ResourceUsage[linear_params->Catalog_id].NewObjectNumber, fileID, fileID, mainxref);
|
- linear_params->LastResource + 3, pdev->ResourceUsage[linear_params->Info_id].NewObjectNumber, pdev->ResourceUsage[linear_params->Catalog_id].NewObjectNumber, fileID, fileID, mainxref);
|
||||||
+ gs_sprintf(LDict, "\ntrailer\n<</Size %ld/Info %d 0 R/Root %d 0 R",
|
+ gs_snprintf(LDict, sizeof(LDict), "\ntrailer\n<</Size %ld/Info %d 0 R/Root %d 0 R",
|
||||||
+ linear_params->LastResource + 3, pdev->ResourceUsage[linear_params->Info_id].NewObjectNumber, pdev->ResourceUsage[linear_params->Catalog_id].NewObjectNumber);
|
+ linear_params->LastResource + 3, pdev->ResourceUsage[linear_params->Info_id].NewObjectNumber, pdev->ResourceUsage[linear_params->Catalog_id].NewObjectNumber);
|
||||||
+ if (pdev->OwnerPassword.size > 0 || !(!getenv("GS_GENERATE_UUIDS") || (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") != 0 || strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") != 0))) /* ID is mandatory when encrypting */
|
+ if (pdev->OwnerPassword.size > 0 || !(!getenv("GS_GENERATE_UUIDS") || (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") != 0 || strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") != 0))) /* ID is mandatory when encrypting */
|
||||||
+ gs_sprintf(LDict, "/ID[%s%s]", fileID, fileID);
|
+ gs_snprintf(LDict, sizeof(LDict), "/ID[%s%s]", fileID, fileID);
|
||||||
+ gs_sprintf(LDict, "/Prev %"PRId64">>\nstartxref\r\n0\n%%%%EOF\n", mainxref);
|
+ gs_snprintf(LDict, sizeof(LDict), "/Prev %"PRId64">>\nstartxref\r\n0\n%%%%EOF\n", mainxref);
|
||||||
gp_fwrite(LDict, strlen(LDict), 1, linear_params->sfile);
|
gp_fwrite(LDict, strlen(LDict), 1, linear_params->sfile);
|
||||||
|
|
||||||
code = gp_fseek(linear_params->sfile, pdev->ResourceUsage[HintStreamObj].LinearisedOffset, SEEK_SET);
|
code = gp_fseek(linear_params->sfile, pdev->ResourceUsage[HintStreamObj].LinearisedOffset, SEEK_SET);
|
||||||
@@ -3012,10 +3018,12 @@
|
@@ -3139,10 +3145,12 @@ pdf_close(gx_device * dev)
|
||||||
stream_puts(s, "trailer\n");
|
stream_puts(s, "trailer\n");
|
||||||
pprintld3(s, "<< /Size %ld /Root %ld 0 R /Info %ld 0 R\n",
|
pprintld3(s, "<< /Size %ld /Root %ld 0 R /Info %ld 0 R\n",
|
||||||
pdev->next_id, Catalog_id, Info_id);
|
pdev->next_id, Catalog_id, Info_id);
|
||||||
|
|
|
@ -8,10 +8,11 @@ field value as "".
|
||||||
Upstream does not want to do this.
|
Upstream does not want to do this.
|
||||||
|
|
||||||
See: https://bugs.ghostscript.com/show_bug.cgi?id=698208
|
See: https://bugs.ghostscript.com/show_bug.cgi?id=698208
|
||||||
diff -ur orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c aa/gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c
|
diff --git a/devices/vector/gdevpdfe.c b/devices/vector/gdevpdfe.c
|
||||||
--- orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c 2017-07-09 23:30:28.960479189 +0200
|
index f083f1e93..a19c64ac0 100644
|
||||||
+++ gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c 2017-07-10 01:04:12.252478276 +0200
|
--- a/devices/vector/gdevpdfe.c
|
||||||
@@ -620,7 +620,7 @@
|
+++ b/devices/vector/gdevpdfe.c
|
||||||
|
@@ -624,7 +624,7 @@ pdf_write_document_metadata(gx_device_pdf *pdev, const byte digest[6])
|
||||||
return code;
|
return code;
|
||||||
|
|
||||||
/* PDF/A XMP reference recommends setting UUID to empty. If not empty must be a URI */
|
/* PDF/A XMP reference recommends setting UUID to empty. If not empty must be a URI */
|
||||||
|
@ -20,7 +21,7 @@ diff -ur orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c aa/gnu-ghostscrip
|
||||||
instance_uuid[0] = 0x00;
|
instance_uuid[0] = 0x00;
|
||||||
|
|
||||||
cre_date_time_len = pdf_get_docinfo_item(pdev, "/CreationDate", cre_date_time, sizeof(cre_date_time));
|
cre_date_time_len = pdf_get_docinfo_item(pdev, "/CreationDate", cre_date_time, sizeof(cre_date_time));
|
||||||
@@ -720,14 +720,17 @@
|
@@ -730,14 +730,17 @@ pdf_write_document_metadata(gx_device_pdf *pdev, const byte digest[6])
|
||||||
pdf_xml_tag_close(s, "rdf:Description");
|
pdf_xml_tag_close(s, "rdf:Description");
|
||||||
pdf_xml_newline(s);
|
pdf_xml_newline(s);
|
||||||
|
|
||||||
|
|
Reference in New Issue