Monday, June 2, 2008

How to get latest Compiz Fusion( 0.7.6 ) on Ubuntu Hardy WITHOUT borking your default installation

When it comes to certain projects, I always try to remain up to date with the latest changes. Projects like Wine and Compiz-Fusion make progress so fast that it's impossible to remain with the older release of the project. Now while Wine can be kept up to date by a trivial addition of repository, there is unfortunately no such repository for Ubuntu for Compiz.
Hence we have to resort to old age method compile from source.
But there is a great risk in removing the default package which comes with Ubuntu, and installing new release over that. Removing the default installation of Compiz may result in failiure while distribution upgrade, and also the Compiz packages may not be dealt with important security updates provided by Canonical. Hence, we choose the way of installing Compiz locally, so as to get up to date new package without removing any older packages.

Now the first step in our journey would be to download all the packages needed for compiling.
In terminal, type


sudo apt-get update 
sudo apt-get install build-essential libxcomposite-dev libpng12-dev libsm-dev libxrandr-dev libxdamage-dev 
libxinerama-dev libstartup-notification0-dev libgconf2-dev libgl1-mesa-dev libglu1-mesa-dev libmetacity-dev 
librsvg2-dev libdbus-1-dev libdbus-glib-1-dev libgnome-desktop-dev libgnome-window-settings-dev gitweb curl 
autoconf automake automake1.9 libtool intltool libxslt1-dev xsltproc libwnck-dev python-dev python-pyrex 
libxcb1-dev

cd
mkdir compiz
mkdir src


Now, go ahead to the download page and download all the files with extension .tar.bz2 at this page as well as Compiz itself to the $HOME/compiz/src folder.
Then, extract all the files to the same folder by right clicking on them and choosing 'Extract here'

Let's compile the source now. Enter to the compiz directory

cd

cd compiz/src/compiz-0.7.6

./configure --prefix=$HOME/compiz

make

make install

Now, be in the same terminal for rest of the procedure. We will then compile rest of the packages one by one

export $PKG_CONFIG_PATH=$HOME/compiz/lib/pkgconfig
cd ../compiz-bcop-0.7.6
./congfigure --prefix=$HOME/compiz
make
make install

After this step, copy the bcop.pc to directory $HOME/compiz/lib/pkgconfig

cp bcop.pc $HOME/compiz/lib/pkgconfig

Then, we continue compiling other required packages

cd ../libcompizconfig-0.7.6
./congfigure --prefix=$HOME/compiz
make
make install

cd ../compizconfig-python
./congfigure --prefix=$HOME/compiz
make
make install

cd ../ccsm-0.7.6
python setup.py install --prefix=$HOME/compiz

cd ../compiz-fusion-plugins-main-0.7.6
./congfigure --prefix=$HOME/compiz
make
make install

cd ../compiz-fusion-plugins-extra-0.7.6
./congfigure --prefix=$HOME/compiz
make
make install

cd ../compiz-fusion-plugins-unsupported-0.7.6
./congfigure --prefix=$HOME/compiz
make
make install

That's it. We are done with compiling all the files. Now is the time to get the wrapper script to start compiz.

Download this file and open it with text editor.
Now search for the term [home path] and replace it with your home path, which is the output of command

echo $HOME

Now, copy the file compiz.wrapper to the directory $HOME/compiz/bin and

cd $HOME/compiz/bin
chmod +x compiz.wrapper
mv compiz compiz.real

All set to go, but first we have to make a important change in 'ccsm' script.
In the bin folder, open the ccsm file with a text editor and add the following lines just to the top of the file.

import sys
sys.path.insert(1,"[home path]/compiz/lib/python2.5/site-packages")

Again, replace [home path] by your home directory address. Save the files and close it.
We are done. Now, press alt+F2 and stop the already running compiz by command

metacity --replace

Back in terminal, type

./compiz.wrapper &
./emerald &

This would start the new version of compiz. If you want to check out new cool feature like spherical 'cube', just type in terminal

./ccsm

Have fun!!