Index: Portfile
===================================================================
--- Portfile	(revision 121258)
+++ Portfile	(working copy)
@@ -6,7 +6,7 @@
 PortGroup           compiler_blacklist_versions 1.0
 
 name                digikam
-version             3.5.0
+version             4.0.0
 revision            1
 categories          kde kde4
 license             GPL-2+
@@ -14,15 +14,19 @@
                     gmail.com:caulier.gilles
 platforms           darwin
 
-description         Photo Management Program
-long_description    Digital photo management program to import, organize, enhance, search and export your digital images.
+description         Photo Management Programme
+long_description    Digital photo management programme to import, organise, enhance, search and export your digital images.
 
 homepage            http://www.digikam.org/
 master_sites        kde:stable/digikam/
 
-checksums           rmd160 99afee6f47818653a5011f5a3416a04fb3a6a70f \
-                    sha256 57bd2aa4fdde44333d1362b02b26ebf6c1a70675bf5cb40de5172df02857c42a
+checksums           rmd160 1ffc3e164772d031ff4b017598265bcd1934b919 \
+                    sha256 984f7a47a3fdd5b5b30991b436848ed420fbcfffa01ffaa3abdf7202848b17ae
 
+livecheck.type      regex
+livecheck.url       http://kde-apps.org/content/show.php/digiKam+Software+Collection?content=137059
+livecheck.regex     "digiKam Software Collection.*(4\\.\\d+?(\\.\\d+))"
+
 use_bzip2           yes
 
 # List of whole dependencies ###############################################
@@ -164,3 +168,12 @@
 } else {
     configure.args-append -DENABLE_INTERNALMYSQL=off
 }
+
+set startup_root ""
+
+notes-append "An agent to provide communication between KDE programs must be started.
+To start it run the following command:
+ launchctl load -w ${startup_root}/Library/LaunchAgents/org.macports.kdecache.plist
+ You can also execute the command kbuildsycoca4 manually, for instance when you already
+ ran KDE applications in the current session.."
+
Index: files/find-ColorSync-profiles.patch
===================================================================
--- files/find-ColorSync-profiles.patch	(revision 0)
+++ files/find-ColorSync-profiles.patch	(working copy)
@@ -0,0 +1,79 @@
+--- core/libs/dimg/filters/icc/iccprofile.cpp.orig
++++ core/libs/dimg/filters/icc/iccprofile.cpp
+@@ -489,7 +489,39 @@
+ #ifdef Q_WS_WIN
+     //TODO
+ #elif defined (Q_WS_MAC)
+-    //TODO
++	// RJVB 20140620: use a scheme highly identical to the Linux scheme, adapted for MacPorts in /opt/local and the OS X standard ColorSync directories
++
++    candidates << "/System/Library/ColorSync/Profiles";
++    candidates << "/Library/ColorSync/Profiles";
++    candidates << QDir::homePath() + "/Library/ColorSync/Profiles";
++
++    // MacPorts installs for KDE, so we include the XDG data dirs, including /usr/share/color/icc
++    QStringList dataDirs = QString::fromLocal8Bit(getenv("XDG_DATA_DIRS")).split(':', QString::SkipEmptyParts);
++
++    if (!dataDirs.contains(QLatin1String("/opt/local/share")))
++    {
++	    dataDirs << "/opt/local/share";
++    }
++
++    foreach(const QString& dataDir, dataDirs)
++    {
++	    candidates << dataDir + "/color/icc";
++    }
++
++    // XDG_DATA_HOME
++    QString dataHomeDir = QString::fromLocal8Bit(getenv("XDG_DATA_HOME"));
++
++    if (!dataHomeDir.isEmpty())
++    {
++	    candidates << dataHomeDir + "/color/icc";
++	    candidates << dataHomeDir + "/icc";
++    }
++
++    // home dir directories
++    candidates << QDir::homePath() + "/.local/share/color/icc/";
++    candidates << QDir::homePath() + "/.local/share/icc/";
++    candidates << QDir::homePath() + "/.color/icc/";
++
+ #else
+ 
+     // XDG data dirs, including /usr/share/color/icc
+--- core/utilities/setup/setupicc.cpp.orig
++++ core/utilities/setup/setupicc.cpp
+@@ -901,6 +901,25 @@
+         existingPaths = defaultSearchPaths.join("</li><li>");
+     }
+ 
++#ifdef Q_WS_WIN
++    //TODO
++#elif defined (Q_WS_MAC)
++    QString text = i18n("On Mac OS X, the default search paths include "
++                        "<ul>"
++				    "<li>/System/Library/ColorSync/Profiles</li>"
++				    "<li>/Library/ColorSync/Profiles</li>"
++				    "<li>~/Library/ColorSync/Profiles</li>"
++				    "<li>/opt/local/share/color/icc</li>"
++                        "<li>~/.local/share/color/icc/</li>"
++                        "<li>~/.local/share/icc/</li>"
++                        "<li>~/.color/icc/</li>"
++                        "</ul>"
++                        "On your system, currently these paths exist and are scanned:"
++                        "<ul>"
++                        "<li>%1</li>"
++                        "</ul>",
++                        existingPaths);
++#else
+     QString text = i18n("On Linux, the default search paths include "
+                         "<ul>"
+                         "<li>/usr/share/color/icc</li>"
+@@ -914,6 +933,7 @@
+                         "<li>%1</li>"
+                         "</ul>",
+                         existingPaths);
++#endif
+     QWhatsThis::showText(d->iccFolderLabel->mapToGlobal(QPoint(0, 0)), text, d->iccFolderLabel);
+ }
+ 
