CVS is no more used and it's replaced by SVN.

Check this for how to compile Evolution from SVN.

Why?

I noted that a lot GNOME bounties involve altering softwares like Evolution. In order to do that, you will need to get that beast compiled first of course. I assume a lot people have been scared away cause of that first task. However, if you know what and how, building it ain't really hard at all. So thats why I've setup this little guide.

So this document is for development purposes. Normal users (who aren't planning to start developing Evolution) shouldn't be reading this. Really. I'm serious about this! You will probably not understand a single thing about this documentation if you don't have a strong Linux-development background!

First!

Stop reading this document, go to this url, and read all of it. Yes all of it. You can skip "Building Evolution". It explains how to build Evolution using jhbuild. Jhbuild is nice but a.t.m. I find the current version of that documentation rather clumbsy. Then return here and continue.

Okay

okay, lets go

Platforms we have tried (feel free to add comments about the same procedures for your platform to this document)

 Fedora Core 3

 Ubuntu Warty and Hoary

 Debian sarge

 Gentoo

Prerequisites

sudo make install magic

For the 'sudo make install'-magic, put the following in your /etc/sudoers file. But don't do this on a system with multiple users or where security is of any importance.

 username   ALL = NOPASSWD:/usr/bin/make

distcc

Recommended if you have multiple hosts. Install ccache and distcc. If you do, add -j# as a parameter to each make-command. A good value for # is the amount of CPU's that will do the job multiplied by two.

 export CC="ccache distcc"
 export DISTCC_HOSTS="host1withdistcc host2withdistcc localhost"

If you copy-paste from this wiki-page, you can use the $CPUS variable for this

 export CPUS="-j6"

Important note: You'll need to rebuild the modules from scratch (redo the configure/autogen.sh steps) you want to switch from using distcc (with optionally ccache) to using a normal C-compiler like gcc. Also note that you need the same version of compiler on each host, or follow the steps about using different compilers (checkout the webpages of distcc for more about this). You can't mix (link them) for example gcc 3.3 object files with gcc 3.2 ones or gcc 3.3 ones with gcc 4.0 ones. It will fail.

on Debian sarge

 apt-get install gnome-core-devel libnss-dev cvs distcc [cvs openssh]

On Fedora

Here are some -devel packages that where not installed on my system. Note that the configure-script of evolution-data-server will not warn you about libgcrypt. But the make step will fail if you don't have -lgcrypt. I already posted a bug about this on Ximians bugzilla. (note that this might be unrelated to evolution-data-server, I have not investigated this tiny issue in depth).

 yum install libsoup-devel libgcrypt-devel [cvs openssh]

On Ubuntu

Simply run the following command(s):

[sudo apt-get install cvs openssh]

 sudo apt-get build-dep evolution

On Gentoo

Simply run one of the following commands :

 emerge -va gnome-light nss cvs

or

 emerge -va gnome nss cvs

With gnome-light you get the only-needed stuff, like gnome-core on other dists. On Gentoo, gnome-core refers to Gnome v1.4. You'd probably save a ton of time doing so, emerging Gnome takes Time! (personally i did emerge gnome, just because i run gnome, but to others who dont, i guess gnome-light is sufficient)

you could also

 emerge gnome-common 

if you dont want to grab it from cvs. Though grabbing it from cvs is recomended. Then you get the most up-to-date version.

Building

Before the actual build takes place

Prepare a build-directory

 mkdir -p ~/cvs/gnome
 cd ~/cvs/gnome

If you don't have a cvs account on gnome (If you hack on Evolution, they will give you one sooner or later)

 export CVSROOT=:pserver:anonymous@anoncvs.gnome.org:/cvs/gnome
 cvs login
 Password: __press enter__

or if you have a CVS account on gnome

 export CVS_RSH=ssh
 export CVSROOT=:ext:username@cvs.gnome.org:/cvs/gnome

Getting the sources

 cvs -z3 co gnome-common gtkhtml gal evolution-data-server evolution

You'll also need the gnome-2-10 branch of the libsoup module

 cvs -z3 co -r gnome-2-10 libsoup

Doing gnome-common

Note that most distributions (like Debian and Ubuntu for sure) have gnome-common available as a package. Often you don't have to overwrite this package for it's version is recent enough. If you still want to utilise the latest version of gnome-common while also having it installed as a package, consider installing it in a prefix other than /usr.

 pushd gnome-common
 ./autogen.sh --prefix=/usr
 make $CPUS
 make install
 popd

Doing gal

(Needed parts of gal has been merged into the Evolution tree so this should not be needed)

 pushd gal
 ./autogen.sh --prefix=/opt/evo/
 make $CPUS
 sudo make install
 popd

Doing libsoup

 pushd libsoup
 PKG_CONFIG_PATH=/opt/evo/lib/pkgconfig/ ./autogen.sh --prefix=/opt/evo/
 make $CPUS
 sudo make install
 popd

Doing gtkhtml

 pushd gtkhtml
 PKG_CONFIG_PATH=/opt/evo/lib/pkgconfig/ ./autogen.sh --prefix=/opt/evo/
 make $CPUS
 sudo make install
 popd

Doing evolution-data-server

 pushd evolution-data-server

Fedora Core 3 & Ubuntu

 PKG_CONFIG_PATH=/opt/evo/lib/pkgconfig/ ./autogen.sh --prefix=/opt/evo/

Debian sarge (this or install libnss and use the above method)

 PKG_CONFIG_PATH=/opt/evo/lib/pkgconfig/ ./autogen.sh --prefix=/opt/evo/ \
 --with-nspr-includes=/usr/include/mozilla/nspr/

Then:

 make $CPUS
 sudo make install
 popd

Having problems with a missing calendar/libical directory?

For some reason this directory didn't automatically get checked by with the previous commands for me. To solve this execute the following commands from the top of your e-d-s build tree

 cd calendar
 cvs co libical

Doing evolution

 pushd evolution
 PKG_CONFIG_PATH=/opt/evo/lib/pkgconfig/ ./autogen.sh --prefix=/opt/evo/ \
 --with-openldap=yes \
 --enable-nntp=yes --enable-ipv6=yes --enable-test-component=yes \
 --enable-nss=yes --enable-smime=yes --enable-plugins=all
 make $CPUS
 sudo make install
 popd

You're done

Optionally: Doing evolution-exchange

 pushd evolution-exchange
 PKG_CONFIG_PATH=/opt/evo/lib/pkgconfig/ ./autogen.sh --prefix=/opt/evo/ 
 make $CPUS
 sudo make install
 popd

Update bonobo-activation-config.xml

Search for the file bonobo-activation-config.xml. Usually it's installed at /etc/bonobo-activation/bonobo-activation-config.xml. You'll need to add the location where your evolution-data-server binary is installed.

 <?xml version="1.0"?>
 <oafconfig>
   <searchpath>
        < ! - - Don't remove existing items - - >
        <item>/opt/evo/lib/bonobo/servers/</item>
   </searchpath>
 </oafconfig>

Create a small wrapper-script

Copy it to, for example, /usr/local/bin/evolution-cvs or in /opt/evo/bin and put that path in your PATH environment variable.

You'll need GNU versions of tools like ps, pidof, bash or a sh that will do these scripts correctly, gdb, ddd, grep and cut. To use these scripts, it's important that you've succesfully build evolution from source. Also note that I did hardcoded some source-code filelocations in the scripts. For example $HOME/cvs/gnome/evolution/evolution-plugin.pc. If your checkout from cvs is differently located, you'll need to adjust these paths in all scripts you'll find here.

 #! /bin/sh
 prefix=`grep "^prefix=" $HOME/cvs/gnome/evolution/evolution-plugin.pc | cut -d "=" -f 2`
 version=`grep "BASE_VERSION=" $HOME/cvs/gnome/evolution/configure.in | cut -d "=" -f 2`
 
 function strstr () {
    [ ${#2} -eq 0 ] && { echo "$1" ; return 0; }
    case "$1" in
    *$2*) ;;
    *) return 1;;
    esac
    first=${1/$2*/}
    echo "${1##$first}"
 }
  
 substr=`strstr "$prefix/lib/bonobo/servers" $BONOBO_ACTIVATION_PATH`
 if test x"$substr" != x"$prefix/lib/bonobo/servers"
 then
        killall -9 bonobo-activation-server
        # in case the file bonobo-activation-config.xml is incorrect
        export BONOBO_ACTIVATION_PATH=$prefix/lib/bonobo/servers:$BONOBO_ACTIVATION_PATH
 fi
 
 substr=`strstr "$prefix/lib" $LD_LIBRARY_PATH`
 if test x"$substr" != x"$prefix/lib"
 then
         export LD_LIBRARY_PATH=$prefix/lib:/usr/lib/evolution/$version/:/usr/lib/mozilla-firefox/:$LD_LIBRARY_PATH
 fi
 substr=`strstr "$prefix/bin/:$prefix/libexec/" $PATH`
 if test x"$substr" != x"$prefixbin/:$prefix/libexec/"
 then
        export PATH=$prefix/bin/:$prefix/libexec/:$PATH
 fi
 
 $prefix/bin/evolution-$version $1 $2 $3 $4 $5

ps. You can download it here.

Upgrading

When upgrading your build I'm assuming you want to get the very latest version thats available in CVS. Beware that it WILL be fscking unstable. But then again, real developers like it unstable for then they can fix those bugs. Right? No?

The rule of thumb is that if new files are added and/or if configure.in or configure.ac is modified, you'll probably need to make distclean the module and start building it from scratch. But it highly depends. An experienced GNOME programmer knows when there's a need to recompile a module from scatch.

 cd ~/cvs/gnome/

ps. You can download a script that contains all thats below here.

It will update your sources using cvs and check for errors during the building. If an error happens, it will retry by reconfiguring the build-environment (configure/autogen.sh steps).

Upgrading gal

Upgrading gal is hardly ever needed

  pushd gal
  cvs update -d
  make $CPUS && sudo make install || (make distclean; ./autogen.sh --prefix=/opt/evo/; make $CPUS && sudo make install)
  popd

Upgrading libsoup

Upgrading libsoup is harmly ever needed

  pushd libsoup
  cvs update -d
  make $CPUS && sudo make install || (make distclean; PKG_CONFIG_PATH=/opt/evo/lib/pkgconfig/ ./autogen.sh --prefix=/opt/evo/; make $CPUS && sudo make install)
  popd

Upgrading gtkhtml

Upgrading gtkhtml is sometimes interesting. Not always. And updating it might make your Evolution look very unstable. Often it's a simple bug in gtkhtml.

  pushd gtkhtml
  cvs update -d
  make $CPUS && sudo make install || (make distclean; PKG_CONFIG_PATH=/opt/evo/lib/pkgconfig/ ./autogen.sh --prefix=/opt/evo/; make $CPUS && sudo make install)
  popd

Upgrading evolution-data-server

You want to check for upgrades on evolution-data-server each time you're going to upgrade. As time moves on, lots of the functionality is actually implemented in evolution-data-server and simply being called by evolution using ORBit-2. Most of the times it's functionality that happens in the background or non userinterface related functionality. But there are plans to put some userinterface related things in e-d-s.

The desktop-integration efforts of the last few years caused that a few applications are also using e-d-s. Examples are recent versions of gnomemeeting and the panelapplet Clock. Note that if you make your e-d-s unstable, by installing a bleeding edge CVS version, you're also making other parts of your desktop unstable. But then again, and I repeat myself, thats the way developers like it!

  pushd evolution-data-server
  cvs update -d
  make $CPUS && sudo make install || (make distclean; PKG_CONFIG_PATH=/opt/evo/lib/pkgconfig/ ./autogen.sh --prefix=/opt/evo/; make $CPUS && sudo make install)
  popd

Upgrade evolution

Since you're going to Upgrade, I'm guessing you want to upgrade evolution itself.

  pushd evolution
  cvs update -d
  make $CPUS && sudo make install || (make distclean; PKG_CONFIG_PATH=/opt/evo/lib/pkgconfig/ \
  ./autogen.sh --prefix=/opt/evo/ --with-openldap=yes \
  --enable-nntp=yes --enable-ipv6=yes --enable-test-component=yes \
  --enable-nss=yes --enable-smime=yes --enable-plugins=all; make $CPUS && sudo make install)
  popd

Optionally: Upgrade evolution-exchange

  pushd evolution-exchange
  cvs update -d
  make $CPUS && sudo make install || (make distclean; PKG_CONFIG_PATH=/opt/evo/lib/pkgconfig/ \
  ./autogen.sh --prefix=/opt/evo/; make $CPUS && sudo make install)
  popd

Running

Normal operation

 evolution-cvs

Debugging

I use these two scripts to attach debuggers to running evolution and evolution-data-server processes.

Debugging a running Evolution process

Copy it to, for example, /usr/local/bin/debug-evolution or in /opt/evo/bin and put that path in your PATH environment variable.

 #! /bin/sh
 
 #debugger=ddd
 debugger=gdb
 
 prefix=`grep "^prefix=" $HOME/cvs/gnome/evolution/evolution-plugin.pc | cut -d "=" -f 2`
 version=`grep "BASE_VERSION=" $HOME/cvs/gnome/evolution/configure.in | cut -d "=" -f 2`
 
 if pidof evolution-$version>/dev/null
 then
     $debugger $prefix/bin/evolution-$version `ps --no-headers -o pid -C evolution-$version`
 else
     $debugger $prefix/bin/evolution-$version
 fi

ps. You can download it here.

Debugging a running evolution-data-server process

Copy it to, for example, /usr/local/bin/debug-evolution-data-server or in /opt/evo/bin and put that path in your PATH environment variable.

 #! /bin/sh
 
 #debugger=ddd
 debugger=gdb
 
 prefix=`grep "^prefix=" $HOME/cvs/gnome/evolution/evolution-plugin.pc | cut -d "=" -f 2`
 version=`grep "EDS_PACKAGE=" $HOME/cvs/gnome/evolution/configure.in | cut -d "=" -f 2`
 
 if pidof evolution-data-server-$version>/dev/null
 then
    $debugger $prefix/libexec/evolution-data-server-$version `ps --no-headers -o pid -C evolution-data-server-$version`
 else
    $debugger $prefix/libexec/evolution-data-server-$version
 fi

ps. You can download it here.

Create launchers on your panel

I probably don't have to explain how to do this. Nevertheless it's a great idea to force yourself to actually sometimes do a debugging session when that fscking Evolution from cvs is crashing and being very unstable.

 ~/.gnome2/panel2.d/default/launchers $ cat moe-005712dd25.desktop
 [Desktop Entry]
 Encoding=UTF-8
 Version=1.0
 Type=Application
 Exec=gnome-terminal -x debug-evolution
 TryExec=
 Icon=gnome-spider.png
 X-GNOME-DocPath=
 Terminal=false
 Name=Debug evolution
 GenericName=Debug evolution
 Comment=Debug evolution
 ~/.gnome2/panel2.d/default/launchers $

After starting the debugging session

gdb

If you've set the debugger-variable in the scripts to gdb, you'll have to type "cont" on the prompt in the new terminal. You can press CTRL+C at any time to interrupt the process you're debugging. Once interrupted you can set new breakpoints using "break functionname". You might want to teach yourself how to use gdb from the commandline.

ddd

A graphical userinterface for gdb is ddd. Ddd will show you the sourcecode and you can in the text-viewer set breakpoints and study whats currently in the stack in a graphically fasion.

Others

There's other debuggers that can be used. A very good example, when you're seeking memory problems and memory-leaks, is valgrind.

Making it your default E-mail client

 gconftool-2 --set --type string /desktop/gnome/url-handlers/mailto/command "evolution-cvs %s"

Apps/Evolution/Compiling_Evolution_from_CVS (last edited 2013-08-08 22:50:11 by WilliamJonMcCann)