From: Federico Beffa <beffa@ieee.org>
To: Guix-devel <guix-devel@gnu.org>
Subject: [PATCH] gnu: Add numpy.
Date: Mon, 1 Dec 2014 18:17:14 +0100 [thread overview]
Message-ID: <CAKrPhPO2oX3-h3p9mgAHE-e9r=5sDKvw0tM4kz0oQrBN4AL6hQ@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 59 bytes --]
Here the user installable version of numpy.
Regards,
Fede
[-- Attachment #2: 0001-gnu-Add-numpy.patch --]
[-- Type: text/x-patch, Size: 4412 bytes --]
From cdf0c1a3193d1855d8b1a512042f91a56c82ea28 Mon Sep 17 00:00:00 2001
From: Federico Beffa <beffa@fbengineering.ch>
Date: Mon, 1 Dec 2014 13:28:24 +0100
Subject: [PATCH] gnu: Add numpy.
* gnu/packages/python.scm (python-numpy, python2-numpy): New variables.
---
gnu/packages/python.scm | 71 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 71 insertions(+)
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index dad68fd..0689ea5 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -46,6 +46,8 @@
#:use-module (gnu packages image)
#:use-module (gnu packages imagemagick)
#:use-module (gnu packages fontutils)
+ #:use-module (gnu packages which)
+ #:use-module (gnu packages perl)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix utils)
@@ -1939,6 +1941,75 @@ capabilities.")
(define python2-numpy-bootstrap
(package-with-python2 python-numpy-bootstrap))
+(define-public python-numpy
+ (package (inherit python-numpy-bootstrap)
+ (name "python-numpy")
+ (outputs '("out" "doc"))
+ (inputs
+ `(("which" ,which)
+ ("python-setuptools" ,python-setuptools)
+ ("python-matplotlib" ,python-matplotlib)
+ ("python-sphinx" ,python-sphinx)
+ ("python-pyparsing" ,python-pyparsing)
+ ("python-numpydoc" ,python-numpydoc)
+ ,@(package-inputs python-numpy-bootstrap)))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)
+ ("texlive" ,texlive)
+ ("texinfo" ,texinfo)
+ ("perl" ,perl)
+ ,@(package-native-inputs python-numpy-bootstrap)))
+ (arguments
+ `(,@(substitute-keyword-arguments
+ (package-arguments python-numpy-bootstrap)
+ ((#:phases phases)
+ `(alist-cons-after
+ 'install 'install-doc
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((data (string-append (assoc-ref outputs "doc") "/share"))
+ (doc (string-append
+ data "/doc/" ,name "-"
+ ,(package-version python-numpy-bootstrap)))
+ (info (string-append data "/info"))
+ (html (string-append doc "/html"))
+ (pyver ,(string-append "PYVER=")))
+ (with-directory-excursion "doc"
+ (mkdir-p html)
+ (system* "make" "html" pyver)
+ (system* "make" "latex" "PAPER=a4" pyver)
+ (system* "make" "-C" "build/latex"
+ "all-pdf" "PAPER=a4" pyver)
+ ;; Generation of the info file fails.
+ ;; (system* "make" "info" pyver)
+ ;; (mkdir-p info)
+ ;; (copy-file "build/texinfo/numpy.info"
+ ;; (string-append info "/numpy.info"))
+ (map (lambda (file)
+ (copy-file (string-append "build/latex" file)
+ (string-append doc file)))
+ '("/numpy-ref.pdf" "/numpy-user.pdf"))
+ (with-directory-excursion "build/html"
+ (map (lambda (file)
+ (let* ((dir (dirname file))
+ (tgt-dir (string-append html "/" dir)))
+ (unless (equal? "." dir)
+ (mkdir-p tgt-dir))
+ (copy-file file (string-append html "/" file))))
+ (find-files "." ".*"))))))
+ ,phases)))))))
+
+(define-public python2-numpy
+ (let ((numpy (package-with-python2 python-numpy)))
+ (package (inherit numpy)
+ ;; Make sure we use exactly PYTHON2-NUMPYDOC, which is customized for
+ ;; Python 2. Since it is also an input to PYTHON2-MATPLOTLIB, we need to
+ ;; import the right version of 'matplotlib' as well.
+ (inputs `(("python2-numpydoc" ,python2-numpydoc)
+ ("python2-matplotlib" ,python2-matplotlib)
+ ,@(alist-delete "python-numpydoc"
+ (alist-delete "python-matplotlib"
+ (package-inputs numpy))))))))
+
(define-public python-pyparsing
(package
(name "python-pyparsing")
--
1.8.4
next reply other threads:[~2014-12-01 17:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-01 17:17 Federico Beffa [this message]
2014-12-01 20:34 ` [PATCH] gnu: Add numpy Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAKrPhPO2oX3-h3p9mgAHE-e9r=5sDKvw0tM4kz0oQrBN4AL6hQ@mail.gmail.com' \
--to=beffa@ieee.org \
--cc=guix-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).