gnu: python-scipy: Update to 0.18.1.

* gnu/packages/python.scm (python-scipy): Update to 0.18.1.
[source]: Use github instead of sourceforge.
[native-inputs]: Add python-cython.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
This commit is contained in:
Thomas Danckaert 2017-02-21 11:45:06 +01:00 committed by Danny Milosavljevic
parent b320f7bf06
commit 350932536a
No known key found for this signature in database
GPG Key ID: E71A35542C30BAA5
1 changed files with 48 additions and 56 deletions

View File

@ -4079,16 +4079,16 @@ functions.")
(define-public python-scipy (define-public python-scipy
(package (package
(name "python-scipy") (name "python-scipy")
(version "0.16.0") (version "0.18.1")
(source (source
(origin (origin
(method url-fetch) (method url-fetch)
; http://downloads.sourceforge.net/project/scipy/scipy/0.16.1/scipy-0.16.1.tar.gz (uri (string-append "https://github.com/scipy/scipy/archive/v"
(uri (string-append "mirror://sourceforge/scipy/scipy/" version version ".tar.gz"))
"/scipy-" version ".tar.xz")) (file-name (string-append name "-" version ".tar.gz"))
(sha256 (sha256
(base32 (base32
"0wa0a4skpda3gx7lb12yn19nhbairlyxrvda2lz2bcawk3x5qzz2")))) "17slsrfawjp7if6qrlx03zhgp05350ginxx8ddpw9zqx43x905sn"))))
(build-system python-build-system) (build-system python-build-system)
(propagated-inputs (propagated-inputs
`(("python-numpy" ,python-numpy) `(("python-numpy" ,python-numpy)
@ -4098,21 +4098,16 @@ functions.")
`(("lapack" ,lapack) `(("lapack" ,lapack)
("openblas" ,openblas))) ("openblas" ,openblas)))
(native-inputs (native-inputs
`(("python-nose" ,python-nose) `(("python-cython" ,python-cython)
("python-sphinx" ,python-sphinx-1.2.3) ("python-nose" ,python-nose)
("python-sphinx" ,python-sphinx)
("python-numpydoc" ,python-numpydoc) ("python-numpydoc" ,python-numpydoc)
("gfortran" ,gfortran) ("gfortran" ,gfortran)
("texlive" ,texlive)
("perl" ,perl))) ("perl" ,perl)))
(outputs '("out" "doc")) (outputs '("out" "doc"))
(arguments (arguments
`(#:phases `(#:phases
(modify-phases %standard-phases (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 (add-before 'build 'configure-openblas
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(call-with-output-file "site.cfg" (call-with-output-file "site.cfg"
@ -4132,40 +4127,44 @@ atlas_libs = openblas
(assoc-ref inputs "openblas") (assoc-ref inputs "openblas")
(assoc-ref inputs "openblas")))) (assoc-ref inputs "openblas"))))
#t)) #t))
(delete 'check) (add-after 'install 'install-doc
(add-after 'install 'install-doc (lambda* (#:key inputs outputs #:allow-other-keys)
(lambda* (#:key inputs outputs #:allow-other-keys) (let* ((data (string-append (assoc-ref outputs "doc") "/share"))
(let* ((data (string-append (assoc-ref outputs "doc") "/share")) (doc (string-append data "/doc/" ,name "-" ,version))
(doc (string-append data "/doc/" ,name "-" ,version)) (html (string-append doc "/html"))
(html (string-append doc "/html")) (pyver ,(string-append "PYVER=")))
(pyver ,(string-append "PYVER="))) ;; Make installed package available for building the
;; Make installed package available for building the ;; documentation
;; documentation (add-installed-pythonpath inputs outputs)
(add-installed-pythonpath inputs outputs) (with-directory-excursion "doc"
(with-directory-excursion "doc" ;; Fix generation of images for mathematical expressions.
;; Fix generation of images for mathematical expressions. (substitute* (find-files "source" "conf\\.py")
(substitute* (find-files "source" "conf\\.py") (("pngmath_use_preview = True")
(("pngmath_use_preview = True") "pngmath_use_preview = False"))
"pngmath_use_preview = False")) (mkdir-p html)
(mkdir-p html) (system* "make" "html" pyver)
(system* "make" "html" pyver) (with-directory-excursion "build/html"
(system* "make" "latex" "PAPER=a4" pyver) (for-each (lambda (file)
(system* "make" "-C" "build/latex" "all-pdf" "PAPER=a4" pyver) (let* ((dir (dirname file))
(copy-file "build/latex/scipy-ref.pdf" (tgt-dir (string-append html "/" dir)))
(string-append doc "/scipy-ref.pdf")) (install-file file html)))
(with-directory-excursion "build/html" (find-files "." ".*")))))
(for-each (lambda (file) #t))
(let* ((dir (dirname file)) (add-after 'unpack 'fix-tests
(tgt-dir (string-append html "/" dir))) (lambda _
(install-file file html))) (substitute* "scipy/integrate/tests/test_quadpack.py"
(find-files "." ".*")))) (("libm.so") "libm.so.6"))
#t))) #t))
(add-after 'install-doc 'check ;; Tests can only be run after the library has been installed and not
(lambda _ ;; within the source directory.
;; Tests can only be run after the library has been installed and not (delete 'check)
;; within the source directory. (add-after 'install 'check
(with-directory-excursion "/tmp" (lambda* (#:key inputs outputs #:allow-other-keys)
(zero? (system* "python" "-c" "import scipy; scipy.test()")))))))) (add-installed-pythonpath inputs outputs)
(with-directory-excursion "/tmp"
(zero? (system* "python" "-c"
"import scipy; scipy.test('full')")))
#t)))))
(home-page "http://www.scipy.org/") (home-page "http://www.scipy.org/")
(synopsis "The Scipy library provides efficient numerical routines") (synopsis "The Scipy library provides efficient numerical routines")
(description "The SciPy library is one of the core packages that make up (description "The SciPy library is one of the core packages that make up
@ -4175,15 +4174,8 @@ routines such as routines for numerical integration and optimization.")
(license license:bsd-3))) (license license:bsd-3)))
(define-public python2-scipy (define-public python2-scipy
(let ((scipy (package-with-python2 (package-with-python2
(strip-python2-variant python-scipy)))) (strip-python2-variant python-scipy)))
(package (inherit scipy)
;; Make sure to use special packages for Python 2 instead
;; of those automatically rewritten by package-with-python2.
(native-inputs
`(("python2-sphinx" ,python2-sphinx-1.2.3)
,@(fold alist-delete (package-native-inputs scipy)
'("python-sphinx")))))))
(define-public python-socksipy-branch (define-public python-socksipy-branch
(package (package