2008-11-28

An lxml you can build on

Last week I wrote about Chris Perkins' staticlxml package. While it did work for me in a virtualenv, it wasn't feasible for a buildout environment.

However, Stefan Eletzhofer has come to the aid with his z3c.recipe.staticlxml package which really nails this dreadful issue.

Configuration is slightly verbose, but straightforward:
  [lxml]
recipe = z3c.recipe.staticlxml
egg = lxml
force = false
build-libxml2 = true
build-libxslt = true
static-build = true
Put this part into your buildout configuration; note that it must come before any parts that would try to pull in an lxml egg over the wire, otherwise it won't work. Make sure to wipe any existing lxml eggs from your buildout cache before you start.

To verify that everything's gone to plan, use the bindings tool:
   bash-3.2$ find . -name "*.so" -exec otool -L '{}' \;
We don't expect to see any references to libxml or libxslt here.

1 comments:

seletz said...

Hi malthe,
thanks for blogging that.

I've fixed the option defaults in rev 0.2.1.