Python 2.4 on Debian multiarch

by Jamie Lentin on Nov 29, 2012

I recently had to work on a project that needed Python 2.4. "Not a problem", I thought, "I'll just compile a Python and be on my way". However the bz2 module wasn't available. Strange, since the libbz2-dev package was definitely installed. Eventually 2 things dawned on me:

  • The hazy memory of me sitting, beer in hand, deciding "Yeah, I'll go multiarch, it'll all work fine I'm sure"
  • That modifying LDFLAGS isn't enough, there's all sorts of magic going on in basically looks in hardcoded paths for libraries, and because I'd gone multiarch the library was now in /lib/x86_64-linux-gnu/ By the time mutiarch came about, python 2.4 was too old for people to want to patch it.

However, given cmmi lets you patch files before you build, I took Martijn Pieters' example off stackoverflow and came up with:

python = python
parts +=

recipe = zc.recipe.cmmi
url =
executable = ${buildout:directory}/parts/python/bin/python2.4
patch =
patch_options = -p1

recipe = plone.recipe.command
command = ln -s ${python:executable} ${buildout:bin-directory}/python

Don't look too closely at the patch in question though. It's a bit ugly, and I couldn't be bothered to tidy it. You get a working Python though, which is the main thing.

blog comments powered by Disqus