[lxml-dev] install lxml 2.0.5 on Mac OS X Leopard - why is it so hard?

Stefan Behnel stefan_ml at behnel.de
Mon May 12 20:39:57 CEST 2008


Kumar McMillan wrote:
> The best thing I can think of is to get --static working for libxml2.a
> files and then I can submit to you the steps I took to build my static
> libs from source (assuming I can get that all to work).

I think a buildout will help here, as previously proposed a couple of times.

http://pypi.python.org/pypi/zc.buildout
http://pypi.python.org/pypi/zc.recipe.cmmi

We can configure it to build only the static versions of libxml2 and libxslt,
and then build against those.

------------------------
[libxml2]
recipe = zc.recipe.cmmi
url = http://ftp.gnome.org/pub/GNOME/sources/libxml2/2.6/libxml2-2.6.32.tar.gz
extra_options = --without-python --enable-shared --enable-static

[libxslt]
recipe = zc.recipe.cmmi
url = http://ftp.gnome.org/pub/GNOME/sources/libxslt/1.1/libxslt-1.1.22.tar.bz2
extra_options = --with-libxml-prefix=${buildout:directory}/parts/libxml2/
                --without-python --disable-shared --enable-static

[lxml]
recipe = zc.recipe.egg:custom
egg = lxml
include-dirs = ${buildout:directory}/parts/libxml2/include/libxml2
               ${buildout:directory}/parts/libxslt/include
library-dirs = ${buildout:directory}/parts/libxml2/lib
               ${buildout:directory}/parts/libxslt/lib
------------------------

lxml's setup.py would then need to be changed to automatically compile
statically on the Mac-OS platform. Although maybe we should only do that if
buildout is running (sys.modules?).

Stefan


More information about the lxml-dev mailing list