Chinaunix首页 | 论坛 | 博客
  • 博客访问: 115948
  • 博文数量: 32
  • 博客积分: 2067
  • 博客等级: 大尉
  • 技术积分: 383
  • 用 户 组: 普通用户
  • 注册时间: 2009-05-08 07:47
文章分类

全部博文(32)

文章存档

2011年(1)

2010年(14)

2009年(17)

我的朋友

分类: LINUX

2010-02-06 21:41:45

thunderbird也许并不是最好的邮件客户端(我更倾向于mutt),但它是我心中最好的GUI邮件客户端.
debian上的icedove比较老了,目前从stable到unstable都是2.0,而mozilla早已推出3.0了

3.1b1同样方法成功

编译的大致过程和上一篇<debian下编译firefox-3.6>大致相同
参考:



重要工具版本
gcc 4.4.3
perl 5.10
make 3.81
GTK+ 2.18.6
xorg 7.5

thunderbird

在此下载源码包:
sudo aptitude build-dep icedove
sudo apt-get install libdbus-glib-1-dev libnotify-dev libasound2-dev libsqlite3-dev libidl-dev libiw-dev xorg-dev

wget
另外需要一个补丁():

# cat > thunderbird3.0-and-ligtning1.0b1-directfb.patch << EOF
diff -Naur comm-1.9.1/mozilla/gfx/thebes/src/gfxASurface.cpp comm-1.9.1aa/mozilla/gfx/thebes/src/gfxASurface.cpp
--- comm-1.9.1/mozilla/gfx/thebes/src/gfxASurface.cpp 2009-12-05 09:57:14.000000000 +0800
+++ comm-1.9.1aa/mozilla/gfx/thebes/src/gfxASurface.cpp    2010-02-06 21:17:01.134172921 +0800
@@ -46,7 +46,7 @@
 #include "gfxWindowsSurface.h"
 #endif
 
-#ifdef CAIRO_HAS_XLIB_SURFACE
+#ifdef MOZ_X11
 #include "gfxXlibSurface.h"
 #endif
 
@@ -55,7 +55,7 @@
 #include "gfxQuartzImageSurface.h"
 #endif
 
-#ifdef CAIRO_HAS_DIRECTFB_SURFACE
+#ifdef MOZ_DFB
 #include "gfxDirectFBSurface.h"
 #endif
 
@@ -158,7 +158,7 @@
         result = new gfxWindowsSurface(csurf);
     }
 #endif
-#ifdef CAIRO_HAS_XLIB_SURFACE
+#ifdef MOZ_X11
     else if (stype == CAIRO_SURFACE_TYPE_XLIB) {
         result = new gfxXlibSurface(csurf);
     }
@@ -171,7 +171,7 @@
         result = new gfxQuartzImageSurface(csurf);
     }
 #endif
-#ifdef CAIRO_HAS_DIRECTFB_SURFACE
+#ifdef MOZ_DFB
     else if (stype == CAIRO_SURFACE_TYPE_DIRECTFB) {
         result = new gfxDirectFBSurface(csurf);
     }
EOF

tar xvf thunderbird-3.0.source.tar.bz2
cd comm-1.9.1

加上几个优化参数:
export CFLAGS="-O2 -march=native -pipe -fomit-frame-pointer" &&
CXXFLAGS=$CFLAGS

-march=native或者指定architecture,需要根据 自己的机器,我的是core2,参考


打patch
patch -Np1 -i ../thunderbird3.0-and-ligtning1.0b1-directfb.patch

同firefox一样,先写.mozconfig(--enable-static必须要,否则安装时会出错)

ac_add_options --enable-application=mail
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-@CONFIG_GUESS@
ac_add_options --prefix=/opt/thunderbird-3.0
ac_cv_visibility_pragma=no
ac_add_options --with-nspr-prefix=/usr
ac_add_options --with-nss-prefix=/usr
ac_add_options --with-system-nspr
ac_add_options --with-system-nss
ac_add_options --with-system-bz2
ac_add_options --with-system-jpeg
ac_add_options --with-system-zlib
ac_add_options --disable-debug
ac_add_options --disable-installer
ac_add_options --disable-xprint
ac_add_options --disable-tests
ac_add_options --disable-crashreporter
ac_add_options --disable-mochitest
ac_add_options --disable-updater
ac_add_options --enable-optimize
ac_add_options --enable-canvas
ac_add_options --enable-static
ac_add_options --enable-default-toolkit=cairo-gtk2
ac_add_options --enable-safe-browsing
ac_add_options --enable-svg
ac_add_options --enable-system-cairo
ac_add_options --enable-system-sqlite
ac_add_options --enable-official-branding
ac_add_options --enable-strip
ac_add_options --enable-pango
ac_add_options --disable-javaxpcom
export BUILD_OFFICIAL=1
export MOZILLA_OFFICIAL=1
mk_add_options BUILD_OFFICIAL=1
mk_add_options MOZILLA_OFFICIAL=1

编译之:
make -f client.mk build
编译中间可能会出错:
/usr/bin/ld: cannot find -lsoftokn3
解决办法(比较土):
注意到在报错那一行前,提供了编译链接的目录和参数,所以只要进入该目录,去掉其中的-lsoftokn3参数(i386上的目录不是这个)
用pushd..popd来切换目录,去掉-lsoftokn3参数:

pushd obj-x86_64-unknown-linux-gnu/directory/c-sdk/ldap/libraries/libssldap
gcc -shared -Wl,-soname -Wl,libssldap60.so     -o libssldap60.so ./clientinit.o ./ldapsinit.o ./errormap.o  -L/home/stesen/downloads/comm-1.9.1-1/obj-x86_64-unknown-linux-gnu/mozilla/dist/lib -lldap60 -lprldap60 -L/usr/lib -lssl3 -lsmime3 -lnss3 -lnssutil3 -lssl3 -lnss3  -L/usr/lib -lplds4 -lplc4 -lnspr4 -lpthread -ldl -lplc4 -lplds4 -lnspr4
popd

会成功生成一个.so动态库,接下来继续刚才的编译:
make -f client.mk build
不出意外的话(不得不说thunderbird编译时的意外太多了),就会编译成功了,安装之:
sudo make -f client.mk install

安装的可执行文件/opt/thunderbird-3.0/lib/thunderbird-3.0/thunderbird
sudo ln -sv /opt/thunderbird-3.0/lib/thunderbird-3.0/thunderbird /usr/local/bin/

thunderbird使用的个人配置文件目录在~/.thunderbird,而icedove的在~/.mozilla-thunderbird
直接移过去就行了:
mv ~/.mozilla-thunderbird ~/.thunderbird

本想继续中的"猥琐时间",然而不幸的是icedove的icon貌似难看了点

thunderbird有个
的安全插件,推荐安装,按照cblfs的作风,这个xpi文件也要自己编译,我个人觉得没必要,直接下载编译好的就行了,自己编译的话,到处是error,步履维艰,比编译thunderbird还麻烦,我放弃了
http://enigmail.mozdev.org/download/index.php
我是64位的:
wget
thunderbird里面导入它就行了

lightning插件
下载:
wget
解压,进入comm-1.9.1目录,打上同样的patch:
patch -Np1 -i ../thunderbird3.0-and-ligtning1.0b1-directfb.patch

写.mozconfig:

mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-@CONFIG_GUESS@
ac_add_options --prefix=/opt/lightning
ac_cv_visibility_pragma=no
ac_add_options --enable-application=mail
ac_add_options --enable-calendar
ac_add_options --with-default-mozilla-five-home=$MOZILLA_FIVE_HOME
ac_add_options --with-system-nss
ac_add_options --with-system-nspr
ac_add_options --with-system-jpeg
ac_add_options --with-system-zlib
mk_add_options BUILD_OFFICIAL=1
mk_add_options MOZILLA_OFFICIAL=1
mk_add_options MOZ_CO_PROJECT=mail
ac_add_options --with-nspr-prefix=/usr
ac_add_options --with-nss-prefix=/usr
ac_add_options --with-system-nspr
ac_add_options --with-system-nss
ac_add_options --with-system-bz2
ac_add_options --with-system-jpeg
ac_add_options --with-system-zlib
ac_add_options --with-pthreads
ac_add_options --with-system-bz2
ac_add_options --enable-system-cairo
ac_add_options --with-system-hunspell
ac_add_options --with-system-sqlite
ac_add_options --disable-debug
ac_add_options --disable-installer
ac_add_options --disable-xprint
ac_add_options --disable-tests
ac_add_options --disable-crashreporter
ac_add_options --disable-mochitest
ac_add_options --disable-updater
ac_add_options --disable-xprint
ac_add_options --disable-gtktest
ac_add_options --disable-javaxpcom
ac_add_options --enable-optimize
ac_add_options --enable-pango
ac_add_options --enable-canvas
ac_add_options --enable-default-toolkit=cairo-gtk2
ac_add_options --enable-safe-browsing
ac_add_options --enable-svg
ac_add_options --enable-system-cairo
ac_add_options --enable-system-sqlite
ac_add_options --enable-strip
ac_add_options --enable-official-branding
ac_add_options --enable-startup-notification
ac_add_options --enable-places

然后编译
make -f client.mk
同上面一样,编译会出现/usr/bin/ld: cannot find -lsoftokn3错误
用pushd..popd来切换目录,去掉-lsoftokn3参数:

pushd /home/stesen/downloads/comm-1.9.1/obj-x86_64-unknown-linux-gnu/directory/c-sdk/ldap/libraries/libssldap
gcc -shared -Wl,-soname -Wl,libssldap60.so     -o libssldap60.so ./clientinit.o ./ldapsinit.o ./errormap.o  -L/home/stesen/downloads/comm-1.9.1/obj-x86_64-unknown-linux-gnu/mozilla/dist/lib -lldap60 -lprldap60 -L/usr/lib -lssl3 -lsmime3 -lnss3 -lnssutil3 -lssl3 -lnss3  -L/usr/lib -lplds4 -lplc4 -lnspr4 -lpthread -ldl -lplc4 -lplds4 -lnspr4
popd

然后继续make -f client.mk

最后在生成的插件为:
./obj-x86_64-unknown-linux-gnu/mozilla/dist/xpi-stage/lightning.xpi
找不到的话就用find来定位那个xpi文件:
find ./ |grep "lightning"

然后打开thnderbird的add-one拖进去就行了
阅读(1290) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~