gnu: netpbm: Use 'modify-phases' syntax.

* gnu/packages/netpbm.scm (netpbm)[arguments]: Do it.
This commit is contained in:
Federico Beffa 2016-05-13 15:32:49 +02:00
parent 5fdd142072
commit 1de1c56db7

View file

@ -99,50 +99,48 @@ (define-syntax drop
("python" ,python-wrapper))) ("python" ,python-wrapper)))
(arguments (arguments
`(#:phases `(#:phases
(alist-replace (modify-phases %standard-phases
'configure (replace 'configure
(lambda _ (lambda* (#:key inputs outputs #:allow-other-keys)
(copy-file "config.mk.in" "config.mk") (copy-file "config.mk.in" "config.mk")
(chmod "config.mk" #o664) (chmod "config.mk" #o664)
(let ((f (open-file "config.mk" "a"))) (let ((f (open-file "config.mk" "a")))
(display "CC=gcc\n" f) (display "CC=gcc\n" f)
(display "CFLAGS_SHLIB += -fPIC\n" f) (display "CFLAGS_SHLIB += -fPIC\n" f)
(display "TIFFLIB = libtiff.so\n" f) (display "TIFFLIB = libtiff.so\n" f)
(display "JPEGLIB = libjpeg.so\n" f) (display "JPEGLIB = libjpeg.so\n" f)
(display "ZLIB = libz.so\n" f) (display "ZLIB = libz.so\n" f)
(display (string-append "LDFLAGS += -Wl,-rpath=" %output "/lib") f) (display (string-append "LDFLAGS += -Wl,-rpath=" %output "/lib") f)
(close-port f))) (close-port f))))
(alist-cons-before (add-before 'check 'setup-check
'check 'setup-check (lambda _
(lambda _ ;; install temporarily into /tmp/netpbm
;; install temporarily into /tmp/netpbm (system* "make" "package")
(system* "make" "package") ;; remove test requiring X
;; remove test requiring X (substitute* "test/all-in-place.test" (("pamx") ""))
(substitute* "test/all-in-place.test" (("pamx") "")) ;; do not worry about non-existing file
;; do not worry about non-existing file (substitute* "test/all-in-place.test" (("^rm ") "rm -f "))
(substitute* "test/all-in-place.test" (("^rm ") "rm -f ")) ;; remove four tests that fail for unknown reasons
;; remove four tests that fail for unknown reasons (substitute* "test/Test-Order"
(substitute* "test/Test-Order" (("all-in-place.test") "")
(("all-in-place.test") "") (("pnmpsnr.test") "")
(("pnmpsnr.test") "") (("pnmremap1.test") "")
(("pnmremap1.test") "") (("gif-roundtrip.test") ""))))
(("gif-roundtrip.test") ""))) (replace 'install
(alist-replace (lambda* (#:key outputs make-flags #:allow-other-keys)
'install (let ((out (assoc-ref outputs "out")))
(lambda* (#:key outputs make-flags #:allow-other-keys) (apply system* "make" "package"
(let ((out (assoc-ref outputs "out"))) (string-append "pkgdir=" out) make-flags)
(apply system* "make" "package" ;; copy static library
(string-append "pkgdir=" out) make-flags) (copy-file (string-append out "/link/libnetpbm.a")
;; copy static library (string-append out "/lib/libnetpbm.a"))
(copy-file (string-append out "/link/libnetpbm.a") ;; remove superfluous folders and files
(string-append out "/lib/libnetpbm.a")) (system* "rm" "-r" (string-append out "/link"))
;; remove superfluous folders and files (system* "rm" "-r" (string-append out "/misc"))
(system* "rm" "-r" (string-append out "/link")) (with-directory-excursion out
(system* "rm" "-r" (string-append out "/misc")) (for-each delete-file
(with-directory-excursion out '("config_template" "pkginfo" "README"
(for-each delete-file "VERSION")))))))))
'("config_template" "pkginfo" "README" "VERSION")))))
%standard-phases)))))
(synopsis "Toolkit for manipulation of images") (synopsis "Toolkit for manipulation of images")
(description (description
"Netpbm is a toolkit for the manipulation of graphic images, including "Netpbm is a toolkit for the manipulation of graphic images, including