Home > Uncategorized > How to enable JavaScript in MediaTomb on Ubuntu

How to enable JavaScript in MediaTomb on Ubuntu

In Ubuntu 10.04, MediaTomb is compiled without JavaScript (libjs) support, so if you try to use JavaScript for your layout you will be presented in the log files with:

ERROR: MediaTomb was compiled without js support, however you specified “js” to be used for the virtual-layout.

To remedy the situation, the first thing you need to do is to install libjs (SpiderMonkey).

Next you need to download the MediaTomb source (line 2 below) and all its development dependencies (line 1) so that it can be rebuilt with the newly installed libjs (change to root first, or prefix the lines below with “sudo”).

apt-get build-dep mediatomb
apt-get source mediatomb
vim mediatomb-0.12.0~svn2018/debian/rules

In the debian/rules file, search for MEDIATOMB_CONFIG_OPTIONS and change –disable-libjs to –enable-libjs. You should also update the changelog file (in the same debian directory) and perhaps the mediatomb_0.12.0~svn2018-6ubuntu2.dsc file to change the version. When done with the edits, run dpkg-buildpackage -rfakeroot -us -uc from the same directory you executed “apt-get” in.

If all goes well, you should see 3 new deb files in your current directory. Install them all (dpkg -i mediatomb*.deb) and start enjoying your JavaScript enabled MediaTomb.

To revert back to the original: apt-get install --reinstall mediatomb

Categories: Uncategorized Tags:
  1. BobbyInfinity
    October 2nd, 2010 at 10:07 | #1

    Great post. I had to monkey around with some file permissions to get it to build, but once I straitened that out it was golden.

  2. PierreC
    November 15th, 2010 at 08:58 | #2

    Hi Gabriel,

    Thanks for your posts !
    Thanks to you, I succeed to install mediatomb with js support.

    However, it seems that the dpkg-buildpackage command should be executed from the mediatomb-0.12.0~svn2018 directory and not his parent.

    Regards,

    Pierre

  3. Glyn
    June 25th, 2011 at 05:46 | #3

    Hi

    Tried following all the above, works, up to a point.

    When running dpkg – I can see everything getting checked and so forth, but when it gets to a point where it is dealing with ../src/scripting/ it bombs out showing errors in make – the screen shows this:

    In file included from ../src/scripting/playlist_parser_script.h:36:0,
    from ../src/content_manager.h:46,
    from ../src/autoscan.cc:38:
    ../src/scripting/script.h:69:5: error: ‘JSScript’ does not name a type
    ../src/scripting/script.h:70:5: error: ‘JSScript’ does not name a type
    ../src/scripting/script.h:118:5: error: ‘JSScript’ does not name a type
    ../src/scripting/script.h:119:19: error: ‘JSScript’ has not been declared
    make[3]: *** [libmediatomb_a-autoscan.o] Error 1
    make[3]: Leaving directory `/home/media/mediatomb-0.12.1/build’
    make[2]: *** [all-recursive] Error 1
    make[2]: Leaving directory `/home/media/mediatomb-0.12.1′
    make[1]: *** [all] Error 2
    make[1]: Leaving directory `/home/media/mediatomb-0.12.1′
    dh_auto_build: make -j1 returned exit code 2
    make: *** [binary] Error 2
    dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2

    I’m running Ubuntu 11.04. Is there any advice or help you can offer?

    Thanks.

  4. Adam
    July 18th, 2011 at 01:19 | #4

    I couldn’t get this to work without installing libnspr, and adding “-I /usr/include/nspr” all over the Makefiles. It would appear that some things have changed…

  5. Adam
    July 18th, 2011 at 01:35 | #5

    Hrm. And even that didn’t work. It appears that you have to use libjs1.8 — the newer libjs1.8.5 removes the simple functions to convert bytestrings into C-compatible buffers.

  6. July 19th, 2011 at 09:38 | #6

    Hi Gabriel,

    thanks for the great post!

    Unfortunately I didn’t get it to work on Ubuntu 11.04 (natty) at first, but I came up with a solution based on your input:
    http://tobias-zimmer.blogspot.com/2011/07/howto-compile-mediatomb-with-javascript.html

  7. Valoche
    July 26th, 2011 at 17:07 | #7

    I’m using Natty, and compiled mediatomb successfully.
    And yes, you have to use libjs1.8.0

  8. Andy
    April 9th, 2012 at 17:59 | #8

    Thanks for that tutorial! Helped me a lot.

  1. February 4th, 2013 at 18:30 | #1