Running Mediatomb in Ubuntu with JS Support

1 minute read

Since Ubuntu Karmic 9.10, Mediatomb comes compiled without JavaScript support in the Ubuntu repositories. This is annoying as it removes one of the most powerful tools in Mediatomb, in that you can script how your media is imported via JavaScript functions. This is because of the reliance Mediatomb has on the "libmozjs" package which has, since 9.10, been removed from Ubuntu. It has been raised in Launchpad as a bug and discussed, but without a fix being officially published. Having given up waiting (now 3 releases, 12 months...!) for a fix, I decided to set about a solution myself.

Recompile Mediatomb

I came across a post on how to enable JavaScript in Mediatomb. This involves compiling the SpiderMonkey JavaScript engine, and then recompiling Mediatomb. Personally, I couldn't even get SpiderMonkey to compile, so gave up on this solution after a couple of hours.

Using Karmic Repositories

As a final attempt I decided to use the Karmic repositories. I added them to apt:

sudo gedit /etc/apt/sources.list
I then copied my current Ubuntu repository, "deb http://gb.archive.ubuntu.com/ubuntu/ natty universe", pasted it on a new line and changed "natty" to "karmic".

Opening up Synaptic Package Manager I searched for the "mediatomb" package. With it highlighted, I used the "Package" menu at the top of the window to firstly "Force Version" to the Karmic package and then "Lock" it. I did this for the following packages:
  • mediatomb
  • mediatomb-common
  • mediatomb-daemon
In doing so it should ask to install a number of additional packages (from the Karmic repository). Once everything is installed you should be able to run Mediatomb with full JavaScript support!

Updated: