From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Enge Subject: Re: libxml2-python Date: Thu, 7 Mar 2013 23:38:13 +0100 Message-ID: <201303072338.13585.andreas@enge.fr> References: <201303062343.03155.andreas@enge.fr> <5137E3B2.4090801@gmail.com> Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_VbRORa+Bc1rqDaU" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:34741) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDjSC-0002rK-JV for bug-guix@gnu.org; Thu, 07 Mar 2013 17:38:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDjS8-0001N9-RQ for bug-guix@gnu.org; Thu, 07 Mar 2013 17:38:24 -0500 Received: from moutng.kundenserver.de ([212.227.126.186]:56753) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDjS8-0001Mb-Gk for bug-guix@gnu.org; Thu, 07 Mar 2013 17:38:20 -0500 In-Reply-To: <5137E3B2.4090801@gmail.com> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: Cyril Roelandt Cc: bug-guix@gnu.org --Boundary-00=_VbRORa+Bc1rqDaU Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Am Donnerstag, 7. M=E4rz 2013 schrieb Cyril Roelandt: > From setup.py: > # those are examined to find > # - libxml2/libxml/tree.h > # - iconv.h > # - libxslt/xsltconfig.h > includes_dir =3D [ > "/usr/include", > "/usr/local/include", > "/opt/include", > os.path.join(ROOT,'include'), > HOME > ]; >=20 > You could patch setup.py to add the right path. Or you could run > "configure" in libxml2 with "--prefix=3D", then cd into the > "python" directory, and ROOT will be set to in setup.py. Thanks for your help! Indeed, when running "setup.py install" from the guix= =20 builder, libxml2 is found after installing it, so the "--prefix" is=20 honoured. However, then iconv.h is searched for in the given list of paths,= =20 which does not include /nix/store/...glibc.../include, and the CPATH is not= =20 taken into account, so iconv.h is not found. I tried adding glibc as an explicit input and to overwrite the path in=20 setup.py. However, that does not use the glibc of the CPATH, but builds=20 another one on top of it. Do I understand it correctly that I need to use=20 glibc-final instead? > Try: > $ python setup.py install --prefix=3D/path/to/foo/bar > You may have to adjust $PYTHONPATH to something like: > /path/to/foo/bar:$PYTHONPATH > for this to work. Specifying no --prefix, it now tries to install a file as /nix/store/j8f28wavspyic8g9didl1ninaz48vdq0- python-2.7.3/lib/python2.7/site-packages/libxml2mod.so which fails since this is another package, not libxml2. Giving as --prefix the output path, files are instead installed into /nix/store/svnw8fq87qrfrpcs7grx5nram558ahkp- libxml2-2.9.0/lib/python2.7/site-packages/ which looks reasonable. I am attaching the resulting patch. Is it reasonable to apply it to the=20 libxml2 package, or would it be preferable to create a separate libxml2- python package? Andreas --Boundary-00=_VbRORa+Bc1rqDaU Content-Type: text/x-patch; charset="UTF-8"; name="libxml2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="libxml2.patch" diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm index b3c5f7d..0a47f35 100644 --- a/gnu/packages/xml.scm +++ b/gnu/packages/xml.scm @@ -19,6 +19,8 @@ (define-module (gnu packages xml) #:use-module (gnu packages) + #:use-module (gnu packages base) + #:use-module (gnu packages compression) #:use-module (gnu packages gnupg) #:use-module (gnu packages perl) #:use-module (gnu packages python) @@ -64,7 +66,22 @@ things the parser might find in the XML document (like start tags).") (home-page "http://www.xmlsoft.org/") (synopsis "libxml2, a C parser for XML") (inputs `(("perl" ,perl) - ("python" ,python))) + ("python" ,python) + ("zlib" ,zlib) + ("glibc" ,glibc-final))) + (arguments + `(#:phases + (alist-replace + 'install + (lambda* (#:key inputs outputs #:allow-other-keys #:rest args) + (let ((install (assoc-ref %standard-phases 'install)) + (glibc (assoc-ref inputs "glibc")) + (out (assoc-ref outputs "out"))) + (apply install args) + (chdir "python") + (substitute* "setup.py" (("/opt/include") (string-append glibc "/include"))) + (system* "python" "setup.py" "install" (string-append "--prefix=" out)))) + %standard-phases))) (description "Libxml2 is the XML C parser and toolkit developed for the Gnome project (but it is usable outside of the Gnome platform).") --Boundary-00=_VbRORa+Bc1rqDaU--