This posting describes the steps required to build the Funambol add-on for Mozilla Thunderbird 3 on Ubuntu 10.10 (Maverick Meerkat). It is mostly based on Bas’ Blog entry .
Part I: the prerequisites
- define the buildroot
BASE=”${HOME}/buildenvs/mozbuild.maverick_amd64”
- install required packages
sudo aptitude install mercurial autoconf2.13 colormake libcurl4-gnutls-dev libtool git-svn
- I had problems using a freshly debootstrapped ubuntu maverick (10.10) chroot that was missing the “
staff
“ group, so if it’s missing, add it via “vigr
“… - install build-dependencies
sudo apt-get build-dep thunderbird
Part II-1: building the gecko
NOTE: in theory, this part could be skipped by installing the thunderbird-dev
package from ubuntu instead (see the “Part II-2” section below), but the ubuntu-package is built without the “—enable-calendar
“ flag, and thus it is missing the headers required by funambol…
- check out the comm-central component
cd $BASE hg clone http://hg.mozilla.org/releases/comm-1.9.2/ comm-central cd comm-central python client.py checkout
- create the “
.mozconfig
“ build configuration filemk_add_options MOZ_MAKE_FLAGS=”-j16” ac_add_options —enable-application=mail ac_add_options —enable-extensions=default ac_add_options —enable-calendar ac_add_options —enable-static ac_add_options —disable-debug ac_add_options —disable-shared ac_add_options —disable-tests ac_add_options —disable-installer
- call autoconf & build it
autoconf2.13 colormake -f client.mk
Part II-2: installing thunderbird-dev and fixing it
ATTENTION: this part is NOT working since the ubuntu package is lacking the calendar-related headers that are required by funambol…
sudo aptitude install thunderbird-dev
cd /usr/lib/thunderbird-devel-3.1.4/include/
ls -l nspr nss
sudo ln -fsv /usr/include/nspr/
sudo ln -fsv /usr/include/nss/
ls -l nspr nss
Part III: building the Funambol API
- fetch the sources (username: “
guest
“, empty password)cd $BASE git svn clone https://mozilla-plugin.forge.funambol.org/svn/mozilla-plugin/trunk funambol-mozilla-plugin
- fetch the externals
mkdir svn-externals cd svn-externals git svn clone https://client-sdk.forge.funambol.org/svn/client-sdk/trunk/cpp-sdk funambol-api git svn clone -r 36136:HEAD https://core.forge.funambol.org/svn/core/trunk/tools/cjson git svn clone -r 28009:HEAD https://core.forge.funambol.org/svn/core/trunk/tools/zlib
- create symlinks for externals
cd $BASE/funambol-mozilla-plugin ln -s ../svn-externals/funambol-api mkdir -p funambol-api/tools cd funambol-api/tools ln -s ../../cjson ln -s ../../zlib
- download and unzip the funambol client SDK
cd $BASE wget -c http://sourceforge.net/projects/funambol/files/client-sdk/v9/funambol-client-sdk-9.0.0.zip unzip funambol-client-sdk-9.0.0.zip
- create symlinks to the SDK and the gecko-build
cd $BASE/funambol-mozilla-plugin ln -s ../Funambol/sdk/ ln -s ../comm-central/mozilla/dist/
- call autogen, configure & make
cd $BASE/funambol-mozilla-plugin/funambol-api/build/autotools ./autogen.sh ./configure —disable-shared \ —prefix=$BASE/funambol-mozilla-plugin/sdk/ \ —with-transport-agent=mozilla \ —with-mozilla-sdk-path=$BASE/funambol-mozilla-plugin/dist/ \ —with-pic colormake colormake install
Part IV: build the XPCom thing
- patch the Makefile to include $(FUNAMBOL_API_PATH)/src/include/common in the funambol-includes, see below for diff
cd $BASE/funambol-mozilla-plugin/funambol-mozilla-plugin/syncmlcomponent/build/posix/ patch -p1 < Makefile.diff
- create the output-dir and call make
mkdir $BASE/funambol-mozilla-plugin/funambol-mozilla-plugin/extension/components colormake
—- a/Makefile
+++ b/Makefile
-13,6 13,7
CXX = g+
ROOT_PATH = ../../../..
MOZILLA_SDK_PATH = $(ROOT_PATH)/dist
FUNAMBOL_SDK_PATH = $(ROOT_PATH)/sdk
+FUNAMBOL_API_PATH = $(ROOT_PATH)/funambol-api
CPPUNIT_SDK_PATH = /opt/local
PLUGIN_SDK_PATH = ../../src
UNIT_TEST_SRC_PATH = ../../test
-36,6 +37,7
MOZILLA_INCLUDES = -I $(MOZILLA_SDK_PATH)/include \
FUNAMBOL_INCLUDES = -DENABLE_FUNAMBOL_NAMESPACE \
-I $(FUNAMBOL_SDK_PATH)/include/funambol/common \
+ -I $(FUNAMBOL_API_PATH)/src/include/common \
-I $(FUNAMBOL_SDK_PATH)/include/funambol/posix
PLUGIN_INCLUDES = -I $(PLUGIN_SDK_PATH)/include
Part V: assemble the XPI
- adjust install-linux.rdf for
x86_64
& build itcd $BASE/funambol-mozilla-plugin/funambol-mozilla-plugin/extension/ sed -i ‘s,Linux_x86-gcc3,Linux_x86_64-gcc3,’ install-linux.rdf cd build ./buildLinux.sh
Instead of using “
thunderbird-dev
“, the “lightning-extension
“ source package could be used, you have to run “dpkg-buildpackage
“ once to generate all the headers and a bunch of symlinks have to be set inside the “mozilla/dist/include
“ directory:hmm, unfortunately this fails as well because it still misses a file that is not generated by the “
dpkg-buildpackage
“ process… the error message is: