LinuxDeepin下一个版本的桌面环境会选择 Gnome3,大家可以用下面的办法提前在 LD 11.06 中体验 Gnome-Shell.
因为现有 PPA 的方法会导致用户进不了桌面, 所以我们用编译的开发版本的方法, 编译的方法的好处就是即使编译失败, 也不会破坏现有的桌面环境。
1. 安装编译依赖:
sudo apt-get install curl libtiff4-dev libgstreamer0.10-dev libcroco3-dev xulrunner-dev mesa-utils
mesa-common-dev libreadline5-dev libgl1-mesa-dev libwnck-dev librsvg2-dev libgnome-desktop-dev
libgnome-menu-dev libffi-dev libgtk2.0-dev libgconf2-dev libdbus-glib-1-dev gtk-doc-tools
gnome-common git-core flex bison automake build-essential icon-naming-utils autopoint libvorbis-dev
libpam-dev libgcrypt-dev libtasn1-dev libtasn1-3-bin libgnome-keyring-dev libupower-glib-dev
libxklavier16 libxklavier-dev xserver-xephyr python-dev libpulse-dev libjasper-dev jhbuild
libgtop2-dev libsqlite3-dev libproxy-dev libdb-dev libproxy-dev libcups2-dev libusb-1.0-0-dev
libxcb-aux0-dev libxcb-event1-dev libx11-xcb-dev liboauth-dev libwebkitgtk-3.0-dev libical-dev gperf
libgudev-1.0-dev hwdata liborbit2-dev libgtk-3-dev libidn11-dev libsane-dev liblircclient-dev
libltdl-dev libvorbisfile3 libgail-3-dev libnotify4-dev libgnome-desktop-3-dev -y
2. 添加路径到 ~/.bashrc
把下面的行加入到 ~/.bashrc 最后面:
PATH=$PATH:~/bin
PATH=$PATH:~/gnome-shell/install/bin
3.下载/执行 Gnome-Shell 构建脚本:
wget http://git.gnome.org/browse/gnome-shell/plain/tools/build/gnome-shell-build-setup.sh
chmod +x gnome-shell-build-setup.sh
./gnome-shell-build-setup.sh
4. 构建 Gnome-Shell (更新代码也是同样的命令):
sudo find /usr/lib{,32,64} -name "*.la" -delete (这一步非常重要, 否则 libgtk3 会报错)
sudo jhbuild build
5. 安装 Nautilus 3:
先下载三个包:
wget http://launchpad.net/gnome-desktop/main/3.1.3/+download/gnome-desktop-3.1.3.tar.bz2
wget http://launchpad.net/nautilus/main/3.0.2/+download/nautilus_3.0.2.orig.tar.gz
用下面的命令依次对这三个包进行编译:
./configure && make && sudo make install
6. 开机自动启动 Gnome-Shell
touch ~/.xinitrc
chmod +x ~/.xinitrc
ln -s ~/.xinitrc ~/.xsession
gedit ~/.xinitrc
在 ~/.xinitrc 中加入下面的命令:
gnome-session &
ibus-daemon -x -r -d &
gnome-shell --replace
注销, 在登录画面下面第三个选项框选择 "User Defined Session" 进行登录即可
7. 编译出错解决方案:
编译的时候有可能出错, 下面对常见的出错提供解决方案:
1) 一般网络错误, 导致 git 操作失败, 可以选择 6 (出错会有一个选择操作)进行重新下载编译
2) 缺少某个包, 一般在错误的最后几行, 你会看到提示找不到某个包 foo, 可以搜索一下, 一般都是 libfoo-dev 包, 然后用 sudo apt-get install libfoo-dev 安装包后再选择 6 重新编译即可
3) 第36个模块 colord 编译错误(因为上游开发人员的失误):
如果你在编译 colord 的时候遇到下面的错误:
checking whether to build shared libraries... yes
checking whether to build static libraries... no
./configure: line 10692: syntax error near unexpected token `0.9.8'
./configure: line 10692: `GOBJECT_INTROSPECTION_CHECK(0.9.8)'
Error during phase configure of colord: ########## Error running ./autogen.sh --prefix /home/andy/gnome-shell/install --libdir '/home/andy/gnome-shell/install/lib64' --disable-examples --disable-static --disable-gtk-doc *** [36/46]
可以用这个解决方案解决:
wget http://launchpadlibrarian.net/74359148/liblcms2-2_2.2%2Bgit20110628-1_amd64.deb
wget http://launchpadlibrarian.net/74359147/liblcms2-dev_2.2%2Bgit20110628-1_amd64.deb
wget http://launchpadlibrarian.net/74359150/liblcms2-utils_2.2%2Bgit20110628-1_amd64.deb
sudo dpkg -i liblcms2-2_2.2+git20110628-1_amd64.deb
sudo dpkg -i liblcms2-dev_2.2+git20110628-1_amd64.deb
sudo dpkg -i liblcms2-utils_2.2+git20110628-1_amd64.deb
cd ~/gnome-shell/source/colord
git clean -fdx
cp ~/gnome-shell/source/clutter/build/autotools/introspection.m4 ~/gnome-shell/source/colord/m4/
jhbuild run ./autogen.sh
jhbuild run ./configure --disable-introspection
jhbuild run make
4) 错误 “/home/andy/gnome-shell/install/lib64/libgtk-3.so: undefined reference to `pango_layout_get_log_attrs_readonly' “
如果遇到这个错误的同学一般都没有听我的话执行命令: “sudo find /usr/lib{,32,64} -name "*.la" -delete”
如果遇到这个错误可以用下面的方案解决:
sudo find /usr/lib{,32,64} -name "*.la" -delete
rm -rf ~/gnome-shell/install/
sudo jhbuild build
好了, 这就是所有关于 Gnome-Shell 编译的方案, 当然所有基于 Debian 的发行版本都可以用这个方案, 非 Debian 的发行版本可以用相应的命令替换 apt 应该也可以编译成功。
最后上张截图吧:

来自:lazycat.manatee
20 Responses to LinuxDeepin11.06 中编译 Gnome-Shell
Aenon
七月 11th, 2011 at 4:56 下午
话说这个在 Ubuntu 11.04 中行不行?和 Unity 冲突否?
[Reply]
kevin
七月 11th, 2011 at 5:48 下午
问下本站是建在photovps上吗?怎么看很多评论都说pv很垃圾啊
不知道站长买的是哪款方案?有特别吗?
希望详细回答
freebsd7.2?
谢谢
[Reply]
Aenon Reply:
七月 11th, 2011 at 11:48 下午
@kevin, 在文章评论下头乱发这种问题?
[Reply]
ljm779
七月 11th, 2011 at 6:33 下午
“所有基于 Debian 的发行版本都可以用这个方案”,Debian也是可以的咯?
[Reply]
riku
七月 11th, 2011 at 9:37 下午
@kevin, 我用的是 Warp 1方案,从我使用一年多的感受来看,pv 的性价比还是蛮高的,而且也挺稳定,用的是 Freebsd8.2。
[Reply]
MKB
七月 12th, 2011 at 9:48 下午
Ubuntu 11.04 编译卡在了第17项目“libgdata”上,说是缺少“libxml”什么的,不知到如何解决?
[Reply]
freetstar Reply:
七月 12th, 2011 at 9:55 下午
@MKB, 安装必要的xml开发文件即可
suod apt-get install libxml-dev
[Reply]
MKB Reply:
七月 13th, 2011 at 7:56 下午
@freetstar,
Ubuntu 11.04 竟然“未发现软件包 libxml-dev”
[Reply]
freetstar Reply:
七月 13th, 2011 at 8:55 下午
@MKB, apt-cache search xml
[Reply]
yetone Reply:
七月 26th, 2011 at 2:08 上午
@MKB, sudo ln -s /usr/include/libxml2/libxml /usr/include/libxml
[Reply]
ivarptr
七月 13th, 2011 at 4:18 下午
Gnome3.1发布时我编译过(环境Fedora15),记得:
第1,2步是可以免去的,因为在第3步的 gnome-shell-build-setup.sh 脚本会自动完成这些依赖包和PATH设置。
第4步的第二小步:sudo jhbuild build,这个不用sudo,使用普通用户权限运行即可。因为使用jhbuild编译的是一个沙盘gnome,它不需要更改系统的设置。
第6步要三思,使用下面两条命令在需要时再运行沙盘中的gnome比较稳妥:
jhbuild shell
gnome-shell --replace
[Reply]
ivarptr Reply:
七月 13th, 2011 at 4:28 下午
@ivarptr, 不知道有没记错,要编译的同学先以文章的方法为准。
[Reply]
GPL风
七月 20th, 2011 at 6:37 下午
编译失败,到第36个模块是,用了n多方法怎么都编译不下去
[Reply]
yetone
七月 26th, 2011 at 2:09 上午
sudo ln -s /usr/include/libxml2/libxml /usr/include/libxml
[Reply]
lk
八月 7th, 2011 at 6:13 下午
Error during phase build of libgdata: ########## Error running make *** [17/45]
请问这是哪里错误啊,
[1] Rerun phase build
[2] Ignore error and continue to install
[3] Give up on module
[4] Start shell
[5] Reload configuration
[6] Go to phase "wipe directory and start over"
[7] Go to phase "configure"
[8] Go to phase "clean"
[9] Go to phase "distclean"
这是可选处理方法
还有,请问ubuntu 11.04任务栏阴隐怎么删除
[Reply]
MKB Reply:
八月 8th, 2011 at 9:02 下午
@lk, 我也遇到同样的问题了,之前没有的,但是后来再次编译的时候就出现这个问题,不知到如何解决?
[Reply]
freetstar Reply:
八月 8th, 2011 at 10:16 下午
@MKB, @lk 两位同学,建议移步到LinuxDeepin的官方论坛求助,或者maiilist
[Reply]
MKB Reply:
八月 12th, 2011 at 8:08 下午
@freetstar, 可惜我是用Ubuntu的。
[Reply]
lk
八月 7th, 2011 at 6:14 下午
为什么 我用的 linuxdeepin 11.06 和 chromium 12 会显示 xp
和ie6 "_"
[Reply]
MKB
八月 12th, 2011 at 10:07 下午
Error during phase build of libgdata: ########## Error running make *** [17/45]这个问题,除了需要“sudo ln -s /usr/include/libxml2/libxml /usr/include/libxml“,还需要”sudo ln -s /usr/include/libsoup-2.4/libsoup /usr/include/libsoup“
[Reply]