mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 23:46:13 -05:00
gnu: python-scipy: Use 'modify-phases' syntax.
* gnu/packages/python.scm (python-scipy)[arguments]: Use 'modify-phases'.
This commit is contained in:
parent
c8d7e063d0
commit
16ca6aaac8
1 changed files with 50 additions and 54 deletions
|
@ -3946,13 +3946,18 @@ (define-public python-scipy
|
|||
(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 @@ (define-public python-scipy
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue