上一篇说到构建Ubuntu/Ubuntu Kylin桌面的方式,有点太过繁琐(http://www.linuxdiyf.com/linux/20472.html),这次采用脚本方式重新介绍下。
1、创建需要的目录和脚本:
& mkdir -p kylin/staging
将如下脚本保存至: ~/.unity-bash-functions
function recreate-build-dir()
{
rm -r build
mkdir build
cd build
}
function remake-autogen-project()
{
./autogen.sh --prefix=$HOME/kylin/staging --enable-debug
make clean && make -j4 install
}
function remake-unity()
{
recreate-build-dir
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCOMPIZ_PLUGIN_INSTALL_TYPE=local -DCMAKE_INSTALL_PREFIX=$HOME/kylin/staging/ \
-DGSETTINGS_LOCALINSTALL=ON -DCMAKE_SYSCONFDIR=$HOME/kylin/staging/etc \
-DCOMPIZ_COMPOSITE_LIB=/usr/lib/x86_64-linux-gnu/compiz/libcomposite.so \
-DCOMPIZ_OPENGL_LIB=/usr/lib/x86_64-linux-gnu/compiz/libopengl.so \
-DCOMPIZ_LIB=/usr/lib/x86_64-linux-gnu/libcompiz_core.so \
-DCOMPIZ_BUILD_TESTING=OFF \
-DENABLE_UNIT_TESTS=OFF \
-DI18N_SUPPORT=OFF \
-DBOOT_LOGGER=ON \
-DBUILD_SHARED_LIBS=ON
make -j4 install
}
function remake-unity-compiz-path()
{
recreate-build-dir
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCOMPIZ_PLUGIN_INSTALL_TYPE=local -DCMAKE_INSTALL_PREFIX=$HOME/kylin/staging/ \
-DGSETTINGS_LOCALINSTALL=ON -DCMAKE_SYSCONFDIR=$HOME/kylin/staging/etc \
-DCOMPIZ_COMPOSITE_LIB=~/kylin/staging/lib/compiz/libcomposite.so \
-DCOMPIZ_OPENGL_LIB=~/kylin/staging/lib/compiz/libopengl.so \
-DCOMPIZ_LIB=~/kylin/staging/lib/libcompiz_core.so \
-DCOMPIZ_BUILD_TESTING=OFF \
-DENABLE_UNIT_TESTS=OFF \
-DI18N_SUPPORT=OFF \
-DBOOT_LOGGER=ON \
-DBUILD_SHARED_LIBS=ON
}
function unity-env
{
export PATH=~/kylin/staging/bin:$PATH
export XDG_DATA_DIRS=~/.config/compiz-1/gsettings/schemas:~/kylin/staging/share:/usr/share:/usr/local/share
export LD_LIBRARY_PATH=~/kylin/staging/lib:${LD_LIBRARY_PATH}
export LD_RUN_PATH=~/kylin/staging/lib:${LD_RUN_PATH}
export PKG_CONFIG_PATH=~/kylin/staging/lib/pkgconfig:${PKG_CONFIG_PATH}
export PYTHONPATH=~/kylin/staging/lib/python2.7/site-packages:$PYTHONPATH
export GI_TYPELIB_PATH=~/kylin/staging/lib/girepository-1.0:$GI_TYPELIB_PATH
export XDG_CONFIG_DIRS=~/kylin/staging/etc:$XDG_CONFIG_DIRS
}
编辑 .bashrc文件,在末尾加上如下一行(注意一开头有个点,然后有个空格):
. ~/.unity_bash_functions
进入staging目录:
$ cd ~/kylin/staging
下载相应项目:
$ bzr branch lp:nux
$ bzr branch lp:compiz
$ bzr branch lp:unity
2、构建nux:
$ cd ~/kylin/staging
$ export PREFIX=`pwd`
$ cd nux
$ ./autogen.sh --prefix=$PREFIX --enable-debug
$make && make install
3、构建compiz:
$ cd ~/kylin/staging/compiz
$ mkdir -p build
$ cd build
$ cmake .. -DCMAKE_INSTALL_PREFIX=~/kylin/staging/ -DCMAKE_BUILD_TYPE=Debug
$ make && make install
4、构建unity:
$ export COMPIZ_CONFIG_PROFILE=ubuntu
$ unity-env
$ remake-unity-compiz-path
$ make && make install
5、运行:
打开终端,执行:
$ export COMPIZ_CONFIG_PROFILE=ubuntu
& unity-env
$ unity --replace ccp&
或者:
$ unity --compiz-path=~/kylin/staging/bin/compiz --replace ccp&