guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: gnu: python-scipy: Use 'modify-phases' syntax.


From: Marius Bakke
Subject: 01/01: gnu: python-scipy: Use 'modify-phases' syntax.
Date: Thu, 19 Jan 2017 16:03:51 +0000 (UTC)

mbakke pushed a commit to branch python-tests
in repository guix.

commit 16ca6aaac867862ea6d84c5888bfc59099f335a0
Author: Marius Bakke <address@hidden>
Date:   Thu Jan 19 16:59:28 2017 +0100

    gnu: python-scipy: Use 'modify-phases' syntax.
    
    * gnu/packages/python.scm (python-scipy)[arguments]: Use 'modify-phases'.
---
 gnu/packages/python.scm |  104 +++++++++++++++++++++++------------------------
 1 file changed, 50 insertions(+), 54 deletions(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 80d03f6..6d1a04c 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -3946,13 +3946,18 @@ functions.")
     (outputs '("out" "doc"))
     (arguments
      `(#:phases
-       (alist-cons-before
-        'build 'configure-openblas
-        (lambda* (#:key inputs #:allow-other-keys)
-          (call-with-output-file "site.cfg"
-            (lambda (port)
-              (format port
-                      "[blas]
+       (modify-phases %standard-phases
+         (add-after 'unpack 'fix-tests
+           (lambda _
+             (substitute* "scipy/integrate/tests/test_quadpack.py"
+               (("libm.so") "libm.so.6"))
+             #t)
+         (add-before 'build 'configure-openblas
+           (lambda* (#:key inputs #:allow-other-keys)
+             (call-with-output-file "site.cfg"
+               (lambda (port)
+                 (format port
+                         "[blas]
 libraries = openblas
 library_dirs = ~a/lib
 include_dirs = ~a/include
@@ -3962,53 +3967,44 @@ include_dirs = ~a/include
 library_dirs = ~a/lib
 atlas_libs = openblas
 "
-                      (assoc-ref inputs "openblas")
-                      (assoc-ref inputs "openblas")
-                      (assoc-ref inputs "openblas"))))
-          #t)
-        (alist-cons-after
-         'install 'install-doc
-         (lambda* (#:key inputs outputs #:allow-other-keys)
-           (let* ((data (string-append (assoc-ref outputs "doc") "/share"))
-                  (doc (string-append data "/doc/" ,name "-" ,version))
-                  (html (string-append doc "/html"))
-                  (pyver ,(string-append "PYVER=")))
-             ;; Make installed package available for building the
-             ;; documentation
-             (add-installed-pythonpath inputs outputs)
-             (with-directory-excursion "doc"
-               ;; Fix generation of images for mathematical expressions.
-               (substitute* (find-files "source" "conf\\.py")
-                 (("pngmath_use_preview = True")
-                  "pngmath_use_preview = False"))
-               (mkdir-p html)
-               (system* "make" "html" pyver)
-               (system* "make" "latex" "PAPER=a4" pyver)
-               (system* "make" "-C" "build/latex" "all-pdf" "PAPER=a4" pyver)
-               (copy-file "build/latex/scipy-ref.pdf"
-                          (string-append doc "/scipy-ref.pdf"))
-               (with-directory-excursion "build/html"
-                 (for-each (lambda (file)
-                             (let* ((dir (dirname file))
-                                    (tgt-dir (string-append html "/" dir)))
-                               (install-file file html)))
-                           (find-files "." ".*"))))))
-         ;; Tests can only be run after the library has been installed and not
-         ;; within the source directory.
-         (alist-cons-after
-          'install 'check
-          (lambda _
-            (with-directory-excursion "/tmp"
-              (zero? (system* "python" "-c" "import scipy; scipy.test()"))))
-          (alist-delete
-           'check
-           (alist-cons-after
-            'unpack 'fix-tests
-            (lambda _
-              (substitute* "scipy/integrate/tests/test_quadpack.py"
-                (("libm.so") "libm.so.6"))
-              #t)
-            %standard-phases)))))))
+                         (assoc-ref inputs "openblas")
+                         (assoc-ref inputs "openblas")
+                         (assoc-ref inputs "openblas"))))
+             #t)
+           (delete 'check)
+           (add-after 'install 'install-doc
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               (let* ((data (string-append (assoc-ref outputs "doc") "/share"))
+                      (doc (string-append data "/doc/" ,name "-" ,version))
+                      (html (string-append doc "/html"))
+                      (pyver ,(string-append "PYVER=")))
+                 ;; Make installed package available for building the
+                 ;; documentation
+                 (add-installed-pythonpath inputs outputs)
+                 (with-directory-excursion "doc"
+                   ;; Fix generation of images for mathematical expressions.
+                   (substitute* (find-files "source" "conf\\.py")
+                     (("pngmath_use_preview = True")
+                      "pngmath_use_preview = False"))
+                   (mkdir-p html)
+                   (system* "make" "html" pyver)
+                   (system* "make" "latex" "PAPER=a4" pyver)
+                   (system* "make" "-C" "build/latex" "all-pdf" "PAPER=a4" 
pyver)
+                   (copy-file "build/latex/scipy-ref.pdf"
+                              (string-append doc "/scipy-ref.pdf"))
+                   (with-directory-excursion "build/html"
+                     (for-each (lambda (file)
+                                 (let* ((dir (dirname file))
+                                        (tgt-dir (string-append html "/" dir)))
+                                   (install-file file html)))
+                               (find-files "." ".*"))))
+                 #t)))
+           (add-after 'install-doc 'check
+             (lambda _
+               ;; Tests can only be run after the library has been installed 
and not
+               ;; within the source directory.
+               (with-directory-excursion "/tmp"
+                 (zero? (system* "python" "-c" "import scipy; 
scipy.test()"))))))))))
     (home-page "http://www.scipy.org/";)
     (synopsis "The Scipy library provides efficient numerical routines")
     (description "The SciPy library is one of the core packages that make up



reply via email to

[Prev in Thread] Current Thread [Next in Thread]