From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH 1/2] gnu: Add numpy Date: Sun, 26 Oct 2014 19:56:17 +0100 Message-ID: <87bnoyk6g9.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XiUqP-0001Ab-E6 for guix-devel@gnu.org; Sun, 26 Oct 2014 16:55:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XiUqK-0003PK-L7 for guix-devel@gnu.org; Sun, 26 Oct 2014 16:55:21 -0400 Received: from hera.aquilenet.fr ([2a01:474::1]:41696) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XiUqK-0003P7-9M for guix-devel@gnu.org; Sun, 26 Oct 2014 16:55:16 -0400 In-Reply-To: (Federico Beffa's message of "Sun, 26 Oct 2014 14:09:32 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Federico Beffa Cc: Guix-devel --=-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Federico Beffa skribis: > From 063b33562c4fee2ea4e3fd1b53a27770047e9201 Mon Sep 17 00:00:00 2001 > From: Federico Beffa > Date: Sun, 26 Oct 2014 15:03:17 +0100 > Subject: [PATCH 1/2] gnu: Add numpy > > * gnu/packages/python.scm(python-numpy, python2-numpy): New variables. ^ Missing space. > +(define python-numpy-reference > + (origin > + (method url-fetch) > + (uri (string-append "mirror://sourceforge/numpy/reference.pdf")) > + (sha256=20 > + (base32 > + "0izsmzazhd042ra6p7as2jhwx8713sc5gpn9s5nifwm68biwn0lp")))) > + > +(define python-numpy-userguide > + (origin > + (method url-fetch) > + (uri (string-append "mirror://sourceforge/numpy/userguide.pdf")) > + (sha256=20 > + (base32 > + "1z2xjlxldv01ad2775k9birg1hkqay5wbi5vmgz3rlr6dczvk77k")))) Can these manuals be built from source? If they can=E2=80=99t, then that=E2=80=99s non-free documentation. If they can but the process is tedious, then it=E2=80=99s OK to leave it th= at way with a TODO, and also a comment stating what its license is. > + (inputs > + `(("python" ,python) ; otherwise ld does not find libpython3.3m This is because Python is not added to =E2=80=98LIBRARY_PATH=E2=80=99, righ= t? I think this is fixed by this patch: --=-=-= Content-Type: text/x-patch Content-Disposition: inline --- a/guix/build-system/python.scm +++ b/guix/build-system/python.scm @@ -110,10 +110,11 @@ prepended to the name." '()) ,@inputs + ("python" ,python) + ;; Keep the standard inputs of 'gnu-build-system'. ,@(standard-packages))) - (build-inputs `(("python" ,python) - ,@native-inputs)) + (build-inputs native-inputs) (outputs outputs) (build python-build) (arguments (strip-keyword-arguments private-keywords arguments))))) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Can you confirm? > + ("python-numpy-userguide" ,python-numpy-userguide) > + ("python-numpy-reference" ,python-numpy-reference) > + ("atlas" ,atlas))) As discussed in the other thread, this should probably be the generic (unoptimized) ATLAS here. > + (alist-replace > + 'build > + (lambda* (#:key outputs inputs=20 > + #:allow-other-keys #:rest args) > + (let* ((build (assoc-ref %standard-phases 'build)) Use =E2=80=98alist-cons-before=E2=80=99 instead of calling the original =E2= =80=98build=E2=80=99 phase (I think this was discussed before and there was rough consensus on that.) > + (alist-cons-after > + 'install 'install-doc > + (lambda* (#:key outputs inputs #:allow-other-keys) > + ;; procedure from gnu-build-system.scm > + (define (package-name) > + (let* ((out (assoc-ref outputs "out")) > + (base (basename out)) > + (dash (string-rindex base #\-))) > + (string-drop (if dash > + (substring base 0 dash) > + base) > + (+ 1 (string-index base #\-))))) > + > + (let ((doc (string-append (assoc-ref outputs "doc")=20 > + "/share/doc/" (package-name)))) Just use (string-append ,name "-" ,version) so the =E2=80=98package-name=E2= =80=99 procedure isn=E2=80=99t needed. > + (and (zero?=20 > + (system* "cp"=20 > + (assoc-ref inputs "python-numpy-reference")= =20 > + (string-append doc "/reference.pdf"))) > + (zero?=20 > + (system* "cp"=20 > + (assoc-ref inputs "python-numpy-userguide") > + (string-append doc "/userguide.pdf")))))) Use the =E2=80=98copy-file=E2=80=99 procedure instead of calling =E2=80=98c= p=E2=80=99. > + ;; Tests can only be run after the library has been installed a= nd not > + ;; within the source directory. > + (alist-cons-after > + 'install 'check > + (lambda _=20 > + (with-directory-excursion "/tmp" > + (zero? (system* "python" "-c" "import numpy; numpy.test()"= )))) > + (alist-delete=20 > + 'check=20 > + %standard-phases)))))) Just (alist-replace 'check ...) ? > +(define-public python2-numpy > + (package (inherit (package-with-python2 python-numpy)) > + ;; If we don't redefine the inputs here, then python (version= 3) is > + ;; also imported and its libraries come first in PYTHONPATH. = This > + ;; causes the 'check phase to fail. Normally this will no longer be needed if the patch above solves the problem. Thanks! Ludo=E2=80=99. --=-=-=--