;;; Copyright © 2017 Alex Vong <alexvong1995@gmail.com>
;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
+;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix download)
+ #:use-module (guix utils)
#:use-module (guix build-system gnu)
- #:use-module (guix build-system trivial))
+ #:use-module (guix build-system trivial)
+ #:use-module (srfi srfi-1))
(define-public lcms
(package
(name "lcms")
- (version "2.8")
+ (version "2.9")
(source (origin
(method url-fetch)
(uri (string-append "mirror://sourceforge/lcms/lcms/" version
"/lcms2-" version ".tar.gz"))
- (patches (search-patches "lcms-CVE-2016-10165.patch"))
(sha256 (base32
- "08pvl289g0mbznzx5l6ibhaldsgx41kwvdn2c974ga9fkli2pl36"))))
+ "083xisy6z01zhm7p7rgk4bx9d6zlr8l20qkfv1g29ylnhgwzvij8"))))
(build-system gnu-build-system)
(inputs `(("libjpeg-8" ,libjpeg-8)
("libtiff" ,libtiff)
(define-public ghostscript
(package
(name "ghostscript")
- (version "9.22")
+ (replacement ghostscript/fixed)
+ (version "9.23")
(source
(origin
(method url-fetch)
"/ghostscript-" version ".tar.xz"))
(sha256
(base32
- "1fyi4yvdj39bjgs10klr31cda1fbx1ar7a7b7yz7v68gykk65y61"))
+ "1ng8d9fm5lza7k1f7ybc791275c07z5hcmpkrl2i226nshkxrkhz"))
(patches (search-patches "ghostscript-runpath.patch"
"ghostscript-no-header-creationdate.patch"
"ghostscript-no-header-id.patch"
;; Remove bundled libraries. The bundled OpenJPEG is a patched fork so
;; we leave it, at least for now.
;; TODO Try unbundling ijs, which is developed alongside Ghostscript.
+ ;; Likewise for the thread-safe lcms2 fork called "lcms2art".
'(begin
(for-each delete-file-recursively '("freetype" "jbig2dec" "jpeg"
- "lcms2" "libpng"
- "tiff" "zlib"))))))
+ "libpng" "tiff" "zlib"))
+ #t))))
(build-system gnu-build-system)
(outputs '("out" "doc")) ;19 MiB of HTML/PS doc + examples
(arguments
'()))
#:phases
(modify-phases %standard-phases
- (add-after 'unpack 'fix-doc-dir
- (lambda _
- ;; Honor --docdir.
- (substitute* "Makefile.in"
- (("^docdir=.*$") "docdir = @docdir@\n")
- (("^exdir=.*$") "exdir = $(docdir)/examples\n"))
- #t))
(add-after 'configure 'remove-doc-reference
(lambda _
;; Don't retain a reference to the 'doc' output in 'gs'.
(substitute* "base/gscdef.c"
(("GS_DOCDIR")
"\"~/.guix-profile/share/doc/ghostscript\""))
+ ;; The docdir default changed in 9.23 and a compatibility
+ ;; symlink was added from datadir->docdir. Remove it.
+ (substitute* "base/unixinst.mak"
+ (("ln -s \\$\\(DESTDIR\\)\\$\\(docdir\\).*") ""))
#t))
(add-after 'configure 'patch-config-files
(lambda _
(lambda _
;; Build 'libgs.so', but don't build the statically-linked 'gs'
;; binary (saves 22 MiB).
- (zero? (system* "make" "so" "-j"
- (number->string (parallel-job-count))))))
+ (invoke "make" "so" "-j"
+ (number->string (parallel-job-count)))))
(replace 'install
(lambda _
- (zero? (system* "make" "soinstall"))))
+ (invoke "make" "soinstall")))
(add-after 'install 'create-gs-symlink
(lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
;; these libraries.
,@(if (%current-target-system)
`(("zlib/native" ,zlib)
- ("libjpeg/native" ,libjpeg)
- ("lcms2/native" ,lcms))
+ ("libjpeg/native" ,libjpeg))
'())))
(inputs
`(("freetype" ,freetype)
("jbig2dec" ,jbig2dec)
- ("lcms2" ,lcms)
("libjpeg" ,libjpeg)
("libpaper" ,libpaper)
("libpng" ,libpng)
(home-page "https://www.ghostscript.com/")
(license license:agpl3+)))
+(define-public ghostscript/fixed
+ (hidden-package
+ (package
+ (inherit ghostscript)
+ (version "9.24")
+ (source
+ (origin
+ (inherit (package-source ghostscript))
+ (uri (string-append "https://github.com/ArtifexSoftware/"
+ "ghostpdl-downloads/releases/download/gs"
+ (string-delete #\. version)
+ "/ghostscript-" version ".tar.xz"))
+ (sha256
+ (base32
+ "1mk922rnml93w2g42yxiyn8xqanc50cm65irrgh0b6lp4kgifjfl"))
+ (patches (search-patches "ghostscript-CVE-2018-16509.patch"
+ "ghostscript-bug-699708.patch"
+ "ghostscript-no-header-creationdate.patch"
+ "ghostscript-no-header-id.patch"
+ "ghostscript-no-header-uuid.patch"))))
+ (arguments
+ (substitute-keyword-arguments (package-arguments ghostscript)
+ ((#:configure-flags flags)
+ ;; Notice that we removed the 'ghostscript-runpath' patch above.
+ ;; The reason is that it conflicts with an upstream change that
+ ;; takes LDFLAGS into account.
+ `(cons (string-append "LDFLAGS=-Wl,-rpath="
+ (assoc-ref %outputs "out") "/lib")
+ ,flags))
+ ((#:phases phases)
+ `(modify-phases ,phases
+ (add-before 'configure 'create-output-directory
+ (lambda* (#:key outputs #:allow-other-keys)
+ ;; Unfortunately the configure script refuses to function if
+ ;; the directory specified as -rpath does not already exist.
+ (mkdir-p (string-append (assoc-ref outputs "out") "/lib"))
+ #t)))))))))
+
(define-public ghostscript/x
(package/inherit ghostscript
(name (string-append (package-name ghostscript) "-with-x"))
(substitute* "autogen.sh"
(("^.*\\$srcdir/configure.*") "")
(("^ + && echo Now type.*$") ""))
- (zero? (system* "bash" "autogen.sh")))))))
+ (invoke "bash" "autogen.sh"))))))
(synopsis "IJS driver framework for inkjet and other raster devices")
(description
"IJS is a protocol for transmission of raster page images. This package
(for-each
(lambda (file)
(copy-file file (string-append dir "/" file)))
- (find-files "." "pfb|afm"))))))))
+ (find-files "." "pfb|afm"))
+ #t))))))
(synopsis "Free replacements for the PostScript fonts")
(description
"Ghostscript fonts provides fonts and font metrics customarily distributed with
It provides a convenient easy to use API for handling and rendering
Postscript documents.")
(license license:gpl2+)
- (home-page "http://www.freedesktop.org/wiki/Software/libspectre")))
+ (home-page "https://www.freedesktop.org/wiki/Software/libspectre")))