Index: files/patch-akonadi-prefix.h.cmake.diff
===================================================================
--- files/patch-akonadi-prefix.h.cmake.diff	(revision 69421)
+++ files/patch-akonadi-prefix.h.cmake.diff	(working copy)
@@ -1,5 +1,7 @@
---- akonadi-prefix.h.cmake.orig	2010-03-25 14:28:55.000000000 -0400
-+++ akonadi-prefix.h.cmake	2010-03-25 14:29:05.000000000 -0400
+Index: akonadi-1.3.90/akonadi-prefix.h.cmake
+===================================================================
+--- akonadi-1.3.90.orig/akonadi-prefix.h.cmake	2010-07-04 16:11:13.000000000 +0200
++++ akonadi-1.3.90/akonadi-prefix.h.cmake	2010-07-06 15:59:50.000000000 +0200
 @@ -4,4 +4,4 @@
  #define AKONADIDATA   "${SHARE_INSTALL_PREFIX}"
  #define AKONADICONFIG "${CONFIG_INSTALL_DIR}"
Index: files/patch-akonadi-libs-xdgdatadirs.diff
===================================================================
--- files/patch-akonadi-libs-xdgdatadirs.diff	(revision 0)
+++ files/patch-akonadi-libs-xdgdatadirs.diff	(revision 0)
@@ -0,0 +1,13 @@
+Index: akonadi-1.3.90/libs/xdgbasedirs.cpp
+===================================================================
+--- akonadi-1.3.90.orig/libs/xdgbasedirs.cpp	2010-07-04 16:10:58.000000000 +0200
++++ akonadi-1.3.90/libs/xdgbasedirs.cpp	2010-07-06 16:19:53.000000000 +0200
+@@ -114,7 +114,7 @@
+ {
+   if ( qstrncmp( "data", resource, 4 ) == 0 ) {
+     if ( instance()->mDataDirs.isEmpty() ) {
+-      QStringList dataDirs = instance()->systemPathList( "XDG_DATA_DIRS", "/usr/local/share:/usr/share" );
++      QStringList dataDirs = instance()->systemPathList( "XDG_DATA_DIRS", "/usr/local/share:/usr/share:@@PREFIX@@/share" );
+ 
+ #ifdef Q_OS_WIN
+       const QString prefixDataDir = QLatin1String( AKONADIPREFIX "/" AKONADIDATA );
Index: Portfile
===================================================================
--- Portfile	(revision 69421)
+++ Portfile	(working copy)
@@ -5,8 +5,7 @@
 PortGroup           kde4    1.0
 
 name                akonadi
-version             1.3.1
-revision            1
+version             1.3.90
 categories          devel kde kde4
 maintainers         nomaintainer
 description         A personal information management storage service.
@@ -16,23 +15,32 @@
 homepage            http://pim.kde.org/akonadi/
 master_sites        http://download.akonadi-project.org/
 use_bzip2           yes
-checksums           md5     e6eef3ed5c28d55f4b6530544e379413 \
-                    sha1    b6e97634878fe52785f3dec7d6394a18579d4a50 \
-                    rmd160  487408ad3ac49983b9151aba358225f203ed19a1
+checksums           md5     3536b65df3b3d5f43f55e2f72e9a0130 \
+                    sha1    7759a2ee55c8f76fad6ee4fb3197d55c201d8613 \
+                    rmd160  874eac7d06651c61e6f61fd03c40ae6c0699a90a
 
-depends_build-append port:qt4-mac
-depends_lib-append  port:soprano \
-					port:boost \
-                    port:shared-mime-info
-depends_run-append  path:bin/mysql5:mysql5-server
+patchfiles          patch-akonadi-prefix.h.cmake.diff \
+                    patch-akonadi-libs-xdgdatadirs.diff
+patch.pre_args      -p1
+patch.dir           ${workpath}/${distname}
 
-patch.dir           ${workpath}/${distname}
-patchfiles          patch-akonadi-prefix.h.cmake.diff
 post-patch {
     reinplace s|@@APPS@@|${applications_dir}| ${workpath}/${distname}/akonadi-prefix.h.cmake
+    reinplace s|@@PREFIX@@|${prefix}| ${workpath}/${distname}/libs/xdgbasedirs.cpp
 }
 
+depends_build-append port:shared-mime-info
+
+depends_lib-append  port:soprano \
+                    port:boost \
+                    port:qt4-mac \
+                    port:sqlite3
+
+depends_run-append  path:bin/mysql5:mysql5-server
+
+
 configure.args-append   -DMYSQLD_EXECUTABLE="${prefix}/libexec/mysqld" \
+                        -DINSTALL_QSQLITE_IN_QT_PREFIX=TRUE \
                         ../${distname}
 
 platform darwin 9 {
@@ -44,6 +52,16 @@
     }
 }
 
+post-activate {
+    ui_debug "Updating MIME database..."
+    system "${prefix}/bin/update-mime-database ${prefix}/share/mime"
+}
+
+post-deactivate {
+    ui_debug "Updating MIME database..."
+    system "${prefix}/bin/update-mime-database ${prefix}/share/mime"
+}
+
 livecheck.type      regex
 livecheck.url       ${master_sites}
 livecheck.regex     "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
