From 1de1c56db72a48c38ad12990e32319eb51b29795 Mon Sep 17 00:00:00 2001 From: Federico Beffa Date: Fri, 13 May 2016 15:32:49 +0200 Subject: gnu: netpbm: Use 'modify-phases' syntax. * gnu/packages/netpbm.scm (netpbm)[arguments]: Do it. --- gnu/packages/netpbm.scm | 86 ++++++++++++++++++++++++------------------------- 1 file changed, 42 insertions(+), 44 deletions(-) (limited to 'gnu/packages/netpbm.scm') diff --git a/gnu/packages/netpbm.scm b/gnu/packages/netpbm.scm index 475635e7e1..d7d857642e 100644 --- a/gnu/packages/netpbm.scm +++ b/gnu/packages/netpbm.scm @@ -99,50 +99,48 @@ (define-syntax drop ("python" ,python-wrapper))) (arguments `(#:phases - (alist-replace - 'configure - (lambda _ - (copy-file "config.mk.in" "config.mk") - (chmod "config.mk" #o664) - (let ((f (open-file "config.mk" "a"))) - (display "CC=gcc\n" f) - (display "CFLAGS_SHLIB += -fPIC\n" f) - (display "TIFFLIB = libtiff.so\n" f) - (display "JPEGLIB = libjpeg.so\n" f) - (display "ZLIB = libz.so\n" f) - (display (string-append "LDFLAGS += -Wl,-rpath=" %output "/lib") f) - (close-port f))) - (alist-cons-before - 'check 'setup-check - (lambda _ - ;; install temporarily into /tmp/netpbm - (system* "make" "package") - ;; remove test requiring X - (substitute* "test/all-in-place.test" (("pamx") "")) - ;; do not worry about non-existing file - (substitute* "test/all-in-place.test" (("^rm ") "rm -f ")) - ;; remove four tests that fail for unknown reasons - (substitute* "test/Test-Order" - (("all-in-place.test") "") - (("pnmpsnr.test") "") - (("pnmremap1.test") "") - (("gif-roundtrip.test") ""))) - (alist-replace - 'install - (lambda* (#:key outputs make-flags #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (apply system* "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")) - (with-directory-excursion out - (for-each delete-file - '("config_template" "pkginfo" "README" "VERSION"))))) - %standard-phases))))) + (modify-phases %standard-phases + (replace 'configure + (lambda* (#:key inputs outputs #:allow-other-keys) + (copy-file "config.mk.in" "config.mk") + (chmod "config.mk" #o664) + (let ((f (open-file "config.mk" "a"))) + (display "CC=gcc\n" f) + (display "CFLAGS_SHLIB += -fPIC\n" f) + (display "TIFFLIB = libtiff.so\n" f) + (display "JPEGLIB = libjpeg.so\n" f) + (display "ZLIB = libz.so\n" f) + (display (string-append "LDFLAGS += -Wl,-rpath=" %output "/lib") f) + (close-port f)))) + (add-before 'check 'setup-check + (lambda _ + ;; install temporarily into /tmp/netpbm + (system* "make" "package") + ;; remove test requiring X + (substitute* "test/all-in-place.test" (("pamx") "")) + ;; do not worry about non-existing file + (substitute* "test/all-in-place.test" (("^rm ") "rm -f ")) + ;; remove four tests that fail for unknown reasons + (substitute* "test/Test-Order" + (("all-in-place.test") "") + (("pnmpsnr.test") "") + (("pnmremap1.test") "") + (("gif-roundtrip.test") "")))) + (replace 'install + (lambda* (#:key outputs make-flags #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (apply system* "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")) + (with-directory-excursion out + (for-each delete-file + '("config_template" "pkginfo" "README" + "VERSION"))))))))) (synopsis "Toolkit for manipulation of images") (description "Netpbm is a toolkit for the manipulation of graphic images, including -- cgit v1.2.3 From 2492581f0c7a77db5e7da231a62aa09cfaed0987 Mon Sep 17 00:00:00 2001 From: Federico Beffa Date: Fri, 13 May 2016 20:39:20 +0200 Subject: gnu: netpbm: Fix location of X color name database. * gnu/packages/netpbm.scm (netpbm)[inputs]: Add 'xorg-rgb'. [arguments]: In the 'configure' phase, patch 'pm_config.in.h' with the full path to the 'rgb.txt' file. --- gnu/packages/netpbm.scm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gnu/packages/netpbm.scm') diff --git a/gnu/packages/netpbm.scm b/gnu/packages/netpbm.scm index d7d857642e..d0955fe80a 100644 --- a/gnu/packages/netpbm.scm +++ b/gnu/packages/netpbm.scm @@ -27,6 +27,7 @@ (define-module (gnu packages netpbm) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) #:use-module (gnu packages xml) + #:use-module (gnu packages xorg) #:use-module (guix build-system gnu) #:use-module ((guix licenses) #:select (gpl2)) #:use-module (guix packages) @@ -91,6 +92,7 @@ (define-syntax drop ("libpng" ,libpng) ("libtiff" ,libtiff) ("libxml2" ,libxml2) + ("xorg-rgb" ,xorg-rgb) ("zlib" ,zlib))) (native-inputs `(("flex" ,flex) @@ -111,7 +113,11 @@ (define-syntax drop (display "JPEGLIB = libjpeg.so\n" f) (display "ZLIB = libz.so\n" f) (display (string-append "LDFLAGS += -Wl,-rpath=" %output "/lib") f) - (close-port f)))) + (close-port f)) + (let ((rgb (string-append (assoc-ref inputs "xorg-rgb") + "/share/X11/rgb.txt"))) + (substitute* "pm_config.in.h" + (("/usr/share/X11/rgb.txt") rgb))))) (add-before 'check 'setup-check (lambda _ ;; install temporarily into /tmp/netpbm -- cgit v1.2.3 From 9f9861d7e5af9dd79796fce2c7bf9e44d02f2e32 Mon Sep 17 00:00:00 2001 From: Federico Beffa Date: Mon, 16 May 2016 14:26:27 +0200 Subject: gnu: netpbm: Return #t from custom phases. * gnu/packages/netpbm.scm (netpbm)[arguments]: Do it. --- gnu/packages/netpbm.scm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'gnu/packages/netpbm.scm') diff --git a/gnu/packages/netpbm.scm b/gnu/packages/netpbm.scm index d0955fe80a..e2d409abe2 100644 --- a/gnu/packages/netpbm.scm +++ b/gnu/packages/netpbm.scm @@ -117,7 +117,8 @@ (define-syntax drop (let ((rgb (string-append (assoc-ref inputs "xorg-rgb") "/share/X11/rgb.txt"))) (substitute* "pm_config.in.h" - (("/usr/share/X11/rgb.txt") rgb))))) + (("/usr/share/X11/rgb.txt") rgb))) + #t)) (add-before 'check 'setup-check (lambda _ ;; install temporarily into /tmp/netpbm @@ -131,7 +132,8 @@ (define-syntax drop (("all-in-place.test") "") (("pnmpsnr.test") "") (("pnmremap1.test") "") - (("gif-roundtrip.test") "")))) + (("gif-roundtrip.test") "")) + #t)) (replace 'install (lambda* (#:key outputs make-flags #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) @@ -146,7 +148,8 @@ (define-syntax drop (with-directory-excursion out (for-each delete-file '("config_template" "pkginfo" "README" - "VERSION"))))))))) + "VERSION"))) + #t)))))) (synopsis "Toolkit for manipulation of images") (description "Netpbm is a toolkit for the manipulation of graphic images, including -- cgit v1.2.3 From 61dc82d9b90d0545739c30bfc33003bd062071f0 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 17 Jun 2016 15:21:11 +0200 Subject: gnu: netpbm: Look for 'gsc' instead of 'gs'. This is a followup to commit eb354bdacbf4154ec66038dac07f19bf4ced1fad. * gnu/packages/netpbm.scm (netpbm)[arguments]: In 'configure' phase, patch 'pstopnm.c' to look for 'gsc'. --- gnu/packages/netpbm.scm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'gnu/packages/netpbm.scm') diff --git a/gnu/packages/netpbm.scm b/gnu/packages/netpbm.scm index e2d409abe2..20ca87b4f1 100644 --- a/gnu/packages/netpbm.scm +++ b/gnu/packages/netpbm.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2015 Andreas Enge -;;; Copyright © 2015 Ludovic Courtès +;;; Copyright © 2015, 2016 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -114,10 +114,17 @@ (define-syntax drop (display "ZLIB = libz.so\n" f) (display (string-append "LDFLAGS += -Wl,-rpath=" %output "/lib") f) (close-port f)) + (let ((rgb (string-append (assoc-ref inputs "xorg-rgb") "/share/X11/rgb.txt"))) (substitute* "pm_config.in.h" - (("/usr/share/X11/rgb.txt") rgb))) + (("/usr/share/X11/rgb.txt") rgb)) + + ;; Our Ghostscript no longer provides the 'gs' command, only + ;; 'gsc', so look for that instead. + (substitute* "converter/other/pstopnm.c" + (("\"%s/gs\"") + "\"%s/gsc\""))) #t)) (add-before 'check 'setup-check (lambda _ -- cgit v1.2.3 From 56501d3b1727cbafed25be4268c4e6c9387088d9 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 17 Jun 2016 15:41:48 +0200 Subject: gnu: netpbm: Remove timestamps from build products. * gnu/packages/netpbm.scm (netpbm)[source]: Patch "buildtools/stamp-date". --- gnu/packages/netpbm.scm | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'gnu/packages/netpbm.scm') diff --git a/gnu/packages/netpbm.scm b/gnu/packages/netpbm.scm index 20ca87b4f1..cd0c3d950d 100644 --- a/gnu/packages/netpbm.scm +++ b/gnu/packages/netpbm.scm @@ -55,9 +55,8 @@ (define-public netpbm (file-name (string-append name "-" version "-checkout")) (modules '((guix build utils))) (snippet - ;; Remove non-FSDG-compliant code. '(begin - (use-modules (guix build utils)) + ;; Remove non-FSDG-compliant code. (define-syntax drop (syntax-rules (in) @@ -85,7 +84,15 @@ (define-syntax drop (drop "pbmto4425" "pbmtoln03" "pbmtolps" "pbmtopk" "pktopbm" in "converter/pbm") (drop "spottopgm" in "converter/pgm") - (drop "ppmtopjxl" in "converter/ppm"))))) + (drop "ppmtopjxl" in "converter/ppm") + + ;; Remove timestamps from the generated code. + (substitute* "buildtools/stamp-date" + (("^DATE=.*") + "DATE=\"Thu Jan 01 00:00:00+0000 1970\"\n") + (("^USER=.*") + "USER=Guix\n")))))) + (build-system gnu-build-system) (inputs `(("ghostscript" ,ghostscript) ("libjpeg" ,libjpeg) -- cgit v1.2.3