From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyril Roelandt Subject: Re: libxml2-python Date: Sun, 10 Mar 2013 17:10:06 +0100 Message-ID: <513CB05E.80609@gmail.com> References: <201303062343.03155.andreas@enge.fr> <5137E3B2.4090801@gmail.com> <201303072338.13585.andreas@enge.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:37138) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UEj0Z-00061z-DV for bug-guix@gnu.org; Sun, 10 Mar 2013 12:22:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UEj0X-00015s-W0 for bug-guix@gnu.org; Sun, 10 Mar 2013 12:21:59 -0400 Received: from mail-wg0-f45.google.com ([74.125.82.45]:45734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UEj0X-00015X-Pg for bug-guix@gnu.org; Sun, 10 Mar 2013 12:21:57 -0400 Received: by mail-wg0-f45.google.com with SMTP id dq12so4230417wgb.12 for ; Sun, 10 Mar 2013 09:21:56 -0700 (PDT) In-Reply-To: <201303072338.13585.andreas@enge.fr> 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: Andreas Enge Cc: bug-guix@gnu.org On 03/07/2013 11:38 PM, Andreas Enge wrote: > Am Donnerstag, 7. März 2013 schrieb Cyril Roelandt: >> From setup.py: >> # those are examined to find >> # - libxml2/libxml/tree.h >> # - iconv.h >> # - libxslt/xsltconfig.h >> includes_dir = [ >> "/usr/include", >> "/usr/local/include", >> "/opt/include", >> os.path.join(ROOT,'include'), >> HOME >> ]; >> >> You could patch setup.py to add the right path. Or you could run >> "configure" in libxml2 with "--prefix=", 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 > builder, libxml2 is found after installing it, so the "--prefix" is > honoured. However, then iconv.h is searched for in the given list of paths, > which does not include /nix/store/...glibc.../include, and the CPATH is not > taken into account, so iconv.h is not found. > > I tried adding glibc as an explicit input and to overwrite the path in > setup.py. However, that does not use the glibc of the CPATH, but builds > another one on top of it. Do I understand it correctly that I need to use > glibc-final instead? > >> Try: >> $ python setup.py install --prefix=/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 > libxml2 package, or would it be preferable to create a separate libxml2- > python package? > I'm not sure it is a good idea to automatically install bindings along with the library, so I'd rather have a package per binding. On an unrelated note, the PYTHONPATH envrionment variable must be adjusted in order to use the library, since it is not installed in a "standard" location, but I guess there is not much we can do about it. Cyril.