;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2015, 2016 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;;
;;; This file is part of GNU Guix.
;;;
(sha256
(base32
"1k7as9qi1942wyjxpvbf02wg0h4braw44m3m3vvi8sm9y5z1m967"))
+ (patches (search-patches "netpbm-CVE-2017-2586.patch"
+ "netpbm-CVE-2017-2587.patch"))
(file-name (string-append name "-" version "-checkout"))
(modules '((guix build utils)))
(snippet
(drop "ppmtopjxl" in "converter/ppm")
;; Remove timestamps from the generated code.
+ (substitute* "buildtools/makepointerman"
+ (("gmctime[(][)]")
+ "\"Thu Jan 1 00:00:00 1970\""))
(substitute* "buildtools/stamp-date"
(("^DATE=.*")
"DATE=\"Thu Jan 01 00:00:00+0000 1970\"\n")
(("^USER=.*")
- "USER=Guix\n"))))))
+ "USER=Guix\n"))
+ #t))))
(build-system gnu-build-system)
(inputs `(("ghostscript" ,ghostscript)
- ("libjpeg" ,libjpeg)
+ ("libjpeg" ,libjpeg-turbo)
("libpng" ,libpng)
("libtiff" ,libtiff)
("libxml2" ,libxml2)
("pkg-config" ,pkg-config)
("python" ,python-wrapper)))
(arguments
- `(#:phases
+ `(#:modules ((guix build gnu-build-system)
+ (guix build utils)
+ (ice-9 match))
+ #:phases
(modify-phases %standard-phases
(replace 'configure
(lambda* (#:key inputs outputs #:allow-other-keys)
;; 'gsc', so look for that instead.
(substitute* "converter/other/pstopnm.c"
(("\"%s/gs\"")
- "\"%s/gsc\"")))
+ "\"%s/gsc\"")
+ (("/usr/bin/gs")
+ (string-append (assoc-ref inputs "ghostscript") "/bin/gsc"))))
#t))
(add-before 'check 'setup-check
(lambda _
;; install temporarily into /tmp/netpbm
- (system* "make" "package")
+ (invoke "make" "package")
;; remove test requiring X
(substitute* "test/all-in-place.test" (("pamx") ""))
;; do not worry about non-existing file
(replace 'install
(lambda* (#:key outputs make-flags #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
- (apply system* "make" "package"
+ (apply invoke "make" "package"
(string-append "pkgdir=" out) make-flags)
- ;; copy static library
- (copy-file (string-append out "/link/libnetpbm.a")
- (string-append out "/lib/libnetpbm.a"))
- ;; remove superfluous folders and files
- (system* "rm" "-r" (string-append out "/link"))
- (system* "rm" "-r" (string-append out "/misc"))
+ ;; Remove superfluous files.
(with-directory-excursion out
- (for-each delete-file
- '("config_template" "pkginfo" "README"
- "VERSION")))
- #t))))))
+ (for-each delete-file-recursively
+ '("config_template" "pkginfo" "README" "VERSION"
+ "link/" "misc/"))
+ ;; Install the required ‘libnetpbm.so’ link.
+ ;; See <https://issues.guix.gnu.org/issue/40376>.
+ (with-directory-excursion "lib"
+ (symlink
+ (match (find-files "." "^libnetpbm\\.so\\.[^.]*\\.[^.]*$")
+ ((head _ ...) head))
+ "libnetpbm.so"))
+ #t)))))))
(synopsis "Toolkit for manipulation of images")
(description
"Netpbm is a toolkit for the manipulation of graphic images, including