gnu: petsc: Use modify-phases.

* gnu/packages/maths.scm (petsc)[arguments]: Use modify-phases.
This commit is contained in:
Eric Bavier 2016-07-07 17:03:44 -05:00
parent 9474a4b3ec
commit 64dcc28963
No known key found for this signature in database
GPG key ID: 1EBBD204781F962C

View file

@ -829,8 +829,8 @@ (define-public petsc
,(string-append "--with-superlu-lib=" ,(string-append "--with-superlu-lib="
(assoc-ref %build-inputs "superlu") "/lib/libsuperlu.a")) (assoc-ref %build-inputs "superlu") "/lib/libsuperlu.a"))
#:phases #:phases
(alist-replace (modify-phases %standard-phases
'configure (replace 'configure
;; PETSc's configure script is actually a python script, so we can't ;; PETSc's configure script is actually a python script, so we can't
;; run it with bash. ;; run it with bash.
(lambda* (#:key outputs (configure-flags '()) (lambda* (#:key outputs (configure-flags '())
@ -840,16 +840,14 @@ (define-public petsc
,@configure-flags))) ,@configure-flags)))
(format #t "build directory: ~s~%" (getcwd)) (format #t "build directory: ~s~%" (getcwd))
(format #t "configure flags: ~s~%" flags) (format #t "configure flags: ~s~%" flags)
(zero? (apply system* "./configure" flags)))) (zero? (apply system* "./configure" flags)))))
(alist-cons-after (add-after 'configure 'clean-local-references
'configure 'clean-local-references
;; Try to keep build directory names from leaking into compiled code ;; Try to keep build directory names from leaking into compiled code
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))) (let ((out (assoc-ref outputs "out")))
(substitute* (find-files "." "^petsc(conf|machineinfo).h$") (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
(((getcwd)) out)))) (((getcwd)) out)))))
(alist-cons-after (add-after 'install 'clean-install
'install 'clean-install
;; Try to keep installed files from leaking build directory names. ;; Try to keep installed files from leaking build directory names.
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))) (let ((out (assoc-ref outputs "out")))
@ -869,8 +867,7 @@ (define-public petsc
'("configure.log" "make.log" "gmake.log" '("configure.log" "make.log" "gmake.log"
"test.log" "error.log" "RDict.db" "test.log" "error.log" "RDict.db"
;; Once installed, should uninstall with Guix ;; Once installed, should uninstall with Guix
"uninstall.py")))) "uninstall.py"))))))))
%standard-phases)))))
(home-page "http://www.mcs.anl.gov/petsc") (home-page "http://www.mcs.anl.gov/petsc")
(synopsis "Library to solve PDEs") (synopsis "Library to solve PDEs")
(description "PETSc, pronounced PET-see (the S is silent), is a suite of (description "PETSc, pronounced PET-see (the S is silent), is a suite of