Thursday, February 12, 2009

Static LXML builds

I've built a recipe for building LXML on OSX boxes statically -- w/o dependencies to libxslt and libxml2.

This works for quite some people -- please report back if it does'nt work for you (and if it works).

Thursday, June 05, 2008

lxml on OSX -- solved

Hi guys. I've been investigating building lxml on OSX for quite some time now.

Here's the scoop so far:
  • I want to use buildout
  • I want NOT to use Apple's libraries (libxml, libxslt)
  • On OSX there's no "--rpath" option available, thus there's no way to tell an executable on link time where to look for dynamic libraries
  • This is disgusting (do we have 2008 or what?)
Ok, that's what I've come up with. Note the z3c.recipe.egg, it allows for arguments to the setup script, which the original zc.recipe.egg does not. The version 2.0.6 of lxml has a fix for OSX in, which allows to do away with DYLD_LIBRARY_PATH, BUT you need a DYLD_FORCE_FLAT_NAMESPACE=1. Don't ask. I have no idea.

recipe = zc.recipe.cmmi
url =
extra_options = --without-python

recipe = zc.recipe.cmmi
url =
extra_options = --with-libxml-prefix=${buildout:directory}/parts/libxml2/

recipe = plone.recipe.distros
urls =
version-suffix-packages = lxml-2.0.6.tgz

recipe = z3c.recipe.egg:setup
setup = ${lxml-download:location}/lxml
args =
develop = true

You use it like:


Monday, May 19, 2008

lxml on OSX -- again

Hi folks :)

Today, I've again tried to install lxml on OS X. For a project I do for a customer (migrating featurecreep CMS sites to Plone), I use the lxml parser. I get regular segfaults, this time using python 2.4 (I use macport for python 2.4).
I investigated again, and came along this post. The scoop is:
after blood, sweat, and some tears (kidding) this is *all* I needed, it seems:

export CFLAGS="-flat_namespace" static builds libxml2 libs, no buildout recipe. I just set that and ran:

python bdist_egg

which uses the libxml2 and etc. installed by ports. In fact, as long
as /opt/local/bin is on my path that should work without having to set
paths (i.e. from easy_install). All my tests that were segfaulting
are now passing. This appears to be the exact same behavior I got by
setting DYLD_FORCE_FLAT_NAMESPACE at runtime but without the side
affect of applying itself to anything else running in my shell ;)

so, I'm thinking this is just two lines of code added to cflags() ...

if sys.platform in ('darwin',):

Well. What can I say. Interesting poinst so far for OS X development:
  • no -rpath supported
  • no static libraries (Yup! No joke)

Sunday, May 18, 2008

Thursday, May 15, 2008

Aardvark bookmarklet


One should read on, THEN post.

Aardvark for Safari --- sort of

Well, this might be old news for you, but by dragging the "run demo" link on the Aardvark home page to the Safari bookmark bar actually allows you to inject Aardvark to the page your're currently viewing.

I think that's cool and useful :)

incredible stuff

I've just found this incredible stuff on the web. I thought I just might blog about it.

git shelves
import gitshelve

data = = '/tmp/data.git')

data[key] = "Hello, world!"
del data[key]

How cool is this? Distributed CMS someone?
Original post here. Git it here,
processing on **javascript**

This guy actually ported the processing language to Javascript.
Thats f***ing awesome!

Friday, May 09, 2008

LXML on OS X (again)

It seems that building lxml on Mac OS X is still a problem. I'm trying to use buildout as in:
recipe = zc.recipe.cmmi
url =
extra_options = --with-libxml-prefix=${buildout:directory}/parts/libxml2/

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

That fails when buildout tries to build the lxml egg. Looking closely at the error, I discovered that despite pointing it at the libxslt built, it still uses the one found in /usr/lib.

To be more specific: lxml tries to find xslt-config, which is in $BO/parts/libxslt/bin/xslt-config, but of course finds the one in /usr/bin first.

What I'd like to do is to add something like:

# this would be needed but zc.recipe.egg:custom doesn't allow for that
# Doh.
extra_options= --with-xslt-config=${buildout:directory}/parts/libxslt/bin/xslt-config

That option is available in zc.recipe.cmmi, but not in zc.recipe.egg. Looking at there I sadly found no obvious way to add this as it uses some version of easy_install.


Possible solutions:
  • build egg manually, add to egg cache (yuck-bleah)
  • build manually for OS X, add to own egg server (yuck)
  • roll-my-own recipe (work)