Saturday 7 June 2008

Installing Google Gadgets in Fedora 9

Google recently open-sourced the Google Gadgets framework for Linux (http://code.google.com/p/google-gadgets-for-linux/). As is most Google products, this is still in beta, so the installation experience on my Fedora 9 machine wasn't exactly smooth. But the quirks were easy to iron out.

Dependencies
The only dependency not available in the official repos is the SpiderMonkey library. Follow these steps to compile SpiderMonkey 1.7 on your machine.

Step 1:
Grab the source tarball and extract the contents.
wget http://ftp.mozilla.org/pub/mozilla.org/js/js-1.7.0.tar.gz
tar xvf js-1.7.0.tar.gz


Step 2:
By default the build options for SpiderMonkey is set to create a debug version. Since I am not planning to use SpiderMonkey for development purposes, I compiled an optimized version of the library.
cd js/src
make -f Makefile.ref BUILD_OPT=1



Step 3:
If the compilation was successful, a folder titled Linux_ALL_OPT.OBJ will be created in the src directory. To test whether everything is working fine type:
Linux_ALL_OPT.OBJ/js perfect.js
You should see an output similar to the following:


A number is 'perfect' if it is equal to the sum of its
divisors (excluding itself).

The perfect numbers up to 500 are:
6 = 1 + 2 + 3
28 = 1 + 2 + 4 + 7 + 14
496 = 1 + 2 + 4 + 8 + 16 + 31 + 62 + 124 + 248
That's all.

Step 4:
Create the following symbolic links for ease.
sudo ln -s Linux_ALL_OPT.OBJ/libjs.so /usr/lib/libjs.so
ln -s Linux_All_OPT.OBJ/jsautocfg.h
ln -s Linux_All_OPT.OBJ/jsautokw.h


SpiderMonkey is now ready for Google Gadgets.

Installing Google Gadgets
The public release of Google Gadgets threw up a lot of compilation errors at me. Most of them were trivial and I could fix them with single edits to the source files, but soon things got really ugly. Since I didn't want to spend time reading and understanding the WHOLE code base, I decided to grab the SVN source in the hopes that most of the bugs were fixed. It turns out I was right !

Step 1:
Grab the sources.
svn checkout http://google-gadgets-for-linux.googlecode.com/svn/trunk/ google-gadgets-for-linux-read-only
cd google-gadgets-for-linux-read-only/



Step 2:
Setup the build environment.
sh autotools/bootstrap.sh
cp /usr/share/automake-1.10/mkinstalldirs ./libltdl/



Step 3:
Run configure with the path to SpiderMonkey sources. I also disabled QT elements because I primarily use Gnome.
./configure --with-smjs-incdir=~/bin/spidermonkey/js/src --disable-libggadget-qt --disable-qt-system-framework --disable-qtwebkit-browser-element --disable-qt-host

Step 4:
Make and install.
make && sudo make install

Step 5:
Run GoogleGadgets !
ggl-gtk


4 comments:

Sashko said...

Hello!
I'm install google-gedgets from source code in fedora 8. When run ggl-gtk, show next error: $ ggl-gtk

Not a regular file: /
Failed to load module smjs-script-runtime
(ggl-gtk:3954): Gtk-WARNING **: Theme directory 64x64apps of theme kdeclassic has no size field
(ggl-gtk:3954): Gtk-WARNING **: Theme file for default has no name
(ggl-gtk:3954): Gtk-WARNING **: Theme file for default has no directories

Program can't start because it failed to load the following module(s):

js-script-runtime

At your page seen this js-1.7.0.tar.gz. I'm download and install this too, but error shows again. Where need make symlinks of jsautocfg.h & jsautokw.h to /usr/lib/ too? I do this and nothing.

JanuZ said...

I am not sure what causes this error. Did Spidermonkey install correctly ? Did you get the same output as mine when you ran Linux_ALL_OPT.OBJ/js perfect.js ??

Also make sure that you include the correct path to the spidermonkey sources in the configure command. (Step 3 of section "Installing google gadgets")

Sashko said...

Test perfect.js work. Spidermonkey install in home directory in personal folder by command make -f Makefile.ref BUILD_OPT=1. When install gadgets ./configure not used, because in sources use cmake. Type cmake --with-smjs-incdir=/home/.../js/src/ /path/to/cmakefiles.txt, then make&& make install. Like cmake ignored parameter.

Anonymous said...

It's ok, thanks. Luis Ramon, Ocosingo, Chiapas, México