Re: Development /w Evolution Conduits

Hi David,

On Fri, 2008-08-01 at 16:11 -0700, David Wade Hagar wrote:
> I would love to help out with the development of the Evolution conduits.
> I'm not the best programmer, but I'll throw down with trying to get it
> to work.

great stuff.  I'm attaching a Makefile that I've recently started using
to compile evolution and gnome-pilot from source.  I've only made a few
edits from a version I downloaded from here:

This makes it easy to check out the current svn versions of evolution
and gnome-pilot and get it all built with debugging.

> I've noticed that its already a known issue about the address book
> fields, but additionally, there is lack of support in the calendar for
> the Location field.
> Also, categories in contacts don't sync either.

This is all, sadly, true. Also, there's no support for birthdays,
photos, etc, in Contacts.

I started taking a look at the problem with the field corruption in the
addressbook.  I found that a conversion between ical format and back
again seemed to be losing data, but I didn't have time to get to the
bottom of it (and my gdb seemed to be having some problems with my
built-from-source build).

I suggest you dive in, start familiarising yourself with the code (maybe
look at the Location field as an initial exercise?) and stay in touch.



Matt Davey        	What the world needs is more good readers,
mcdavey mrao cam ac uk 		not more good writers. -- Borges.	
#!/usr/bin/make -f
# Build (debuggable) Evo from SVN
# Run "make help" for some help, or see the comments below.
# Requires GNU make 3.80 or better.
# Author: 	Paul Smith <psmith gnu org>
# Version:	2.12
# Date:		29 May 2008
# --------------------------------------------------
# Copyright (C) 2007, 2008 Paul Smith
# This Makefile is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option)
# any later version.
# You should have a copy of the GNU General Public License on your system.
# If not, see <>.
# --------------------------------------------------
# You can look here for more/alternate information:
# Enhancements/suggestions provided by:
#   Patrick Ohly <patrick ohly gmx de>

# ======================================================================

# By default we build for Ubuntu (I'm testing on Ubuntu 8.04).
# If you want to build for another distro, see if it's listed in the DISTROS
# variable (currently only Debian & Ubuntu releases are listed) and, if so,
# change "DISTRO" to your distro.  You can do this in to avoid
# changing this makefile.
# If your distro is not supported, you can set "distro" to empty and the check
# for prerequisite packages will be skipped.  Of course, if you don't have all
# the proper development packages installed the build will fail.

# ======================================================================
# vvvvvvvvvvvvvvvvvvvvvvvvv User Customization vvvvvvvvvvvvvvvvvvvvvvvvv

# Feel free to change these if you like

# What branch to work with.  If not set, we use the trunk.  Close to a
# release, however, you might prefer to use the pending release.
# E.g.:
#   BRANCH := 2.20

# Where to install Evo.  DO NOT use /usr here for any system controlled by a
# package manager (rpm, dpkg)
PREFIX :=	/opt/evo

# Where to build objects.  Currently not all packages work properly outside of
# their own directories, even though the GNU coding standards require it.
OBJDIR :=	obj
#OBJDIR :=	.

# What distro you use, for checking that all prerequisite packages for a
# successful build are installed.  The currently supported distros are
# listed in the DISTROS variable below.
# If yours is not one of these, set this to empty and take your chances!
DISTRO :=	hardy

# Comment this out if you don't want to use ccache
CCACHE :=	ccache

# Set this to empty if you want to see the rules being run
V :=		@

# Enable/disable optional packages

ENABLE_gtkhtml :=	y
ENABLE_exchange :=	y
ENABLE_webcal :=	y
ENABLE_gnome-pilot :=	y

# You can override the above by creating setting these vars
# if you don't want to modify this makefile.


# ^^^^^^^^^^^^^^^^^^^^^^^^^ User Customization ^^^^^^^^^^^^^^^^^^^^^^^^^
# ======================================================================

# ----- << You don't need to touch anything below here!! >> -----
# ----- << (unless you really know what you're doing...) >> -----

# These are the prerequisite packages needed on the system before we can build
# Evo.  There are different ways to check for them, based on distro.

DISTROS :=	feisty gutsy hardy etch

feisty-PREREQS := \
		gtk-doc-tools subversion flex bison build-essential \
		libldap2-dev libnss-dev libnspr-dev libgail-dev evolution-dev \
		icon-naming-utils $(CCACHE)

gutsy-PREREQS := \
		gtk-doc-tools subversion flex bison build-essential \
		libssl-dev libldap2-dev libnss3-dev libnspr4-dev libgail-dev \
		evolution-dev icon-naming-utils libdbus-glib-1-dev \

hardy-PREREQS := \
		gtk-doc-tools subversion flex bison build-essential \
		libldap2-dev libnss3-dev libsoup2.4-dev libenchant-dev \
		gnome-common evolution-dev \

etch-PREREQS := \
		gtk-doc-tools subversion flex bison build-essential \
		libssl-dev libldap2-dev libnss3-dev libnspr4-dev \
		libgail-dev evolution-dev icon-naming-utils gnome-doc-utils \

# These are the packages we need to build from SVN, and any config/make/etc.
# customized options we need to provide.

PACKAGE_gtkhtml-y	:= gtkhtml
PACKAGE_exchange-y	:= evolution-exchange
PACKAGE_webcal-y	:= evolution-webcal
PACKAGE_gnome-pilot-y	:= gnome-pilot

# glib libsoup libbonobo
		$(PACKAGE_gtkhtml-$(ENABLE_gtkhtml)) \
		$(PACKAGE_gnome-pilot-$(ENABLE_gnome-pilot)) \
		evolution-data-server evolution \
		$(PACKAGE_exchange-$(ENABLE_exchange)) \

CONFIG_OPTS =	--prefix='$(PREFIX)'

CCACHE_DIR :=	$(CURDIR)/ccache

PKG_CONFIG_PATH := $(PREFIX)/lib/pkgconfig:$(PREFIX)/share/pkgconfig:$(PKG_CONFIG_PATH)



ifneq ($(LINGUAS),)
  export LINGUAS

# ----- Per-package configuration and build options
# Each package can have any or all of these variables set:
#   <pkg>_PREREQS
#   <pkg>_CONFIG_VARS
#   <pkg>_CONFIG_OPTS
#   <pkg>_BUILD_VARS
#   <pkg>_BUILD_OPTS
#   <pkg>_INSTALL_VARS
#   <pkg>_INSTALL_OPTS
# The _PREREQS value lists packages that are (make) prerequisites.
# The _*_VARS values are environment variable settings for that stage.
# The _*_OPTS values are command line options for that stage.
# Only the variables with any values are listed here.

libsoup_PREREQS := glib

libbonobo_PREREQS := glib

gtkhtml_PREREQS := glib libsoup libbonobo

evolution-data-server_PREREQS := glib libsoup libbonobo gtkhtml
evolution-data-server_CONFIG_OPTS = \
	--with-openldap=yes --enable-gnome-keyring=yes --with-e2k-debug \

gnome-pilot_CONFIG_OPTS = \
gnome-pilot_BUILD_OPTS = -k

# I decided to disable scrollkeeper since otherwise Evolution will try
# to register it, and this requires root privileges.
CONFIG_exchange-y	:= --enable-exchange=yes
evolution_PREREQS	:= glib libsoup libbonobo gtkhtml evolution-data-server gnome-pilot
evolution_CONFIG_OPTS =	\
	--with-openldap=yes --enable-nntp=yes --enable-ipv6=yes \
	--enable-nss=yes --enable-smime=yes --enable-plugins=all \
	--enable-cairo-calendar=yes --enable-imap4=yes --with-e2k-debug \
	--disable-scrollkeeper $(CONFIG_exchange-$(ENABLE_exchange)) \

evolution-exchange_PREREQS := glib libsoup libbonobo evolution-data-server evolution
evolution-exchange_CONFIG_OPTS = \
	--with-openldap=yes --with-e2k-debug \

evolution-webcal_PREREQS := glib libsoup libbonobo evolution-data-server evolution
evolution-webcal_CONFIG_OPTS = \

# -----

STAMPDIR :=	.stamp

ifeq ($(OBJDIR),.)
  OBJPATH =	$*
  SRCPATH =	../../$*

# Commands

CC :=		$(strip $(CCACHE) gcc)
CP :=		cp -p
CPDIR :=	cp -a
DPKG :=		dpkg
ECHO :=		echo
LINK :=		ln -s
MKDIR :=	mkdir -p
RM :=		rm -f
RMDIR :=	rm -rf
SED :=		sed
SUDO :=		sudo
SVN :=		svn
TOUCH :=	touch
UNPACK :=	tar xjf
WGET :=		wget


# How to get things from SVN


# Compute the SVN version path
# If it's empty, assume the trunk
# If it contains a "/", use it as-is
# Otherwise, convert it into a branch name using the standard GNOME format.

# Default branches for various distros; older distros can't always build
# newer branches
BRANCH_feisty	:= 2.20

ifeq ($(BRANCH),)

ifeq ($(BRANCH),)
  SVNPATH :=	trunk
  BRANCH :=	trunk
  ifeq ($(notdir $(BRANCH)),$(BRANCH))
    SVNPATH :=	branches/gnome-$(subst .,-,$(BRANCH))
  branch :=	branch $(BRANCH)


# Make sure we look in the new location for apps
PATH :=		$(PREFIX)/bin:$(PATH)
export PATH

# Create the prefix directory if needed.
# This could be done as an order-only prereq or something, but if we do it
# here then the user is asked for a password up-front, rather than halfway
# through the build when they've gone out for more tea.

$(shell if [ -d '$(PREFIX)' ] || $(MKDIR) '$(PREFIX)' 2>/dev/null; then \
          :; \
        else \
          $(ECHO) "Need root to create directory $(PREFIX)." 1>&2; \
          $(ECHO) "Please enter YOUR password when asked (for sudo)." 1>&2; \
          $(SUDO) $(MKDIR) '$(PREFIX)' && $(SUDO) chown '$(USER)' '$(PREFIX)';\

# aclocal throws up if this doesn't exist... bogus!
$(shell [ -d '$(PREFIX)/share/aclocal' ] || $(MKDIR) '$(PREFIX)/share/aclocal')

# Make stamp and obj directories early, so make doesn't throw out patterns
# for them.
$(shell $(MKDIR) '$(CURDIR)/$(STAMPDIR)' '$(CURDIR)/obj')

STAMPTYPES :=	update patch config build install

# ----- all target

# All means everything is installed
.PHONY: all install update help
all: install $(PREFIX)/bin/evolution-svn $(PREFIX)/bin/evolution-env
install: $(patsubst %,$(STAMPDIR)/%.install,$(PACKAGES))

update: $(patsubst %,$(STAMPDIR)/%.update,$(PACKAGES))

	$(SED) -n 's/^#h://p' < Makefile

# Make sure none of the targets are considered intermediate
.PRECIOUS: $(foreach X,$(STAMPTYPES),$(STAMPDIR)/%.$X) \
	   $(addsuffix /.svn,$(PACKAGES))

# ----- install script wrappers

$(PREFIX)/bin/evolution-%: Makefile
	$V $(MKDIR) -p '$(@D)' \
		&& $(SED) -n -e 's|^#$*:||p' < '$<' \
		     | $(SED) -e 's|@PREFIX@|$(PREFIX)|' \
			      -e 's|@PKG_CONFIG_PATH@|$(PKG_CONFIG_PATH)|' \
			      -e 's|@LD_LIBRARY_PATH@|$(LD_LIBRARY_PATH)|' \
                     > '$@' \
		&& chmod 0755 '$@' \
		&& echo "Installed $@"

# ----- final setup operations

# Make sure camel-lock-helper has the right privs for handling email
	$V $(ECHO) "Setting mail helper privileges (may require $(SUDO)!)"; \
	   ls -1 $(PREFIX)/libexec/camel-lock-helper-* \
	     | while read helper; do \
		 [ -f "$$helper" ] || continue; \
		 case `stat --format="%G:%A" "$$helper"` in \
		    mail:??????s???) : all set ;; \
		    *) $(SUDO) chgrp mail "$$helper" \
			 && $(SUDO) chmod g+s "$$helper" ;; \
		 esac; \

# ----- install SVN workspaces

$(STAMPDIR)/%.install: $(STAMPDIR)/ | $(PREFIX)
	$V [ -d '$(PREFIX)/etc/gconf' ] || $(MKDIR) '$(PREFIX)/etc/gconf'
	$V cd '$(OBJPATH)' \
			$(MAKE) install $(INSTALL_OPTS) $($*_INSTALL_OPTS)

# ----- build SVN workspaces

$(STAMPDIR)/ $(STAMPDIR)/%.config
	$V cd '$(OBJPATH)' \
		&& $(BUILD_VARS) $($*_BUILD_VARS) \

# ----- configure SVN workspaces

_CONFIG = $(MKDIR) '$(OBJPATH)/' && cd '$(OBJPATH)' \

# We don't use the stamp files here because if we do, it will cause all the
# prerequisite information at the end to come into play.

$(STAMPDIR)/%.config: $(STAMPDIR)/%.patch
	$V $(_CONFIG)

# ----- patch SVN workspaces

$(STAMPDIR)/%.patch: $(STAMPDIR)/%.update

# ----- update SVN workspaces

getsvnrev = `$(SVN) info $(1) | $(SED) -n 's/^Revision: \([0-9][0-9]*\).*/\1/p'`

getsvninfo = eval `$(SVN) info $(2) | $(SED) -n -e 's/^Revision: \([0-9][0-9]*\).*/$(1)rev="\1"/p' -e 's/^URL: \(http:.*\)/$(1)url="\1"/p'`

$(STAMPDIR)/%.update: %/.svn FORCE | check-prereqs-$(DISTRO)
	$V pkg='$*'; cd "$$pkg" \
		&& $(call getsvninfo,repo,$(SVNPKGURL)) \
		&& $(call getsvninfo,work,) \
		&& if [ "$$workrev:$$workurl" = "$$reporev:$$repourl" ]; then \
			$(ECHO) "No SVN update needed for $$pkg."; \
			[ -f '$(STAMPFILE)' ] || $(MKSTAMP); \
		   else \
			$(ECHO) ">>>> Updating package $$pkg from SVN:"; \
			$(SVN) switch $(SVNPKGURL) \
			    && $(SVN) update \
			    && $(MKSTAMP); \

	@ $(ECHO) ">>>> Checking out package $* from SVN:"
	$V pkg='$*'; $(SVN) checkout $(SVNPKGURL) "$$pkg"
	@ $(TOUCH) '$(CURDIR)/$(STAMPDIR)/$*.update'

.PHONY: check-update
	@for pkg in $(PACKAGES); do \
	   ( \
	     cd "$$pkg"; \
	     $(call getsvninfo,repo,$(SVNPKGURL)); \
	     $(call getsvninfo,work,); \
	     if [ "$$workrev" = "$$reporev" ]; then \
		$(ECHO) ">>>> No SVN update needed for $$pkg."; \
	     else \
		$(ECHO) ">>>> $$pkg has SVN updates available:"; \
		if [ "$$workurl" = "$$repourl" ]; then \
		   $(SVN) status -q -u; \
		else \
		   $(ECHO) "-> On $(BRANCH).  Use 'make update'."; \
		fi; \
	     fi; \
	   ); \

.PHONY: check-changelog
	@for pkg in $(PACKAGES); do \
	   ( \
	     cd "$$pkg"; \
	     $(call getsvninfo,repo,$(SVNPKGURL)); \
	     $(call getsvninfo,work,); \
	     if [ "$$workrev" = "$$reporev" ]; then \
		$(ECHO) ">>>> No SVN update needed for $$pkg."; \
	     else \
		$(ECHO) ">>>> $$pkg has SVN updates available:"; \
		if [ "$$workurl" != "$$repourl" ]; then \
		   $(ECHO) "-> On $(BRANCH).  Use 'make update'."; \
		else \
		   log="/tmp/svnstatus.log.$$$$"; \
		   $(SVN) status -q -u 2>&1 | tee "$$log"; \
		   sort "$$log" \
		     | while read stat rev fn; do \
			 case $$fn in \
			   ChangeLog|*/ChangeLog) \
				$(ECHO) ">>>> $$pkg: $(SVN) diff -r $$rev:HEAD $$fn"; \
				$(SVN) diff -r "$$rev:HEAD" "$$fn" ;; \
			 esac; \
		       done; \
		   $(RM) "$$log"; \
		fi; \
	     fi; \
	   ); \

# ----- create SVN workspaces

# ----- check packages

# This is for DPKG systems.  Someone else will have to write the
# equivalent RPM code.
.PHONY: check-prereqs check-prereqs- check-prereqs-ubuntu
check-prereqs: check-prereqs-$(DISTRO)
	@$(ECHO) "Cannot verify system package prerequisites."; \
	 $(ECHO) "I'm trying to build anyway..."; \
	 $(ECHO) "  Good luck!!"

	@$(ECHO) "Unsupported distro: '$*'.  Choose one of:"; \
	 for d in $(DISTROS); do $(ECHO) "    $$d"; done; \
	 $(ECHO) "Or to force a build, set 'distro' empty in the makefile."; \
	 exit 1

$(addprefix check-prereqs-,$(DISTROS)): check-prereqs-%:
	@log="/tmp/evo-chk-prereqs.$$$$" \
	  && $(RM) "$$log" \
	  && $(TOUCH) "$$log" \
	  && $(DPKG) -l $(sort $($*-PREREQS)) \
		| while read s n rest; do \
		    case $$s in \
			ii) echo "$$n" >> "$$log" ;; \
			[a-z][a-z]) \
			    echo "Package $$n not installed (state $$s)" ;; \
		    esac; \
		  done; \
	num=`wc -l < "$$log"`; \
	$(RM) "$$log"; \
	if [ "$$num" != "$(words $(sort $($*-PREREQS)))" ]; then \
	    $(ECHO); \
	    $(ECHO) "Not all prerequisites are installed!"; \
	    $(ECHO) "Use 'aptitude install ...' on the above missing packages."; \
	    $(ECHO); \
	    exit 1; \

# ----- cleanup

.PHONY: clean shinyclean superclean
ifeq ($(OBJDIR),.)
	for pkg in $(PACKAGES); do \
	    (cd $$pkg && $(MAKE) clean); \

ifneq ($(OBJDIR),.)

superclean: shinyclean

# Clean out the builtin database

# ----- ordering

# These ensure that packages are built in the correct order.  In general,
# we can't do the config until after we've installed the previous packages.
# Technically, we don't really need to reconfig after every install: most of
# the time it would be enough to rebuild after the install; however, there's
# no good way to make that work all the time, unless we had perfect
# prerequisite declarations (knowing which installed files actually would
# require a reconfig vs. a rebuild for example).

# Generate prerequisites, but don't depend on packages we don't build
prereqs = $(STAMPDIR)/$(1).config : $(patsubst %,$(STAMPDIR)/%.install,$(filter $($(1)_PREREQS),$(PACKAGES)))

$(call prereqs,glib)
$(call prereqs,libsoup)
$(call prereqs,gtkhtml)
$(call prereqs,gnome-pilot)
$(call prereqs,evolution-data-server)
$(call prereqs,evolution)
$(call prereqs,evolution-exchange)
$(call prereqs,evolution-webcal)

# ---- END OF MAKEFILE ----

# -----------------------------------------------------------------------------
# This is the content of evolution-env.  It's extracted by sed.

#env:# Put this file in your PATH and/or invoke it directly.
#env:# - Sets up the environment for running the compiled version of
#env:#   Evolution and compiling programs against it.
#env:# - Runs the program on the command line (if one given) or a bash
#env:#   shell.
#env:case ":$PKG_CONFIG_PATH:" in
#env:    *":$pkgconfig:"*) : ok ;;
#env:    *)  PKG_CONFIG_PATH="$pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
#env:        export PKG_CONFIG_PATH ;;
#env:case ":$LD_LIBRARY_PATH:" in
#env:    *":$ldlibrary:"*) : ok ;;
#env:    *)  LD_LIBRARY_PATH="$ldlibrary${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
#env:        export LD_LIBRARY_PATH ;;
#env:case ":$PATH:" in
#env:    *":$prefix/bin:$prefix/libexec:"*) : ok ;;
#env:    *)  PATH="$prefix/bin:$prefix/libexec:$PATH"
#env:        export PATH ;;
#env:exec "${@:-${SHELL:-/bin/bash}}"

# -----------------------------------------------------------------------------
# This is the content of evolution-svn.  It's extracted by sed.

#svn:# Put this file in your PATH and/or invoke it directly.
#svn:# - Enables full debugging (note!  Privacy concerns!)
#svn:# - Enables core dumps (ulimit)
#svn:# - Creates a new log directory for this instance of Evo
#svn:# - Cd's there to keep everything related to this run together
#svn:# You should clean out those log directories occasionally.
#svn:# Set up debugging.  Remember EVERYTHING!
#svn:# Allow for core dumps.
#svn:ulimit -c unlimited
#svn:# All our email is dumped with debugging, so set restrictive permissions
#svn:umask 0077
#svn:# Create a directory just for this run
#svn:logdir="$prefix/log/`date '+%Y%m%d.%H%M%S'`"
#svn:mkdir -p "$logdir"
#svn:cd "$logdir" || exit 1
#svn:# Run it
#svn:while [ -e "$logdir/evo.log.$i" ]; do
#svn:   i=`expr $i + 1`
#svn:exec "$prefix/bin/evolution-env" "$prefix/bin/evolution" "$@" >"$logdir/evo.log.$i" 2>&1

# -----------------------------------------------------------------------------
# This is some help.  Run "make help" to read it  most easily.

#h:Makefile for building Evolution from SVN
#h:all		[Default] Check out, configure, compile, install the various
#h:		components necessary to build Evolution from SVN.
#h:update		Perform SVN updates of all the checked out components.
#h:check-update	Check whether there are new updates in the SVN repository.
#h:		Doesn't check anything out.
#h:check-changelog	Check whether there are new updates, AND show the ChangeLog
#h:		diffs.
#h:check-prereqs	Verify that the packages needed for the build are installed.
#h:clean		For each source package, "make clean"
#h:shinyclean	Remove the source packages completely
#h:superclean	Remove the source packages AND the installed Evolution
#h:You can create a makefile "" in the same directory that contains the
#h:Makefile.  This file, if it exists, can contain one or more of the following
#h:PREFIX		The directory in which to install Evolution.
#h:		Must NOT be /usr!
#h:DISTRO		The GNU/Linux distribution you're running.  This helps the
#h:		Makefile check for the right packages before starting the
#h:		build.  Currently supported are "feisty", "gutsy", "hardy", and
#h:		"etch" (Debian).  You can also set it to empty and hope for the best.
#h:BRANCH		The SVN label or branch to build.  If you don't set this then
#h:		a distro-specific value is chosen: it uses the SVN trunk where
#h:		possible.
#h:CCACHE		Enable ccache (on by default).  If you don't want to use it,
#h:		set this to empty.
#h:ENABLE_exchange	Turn on Evolution Exchange support (on by default).  If you
#h:		don't want to build it, set this to "n" (or any non-"y"
#h:		value).
#h:ENABLE_webcal	Turn on Evolution Webcall support (on by default).  If you
#h:		don't want to build it, set this to "n" (or any non-"y"
#h:		value).
#h:LINGUAS		Restrict the number of translations built and installed to
#h:		those listed in this variable.
#h:local_PACKAGES	A list of extra packages you want to build.  These must be
#h:		"standard" Gnome packages kept on the Gnome SVN server and
#h:		using the normal build operations.  Common packages you might
#h:		want to list here are glib, libbonobo, and libsoup.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]