HOWTO Build the Ubuntu Desktop (the script way)

Step 1: Create the necessary directories and scripts

$ mkdir -p canonical/staging

Save the following script as: ~/.unity-bash-functions (pastebin: http://paste.ubuntu.com/16373441/):

 1 function recreate-build-dir()
 2 {
 3    rm -r build
 4    mkdir build
 5    cd build
 6 }
 7 
 8 function remake-autogen-project()
 9 {
10     ./autogen.sh --prefix=$HOME/canonical/staging --enable-debug
11     make clean && make -j8 install
12 }
13 
14 function remake-unity()
15 {
16     recreate-build-dir
17     cmake .. -DCMAKE_BUILD_TYPE=Debug -DCOMPIZ_PLUGIN_INSTALL_TYPE=local -DCMAKE_INSTALL_PREFIX=$HOME/canonical/staging/ \
18              -DGSETTINGS_LOCALINSTALL=ON -DCMAKE_SYSCONFDIR=$HOME/canonical/staging/etc \
19              -DCOMPIZ_COMPOSITE_LIB=/usr/lib/x86_64-linux-gnu/compiz/libcomposite.so \
20              -DCOMPIZ_OPENGL_LIB=/usr/lib/x86_64-linux-gnu/compiz/libopengl.so \
21              -DCOMPIZ_LIB=/usr/lib/x86_64-linux-gnu/libcompiz_core.so \
22              -DCOMPIZ_BUILD_TESTING=OFF \
23              -DENABLE_UNIT_TESTS=OFF \
24              -DI18N_SUPPORT=OFF \
25              -DBOOT_LOGGER=ON \
26              -DBUILD_SHARED_LIBS=ON
27 
28     make -j8 install
29 }
30 
31 function remake-unity-compiz-path()
32 {
33     recreate-build-dir
34     cmake ..  -DCMAKE_BUILD_TYPE=Debug -DCOMPIZ_PLUGIN_INSTALL_TYPE=local -DCMAKE_INSTALL_PREFIX=$HOME/canonical/staging/ \
35              -DGSETTINGS_LOCALINSTALL=ON -DCMAKE_SYSCONFDIR=$HOME/canonical/staging/etc \
36              -DCOMPIZ_COMPOSITE_LIB=~/canonical/staging/lib/compiz/libcomposite.so \
37              -DCOMPIZ_OPENGL_LIB=~/canonical/staging/lib/compiz/libopengl.so \
38              -DCOMPIZ_LIB=~/canonical/staging/lib/libcompiz_core.so \
39          -DCOMPIZ_BUILD_TESTING=OFF \
40          -DENABLE_UNIT_TESTS=OFF \
41          -DI18N_SUPPORT=OFF \
42          -DBOOT_LOGGER=ON \
43          -DBUILD_SHARED_LIBS=ON
44 }
45 
46 function unity-env
47 {
48  export PATH=~/canonical/staging/bin:$PATH
49  export XDG_DATA_DIRS=~/.config/compiz-1/gsettings/schemas:~/canonical/staging/share:/usr/share:/usr/local/share
50  export LD_LIBRARY_PATH=~/canonical/staging/lib:${LD_LIBRARY_PATH}
51  export LD_RUN_PATH=~/canonical/staging/lib:${LD_RUN_PATH}
52  export PKG_CONFIG_PATH=~/canonical/staging/lib/pkgconfig:${PKG_CONFIG_PATH}
53  export PYTHONPATH=~/canonical/staging/lib/python2.7/site-packages:$PYTHONPATH
54  export GI_TYPELIB_PATH=~/canonical/staging/lib/girepository-1.0:$GI_TYPELIB_PATH
55  export XDG_CONFIG_DIRS=~/canonical/staging/etc:$XDG_CONFIG_DIRS
56 }

Edit the .bashrc to have this line at the end:

. ~/.unity_bash_functions

Enter the directory staging:

$ cd ~/canonical/staging
$ bzr branch lp:nux
$ bzr branch lp:compiz
$ bzr branch lp:unity

Step 1: Build nux

$ cd ~/canonical/staging
$ export PREFIX=`pwd`
$ cd nux
$ ./autogen.sh --prefix=$PREFIX --enable-debug
$ make && make install

Step 2: Build compiz

$ cd ~/canonical/staging/compiz
$ mkdir -p build
$ cd build
$ cmake .. -DCMAKE_INSTALL_PREFIX=~/canonical/staging/ -DCMAKE_BUILD_TYPE=Debug
$ make && make install

Step 3: Build unity

$ export COMPIZ_CONFIG_PROFILE=ubuntu
$ unity-env
$ remake-unity-compiz-path
$ make && make install

Run:

Switch to the Unity 7 tty press Ctrl+T to open a terminal and type:

$ export COMPIZ_CONFIG_PROFILE=ubuntu
$ unity-env
$ unity --replace ccp&

or

$ unity --compiz-path=~/canonical/staging/bin/compiz --replace ccp&

Done :-)

Note: I use “make -j8” in my script, you might need to change that!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s