gnu: attr: Use 'modify-phases'.

* gnu/packages/attr.scm (attr)[arguments]: Use 'modify-phases'.
This commit is contained in:
Ludovic Courtès 2016-01-08 10:58:05 +01:00
parent 209e09fa10
commit 20c620d0a4
1 changed files with 30 additions and 35 deletions

View File

@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org> ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2012, 2013, 2016 Ludovic Courtès <ludo@gnu.org>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -29,8 +29,7 @@
(package (package
(name "attr") (name "attr")
(version "2.4.46") (version "2.4.46")
(source (source (origin
(origin
(method url-fetch) (method url-fetch)
(uri (string-append "mirror://savannah/attr/attr-" (uri (string-append "mirror://savannah/attr/attr-"
version ".src.tar.gz")) version ".src.tar.gz"))
@ -40,34 +39,30 @@
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
`(#:phases `(#:phases
(alist-cons-after (modify-phases %standard-phases
'configure 'patch-makefile-SHELL (add-after 'configure 'patch-makefile-SHELL
(lambda _ (lambda _
(patch-makefile-SHELL "include/buildmacros")) (patch-makefile-SHELL "include/buildmacros")))
(alist-replace (replace 'install
'install
(lambda _ (lambda _
(zero? (system* "make" (zero? (system* "make"
"install" "install"
"install-lib" "install-lib"
"install-dev"))) "install-dev"))))
(replace 'check
;; When building natively, adjust the test cases. (lambda* (#:key target #:allow-other-keys)
,(if (%current-target-system)
'%standard-phases
'(alist-replace 'check
(lambda _
;; Use the right shell. ;; Use the right shell.
(substitute* "test/run" (substitute* "test/run"
(("/bin/sh") (("/bin/sh")
(which "bash"))) (which "bash")))
(system* "make" "tests" "-C" "test") ;; When building natively, run the tests.
(unless target
(system* "make" "tests" "-C" "test"))
;; XXX: Ignore the test result since this is ;; XXX: Ignore the test result since this is
;; dependent on the underlying file system. ;; dependent on the underlying file system.
#t) #t)))))
%standard-phases))))))
(inputs (inputs
;; Perl is needed to run tests; remove it from cross builds. ;; Perl is needed to run tests; remove it from cross builds.
(if (%current-target-system) (if (%current-target-system)