From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: [PATCH 2/2] gnu: netpbm: Fix location of X color name database. Date: Sat, 14 May 2016 19:25:12 +0300 Message-ID: <87lh3c38uv.fsf@gmail.com> References: <20160513171031.GA32351@solar> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41692) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b1cNS-0007DU-3F for guix-devel@gnu.org; Sat, 14 May 2016 12:25:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b1cNN-0005ZH-PM for guix-devel@gnu.org; Sat, 14 May 2016 12:25:16 -0400 Received: from mail-lb0-x236.google.com ([2a00:1450:4010:c04::236]:34672) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b1cNN-0005ZC-BQ for guix-devel@gnu.org; Sat, 14 May 2016 12:25:13 -0400 Received: by mail-lb0-x236.google.com with SMTP id n11so36642949lbh.1 for ; Sat, 14 May 2016 09:25:13 -0700 (PDT) In-Reply-To: (Federico Beffa's message of "Fri, 13 May 2016 20:44:07 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Federico Beffa Cc: Guix-devel Federico Beffa (2016-05-13 21:44 +0300) wrote: > On Fri, May 13, 2016 at 7:10 PM, Andreas Enge wrote: >> Hello, >> >> On Fri, May 13, 2016 at 06:51:27PM +0200, Federico Beffa wrote: >>> This fixes some of the provided programs like, e.g. 'pamtogif'. >> >> I think the common practice is to separate the switch to the %modify-phases >> syntax and the real change into two commits; right now, the diff looks big, >> but I imagine it must be rather trivial. > > Indeed the change is trivial. > > Regards, > Fede > > From be37669b50c000ad45eb85075f32d4f23c26489d Mon Sep 17 00:00:00 2001 > From: Federico Beffa > Date: Fri, 13 May 2016 15:32:49 +0200 > Subject: [PATCH 2/3] 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(-) > > diff --git a/gnu/packages/netpbm.scm b/gnu/packages/netpbm.scm > index 475635e..d7d8576 100644 > --- a/gnu/packages/netpbm.scm > +++ b/gnu/packages/netpbm.scm > @@ -99,50 +99,48 @@ > ("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"))))))))) I think it would also be good to add #t to the end of all these phases to make sure that when the phases succeed, they return non-false value. -- Alex