Archive

Archive for Friday 21 May 2010

Spidermonkey on Ubuntu Karmic

Friday 21 May 2010 9 comments

There is a noteworthy conflict on Karmic if you try to install libmozjs-dev because it conflicts with anything based on xulrunner 1.9. I can’t begin to explain why the Mozilla developers hold Spidermonkey to 1.8, but because of how the upstream Debian crew package it, this breaks things.

We all know I am hardly smart enough to have my hands on a keyboard in the first place, but I think the underlying issue is Debian folks insist on building all the xulrunner libraries with the name “libmozjs” instead of simply “libjs” — the latter is the default from source.

I really wanted Elinks with JScript, and I didn’t care about all the other crap Debian developers build into. What in blue blazes do I know about Lua scripting? So I typically build Elinks from the latest source (0.12pre5 at this moment). After downloading the source for Spidermonkey, I poked around at various ways to make it work without breaking the way Ubuntu runs Firefox.

Lacking the experience and understanding for tweaking the build configurations, I simply ran the basic build without installing. Then I examined where the Elinks build script looks for Spidermonkey, hoping to find a place in the file system Ubuntu didn’t use normally. One of the choices was the /opt/spidermonkey directory and I used that. But I didn’t know how to put that in the installer instructions, and my searching for simple instructions turned up nothing I could identify. So I examined the package contents and structure for the way Ubuntu builds libmozjs and echoed that under /opt/spidermonkey with an include and lib folder, and simply moved the files from the build manually. I had to poke around in the build directories of Spidermonkey, and found all but one file which appears on the Ubuntu package file list — jsosdep.h. I have no idea what difference that makes. But it seems the primary difference is the name of the actual runtime file — libjs versus libmozjs.

Once I had them in place, the Elinks configure script found it all and gave me a Spidermonkey build. Then I had to make sure Ubuntu knew to include this in the ld.conf. In /etc/ld.so.conf.d directory I created a libjs.conf file with this one line:

/opt/spidermonkey/lib/

and ran sudo ldconfig, hoping there would be no runtime conflicts. For now, I can run Firefox on JScript heavy sites without trouble, so I guess it’s working as I hoped. I’m sure there are plenty of folks who know more about this than I do, so feel free to comment.

Categories: computers Tags: , , ,
Follow

Get every new post delivered to your Inbox.

Join 225 other followers