From f729a4d8b274aebd578f45b2ca55cded31001b85 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 19 Mar 2017 14:24:27 +0100 Subject: gnu: niftilib: Simplify build phases. * gnu/packages/image.scm (niftilib)[arguments]: Use make-flags instead of replacing "configure" phase; simplify "install" phase. --- gnu/packages/image.scm | 91 ++++++++++++++++++++++---------------------------- 1 file changed, 39 insertions(+), 52 deletions(-) (limited to 'gnu') diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index 73c5298e17..2c438a8dd0 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -3,7 +3,7 @@ ;;; Copyright © 2013, 2015, 2016 Andreas Enge ;;; Copyright © 2014, 2015, 2016 Mark H Weaver ;;; Copyright © 2014, 2015 Alex Kost -;;; Copyright © 2014, 2016 Ricardo Wurmus +;;; Copyright © 2014, 2016, 2017 Ricardo Wurmus ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer ;;; Copyright © 2015 Amirouche Boubekki ;;; Copyright © 2014, 2017 John Darrington @@ -1167,57 +1167,44 @@ (define-public libjpeg-turbo (define-public niftilib (package - (name "niftilib") - (version "2.0.0") - (source (origin - (method url-fetch) - (uri (list (string-append "mirror://sourceforge/niftilib/" - "nifticlib/nifticlib_" - (string-join (string-split version #\.) "_") - "/nifticlib-" version ".tar.gz"))) - (sha256 - (base32 "123z9bwzgin5y8gi5ni8j217k7n683whjsvg0lrpii9flgk8isd3")))) - (build-system gnu-build-system) - (arguments - '(#:tests? #f - #:parallel-build? #f - #:phases - (modify-phases %standard-phases - (replace 'install - (lambda _ - (for-each - (lambda (dir) - (let ((directory (assoc-ref %outputs "out"))) - (mkdir-p (string-append directory "/" dir)) - (zero? (system* "cp" "-a" dir directory)))) - '("bin" "lib" "include")))) - (replace 'configure - (lambda _ - (substitute* "Makefile" - (("^SHELL[ \t]*=[ \t]*csh") - (string-append "SHELL = " - (assoc-ref %build-inputs "bash") - "/bin/sh")) - - (("^CFLAGS[ \t]*=[ \t]\\$\\(ANSI_FLAGS\\)") - "CFLAGS = $(ANSI_FLAGS) -fPIC") - - (("^ZLIB_INC[ \t]*=[ \t]*-I/usr/include") - (string-append "ZLIB_INC = -I" - (assoc-ref %build-inputs "zlib") - "/include")) - - (("^CP[ \t]*=[ \t]*cp") - (string-append "CP = " - (assoc-ref %build-inputs "coreutils") - "/bin/cp"))) - #t))))) - (inputs - `(("zlib" ,zlib))) - (synopsis "Library for reading and writing files in the nifti-1 format") - (description "Niftilib is a set of i/o libraries for reading and writing + (name "niftilib") + (version "2.0.0") + (source (origin + (method url-fetch) + (uri (list (string-append "mirror://sourceforge/niftilib/" + "nifticlib/nifticlib_" + (string-join (string-split version #\.) "_") + "/nifticlib-" version ".tar.gz"))) + (sha256 + (base32 "123z9bwzgin5y8gi5ni8j217k7n683whjsvg0lrpii9flgk8isd3")))) + (build-system gnu-build-system) + (arguments + '(#:tests? #f ; there is no test target + #:parallel-build? #f ; not supported + #:make-flags + (list "SHELL=bash" + (string-append "ZLIB_INC=" + (assoc-ref %build-inputs "zlib") "/include") + ;; Append "-fPIC" to CFLAGS. + (string-append "CFLAGS=" + "-Wall -ansi -pedantic -fPIC")) + #:phases + (modify-phases %standard-phases + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (for-each + (lambda (dir) + (copy-recursively dir (string-append out "/" dir))) + '("bin" "lib" "include"))) + #t)) + (delete 'configure)))) + (inputs + `(("zlib" ,zlib))) + (synopsis "Library for reading and writing files in the nifti-1 format") + (description "Niftilib is a set of i/o libraries for reading and writing files in the nifti-1 data format - a binary file format for storing medical image data, e.g. magnetic resonance image (MRI) and functional MRI (fMRI) brain images.") - (home-page "http://niftilib.sourceforge.net") - (license license:public-domain))) + (home-page "http://niftilib.sourceforge.net") + (license license:public-domain))) -- cgit v1.2.3