Running `python-spidermonkey` on JeOS
python-spidermonkey project looks brilliant.
I ran into a snag or two while getting up and running on JeOS (my dev environment of choice), so I’m documenting the process here.
Install python headers and
pkg-config. Forgetting to install
pgk-configwill give you some exciting errors in the compilation phase later on that make it sound like NSPR failed to install correctly. If you’re on JeOS, it’s more likely the case that you don’t have
sudo apt-get install python2.6-dev pkg-config
Install netscape portable runtime:
sudo apt-get install libnspr4-dev
Pull down python-spidermonkey
mkdir -p ~/src cd ~/src git clone git://github.com/davisp/python-spidermonkey.gitnsp
cd ~/src/python-spidermonkey python setup.py build
Actually, don’t do this. One of the tests fails on JeOS, and it fails in a way that sucks up all your resources and leaves you in an infinite loop. Yay!
Install: Even though the max time test fails (spectacularly), the bridge seems to work pretty well. Install the package anyway, just don’t rely on being able to set a max execution time on your code. :)
sudo python setup.py install
Now, to see about getting JSLint running in this environment… Fun!— Mike West