[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [emerge/kde-4.14] portage/kdesupport/akonadi: make akonadi build the new version without problems
From:       Patrick Spendrin <ps_ml () gmx ! de>
Date:       2015-08-28 11:44:47
Message-ID: E1ZVI5P-0003Dq-Ve () scm ! kde ! org
[Download RAW message or body]

Git commit 9af6d4d8974febb82bb6f0f5c8d376529fd35f6d by Patrick Spendrin.
Committed on 28/08/2015 at 11:44.
Pushed by sengels into branch 'kde-4.14'.

make akonadi build the new version without problems

A  +37   -0    portage/kdesupport/akonadi/0001-FindSqlite-Use-CMAKE_FLAGS-the-right-way-in-try_comp.patch
 A  +110  -0    portage/kdesupport/akonadi/akonadi-1.13-fixes.diff
M  +1    -1    portage/kdesupport/akonadi/akonadi-1.7.90-20120704.py
A  +228  -0    portage/kdesupport/akonadi/akonadi-kde.conf-fix-1.13.0.diff

http://commits.kde.org/emerge/9af6d4d8974febb82bb6f0f5c8d376529fd35f6d

diff --git a/portage/kdesupport/akonadi/0001-FindSqlite-Use-CMAKE_FLAGS-the-right-way-in-try_comp.patch \
b/portage/kdesupport/akonadi/0001-FindSqlite-Use-CMAKE_FLAGS-the-right-way-in-try_comp.patch
 new file mode 100644
index 0000000..78eeaf1
--- /dev/null
+++ b/portage/kdesupport/akonadi/0001-FindSqlite-Use-CMAKE_FLAGS-the-right-way-in-try_comp.patch
 @@ -0,0 +1,37 @@
+From b60702e0b7041c56a3cb52c209204d28406f3ce5 Mon Sep 17 00:00:00 2001
+From: Raphael Kubo da Costa <rakuco@FreeBSD.org>
+Date: Wed, 13 Aug 2014 14:43:04 +0300
+Subject: [PATCH] FindSqlite: Use CMAKE_FLAGS the right way in try_compile().
+
+This fixes f90774f1 ("Check whether Sqlite is compiled with
+SQLITE_ENABLE_UNLOCK_NOTIFY"), so that SQLITE_INCLUDE_DIR is really
+passed to the try_compile() call. So far, it was just a NOP and the
+compilation only worked if sqlite3.h was in a directory the compiler
+uses automatically.
+
+try_compile()'s syntax is a bit complicated, and CMAKE_FLAGS expects a
+series of arguments as if they had been passed to the command line, so
+instead of "CMAKE_FLAGS INCLUDE_DIRECTORIES /some/dir" one needs to use
+"CMAKE_FLAGS -DINCLUDE_DIRECTORIES:PATH=/some/dir".
+
+REVIEW: 119762
+---
+ cmake/modules/FindSqlite.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cmake/modules/FindSqlite.cmake b/cmake/modules/FindSqlite.cmake
+index ad8cdb4..c43a7b5 100644
+--- a/cmake/modules/FindSqlite.cmake
++++ b/cmake/modules/FindSqlite.cmake
+@@ -94,7 +94,7 @@ if(EXISTS ${SQLITE_INCLUDE_DIR}/sqlite3.h)
+                 ${CMAKE_BINARY_DIR}/sqlite_check_unlock_notify
+                 ${CMAKE_BINARY_DIR}/sqlite_check_unlock_notify.cpp
+                 LINK_LIBRARIES ${SQLITE_LIBRARIES}
+-                CMAKE_FLAGS INCLUDE_DIRECTORIES ${SQLITE_INCLUDE_DIR})
++                CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${SQLITE_INCLUDE_DIR}")
+     if (NOT SQLITE_HAS_UNLOCK_NOTIFY)
+         message(STATUS "Sqlite ${SQLITE_VERSION} was found, but it is not compiled \
with -DSQLITE_ENABLE_UNLOCK_NOTIFY") +     endif()
+-- 
+1.9.0.msysgit.0
+
diff --git a/portage/kdesupport/akonadi/akonadi-1.13-fixes.diff \
b/portage/kdesupport/akonadi/akonadi-1.13-fixes.diff new file mode 100644
index 0000000..10af782
--- /dev/null
+++ b/portage/kdesupport/akonadi/akonadi-1.13-fixes.diff
@@ -0,0 +1,110 @@
+diff -Nru -x '*~' akonadi-1.13.0.orig/server/src/storage/dbconfigpostgresql.cpp \
akonadi-1.13.0/server/src/storage/dbconfigpostgresql.cpp +--- \
akonadi-1.13.0.orig/server/src/storage/dbconfigpostgresql.cpp	2014-08-10 \
12:38:58.000000000 +0200 ++++ \
akonadi-1.13.0/server/src/storage/dbconfigpostgresql.cpp	2015-08-28 \
12:43:57.432653600 +0200 +@@ -29,7 +29,6 @@
+ #include <QtSql/QSqlDriver>
+ #include <QtSql/QSqlError>
+ #include <QtSql/QSqlQuery>
+-#include <unistd.h>
+ 
+ 
+ using namespace Akonadi::Server;
+diff -Nru -x '*~' akonadi-1.13.0.orig/server/src/storage/partstreamer.cpp \
akonadi-1.13.0/server/src/storage/partstreamer.cpp +--- \
akonadi-1.13.0.orig/server/src/storage/partstreamer.cpp	2014-08-10 12:38:58.000000000 \
+0200 ++++ akonadi-1.13.0/server/src/storage/partstreamer.cpp	2015-08-28 \
12:46:43.097129000 +0200 +@@ -31,7 +31,6 @@
+ #include <libs/protocol_p.h>
+ #include <shared/akstandarddirs.h>
+ 
+-#include <unistd.h>
+ 
+ #include <QFile>
+ #include <QFileInfo>
+diff -Nru -x '*~' akonadi-1.13.0.orig/server/tests/unittest/fakesearchmanager.cpp \
akonadi-1.13.0/server/tests/unittest/fakesearchmanager.cpp +--- \
akonadi-1.13.0.orig/server/tests/unittest/fakesearchmanager.cpp	2014-08-10 \
12:38:58.000000000 +0200 ++++ \
akonadi-1.13.0/server/tests/unittest/fakesearchmanager.cpp	2015-08-28 \
12:54:17.831138300 +0200 +@@ -18,6 +18,7 @@
+  */
+ 
+ #include "fakesearchmanager.h"
++#include <entities.h>
+ 
+ using namespace Akonadi::Server;
+ 
+diff -Nru -x '*~' akonadi-1.13.0.orig/shared/akcrash.cpp \
akonadi-1.13.0/shared/akcrash.cpp +--- \
akonadi-1.13.0.orig/shared/akcrash.cpp	2014-08-10 12:38:58.000000000 +0200 ++++ \
akonadi-1.13.0/shared/akcrash.cpp	2015-08-28 12:36:44.960917600 +0200 +@@ -39,7 +39,7 \
@@ +   QString s;
+ 
+ /* FIXME: is there an equivalent for windows? */
+-#ifdef Backtrace_FOUND
++#if Backtrace_FOUND
+   void *trace[256];
+   int n = backtrace( trace, 256 );
+   if ( !n ) {
+diff -Nru -x '*~' akonadi-1.13.0.orig/server/CMakeLists.txt \
akonadi-1.13.0/server/CMakeLists.txt +--- akonadi-1.13.0.orig/server/CMakeLists.txt   \
2014-08-10 12:38:58.000000000 +0200 ++++ akonadi-1.13.0/server/CMakeLists.txt    \
2015-08-28 13:00:57.982025600 +0200 +@@ -1,25 +1,27 @@
+-find_program(MYSQLD_EXECUTABLE NAMES mysqld
+-              PATHS /usr/sbin /usr/local/sbin /usr/libexec /usr/local/libexec \
/opt/mysql/libexec /usr/mysql/bin /opt/mysql/sbin +-              DOC "The mysqld \
executable path. ONLY needed at runtime" +-            )
+-
+-if(MYSQLD_EXECUTABLE)
+-   message(STATUS "MySQL Server found: ${MYSQLD_EXECUTABLE}")
+-else()
+-   message(STATUS "MySQL Server wasn't found. it is required to use the MySQL \
backend.") +-endif()
+-
+-find_path(POSTGRES_PATH NAMES pg_ctl
+-              HINTS /usr/lib${LIB_SUFFIX}/postgresql/8.4/bin
+-                    /usr/lib${LIB_SUFFIX}/postgresql/9.0/bin
+-                    /usr/lib${LIB_SUFFIX}/postgresql/9.1/bin
+-              DOC "The pg_ctl executable path. ONLY needed at runtime by the \
PostgreSQL backend" +-         )
+-
+-if(POSTGRES_PATH)
+-   message(STATUS "PostgreSQL Server found.")
+-else()
+-   message(STATUS "PostgreSQL wasn't found. it is required to use the Postgres \
backend.") ++if(NOT WIN32)
++  find_program(MYSQLD_EXECUTABLE NAMES mysqld
++                PATHS /usr/sbin /usr/local/sbin /usr/libexec /usr/local/libexec \
/opt/mysql/libexec /usr/mysql/bin /opt/mysql/sbin ++                DOC "The mysqld \
executable path. ONLY needed at runtime" ++              )
++
++  if(MYSQLD_EXECUTABLE)
++    message(STATUS "MySQL Server found: ${MYSQLD_EXECUTABLE}")
++  else()
++    message(STATUS "MySQL Server wasn't found. it is required to use the MySQL \
backend.") ++  endif()
++
++  find_path(POSTGRES_PATH NAMES pg_ctl
++                HINTS /usr/lib${LIB_SUFFIX}/postgresql/8.4/bin
++                      /usr/lib${LIB_SUFFIX}/postgresql/9.0/bin
++                      /usr/lib${LIB_SUFFIX}/postgresql/9.1/bin
++                DOC "The pg_ctl executable path. ONLY needed at runtime by the \
PostgreSQL backend" ++          )
++
++  if(POSTGRES_PATH)
++    message(STATUS "PostgreSQL Server found.")
++  else()
++    message(STATUS "PostgreSQL wasn't found. it is required to use the Postgres \
backend.") ++  endif()
+ endif()
+ 
+ include_directories(${Akonadi_SOURCE_DIR}/libs)
+diff -Nru -x '*~' akonadi-1.13.0.orig/server/src/storage/dbconfigmysql.cpp \
akonadi-1.13.0/server/src/storage/dbconfigmysql.cpp +--- \
akonadi-1.13.0.orig/server/src/storage/dbconfigmysql.cpp    2014-08-10 \
12:38:58.000000000 +0200 ++++ akonadi-1.13.0/server/src/storage/dbconfigmysql.cpp \
2015-08-28 13:00:57.992026200 +0200 +@@ -66,7 +66,7 @@
+ #endif
+ 
+   const bool defaultInternalServer = true;
+-#ifdef MYSQLD_EXECUTABLE
++#if defined(MYSQLD_EXECUTABLE) && !defined(Q_OS_WIN)
+    if ( QFile::exists( QLatin1String( MYSQLD_EXECUTABLE ) ) ) {
+      defaultServerPath = QLatin1String( MYSQLD_EXECUTABLE );
+    }
diff --git a/portage/kdesupport/akonadi/akonadi-1.7.90-20120704.py \
b/portage/kdesupport/akonadi/akonadi-1.7.90-20120704.py index eaf6031..2865b60 100644
--- a/portage/kdesupport/akonadi/akonadi-1.7.90-20120704.py
+++ b/portage/kdesupport/akonadi/akonadi-1.7.90-20120704.py
@@ -34,7 +34,7 @@ class subinfo(info.infoclass):
         self.patchToApply['1.10.3'] = [("akonadi-kde.conf-fix.diff", 1)]
         self.patchToApply['1.10.80'] = [("akonadi-kde.conf-fix-1.10.80.diff", 1)]
         self.patchToApply['1.12.1'] = [("akonadi-1.12.1-20140419.diff", 1), \
                ("akonadi-kde.conf-fix-1.12.1.diff", 1)]
-        self.patchToApply['1.13.0'] = [("akonadi-kde.conf-fix-1.12.1.diff", 1)]
+        self.patchToApply['1.13.0'] = \
[("0001-FindSqlite-Use-CMAKE_FLAGS-the-right-way-in-try_comp.patch", 1), \
                ("akonadi-1.13-fixes.diff", 1), ("akonadi-kde.conf-fix-1.13.0.diff", \
                1)]
         self.patchToApply['gitHEAD'] = [("akonadi-kde.conf-fix-1.12.1.diff", 1)]
 
         self.svnTargets['gitHEAD'] = '[git]kde:akonadi.git'
diff --git a/portage/kdesupport/akonadi/akonadi-kde.conf-fix-1.13.0.diff \
b/portage/kdesupport/akonadi/akonadi-kde.conf-fix-1.13.0.diff new file mode 100644
index 0000000..9e53114
--- /dev/null
+++ b/portage/kdesupport/akonadi/akonadi-kde.conf-fix-1.13.0.diff
@@ -0,0 +1,228 @@
+diff -Nru -x '*~' akonadi-1.13.0.orig/libs/xdgbasedirs.cpp \
akonadi-1.13.0/libs/xdgbasedirs.cpp +--- \
akonadi-1.13.0.orig/libs/xdgbasedirs.cpp	2014-08-10 12:38:58.000000000 +0200 ++++ \
akonadi-1.13.0/libs/xdgbasedirs.cpp	2015-08-28 13:00:57.972025100 +0200 +@@ -27,9 \
+27,15 @@ + #include <QtCore/QFileInfo>
+ #include <QtCore/QProcess>
+ #include <QtCore/QSettings>
++#include <QtCore/QProcessEnvironment>
++#include <QtCore/QRegexp>
+ 
+ #include <cstdlib>
+ 
++#ifdef Q_OS_WIN
++# include <windows.h>
++#endif
++
+ static QStringList alternateExecPaths( const QString &path )
+ {
+   QStringList pathList;
+@@ -54,6 +60,57 @@
+ #endif
+ }
+ 
++#ifdef Q_OS_WIN
++static QMap<QString, QString> getEnvironment()
++{
++    QMap<QString, QString> ret;
++    Q_FOREACH(const QString& str, \
QProcessEnvironment::systemEnvironment().toStringList()) ++    {
++        const int p = str.indexOf(QLatin1Char('='));
++        ret[str.left(p)] = str.mid(p + 1);
++    }
++    return ret;
++}
++
++QString expandEnvironmentVariables(const QString& str)
++{
++    static QMap<QString, QString> envVars = getEnvironment();
++    static QRegExp possibleVars(QLatin1String("((\\{|%)(\\w+)(\\}|%))"));
++    QString ret = str;
++    while(possibleVars.indexIn(ret) != -1)
++    {
++        QStringList caps = possibleVars.capturedTexts();
++        if(caps[2] == QLatin1String("{"))
++        {
++            ret.replace(QLatin1String("$") + caps[1], envVars[caps[3]]);
++        }
++        else
++        {
++            ret.replace(caps[1], envVars[caps[3]]);
++        }
++        QString key = possibleVars.cap();
++        ret.replace(key, envVars[key]);
++    }
++    return ret;
++}
++
++static QSettings* getKdeConf()
++{
++    WCHAR wPath[MAX_PATH+1];
++    GetModuleFileNameW(NULL, wPath, MAX_PATH);
++    QString kdeconfPath = QString::fromUtf16((const ushort *) wPath);
++    kdeconfPath = kdeconfPath.left(kdeconfPath.lastIndexOf(QLatin1Char('\\'))).replace(QLatin1Char('\\'), \
QLatin1Char('/')); ++    if(QFile::exists(kdeconfPath + \
QString::fromLatin1("/kde.conf"))) ++    {
++        return new QSettings(kdeconfPath + QString::fromLatin1("/kde.conf"), \
QSettings::IniFormat); ++    }
++    else
++    {
++        return 0;
++    }
++}
++#endif
++
+ namespace Akonadi {
+ 
+ class XdgBaseDirsPrivate
+@@ -103,14 +160,43 @@
+ 
+ QString XdgBaseDirs::homePath( const char *resource )
+ {
++#ifdef Q_OS_WIN
++  static QSettings* kdeconf = getKdeConf();
++#endif
+   if ( qstrncmp( "data", resource, 4 ) == 0 ) {
+     if ( instance()->mDataHome.isEmpty() ) {
+-      instance()->mDataHome = instance()->homePath( "XDG_DATA_HOME", ".local/share" \
); ++#ifdef Q_OS_WIN
++      if(kdeconf) {
++        kdeconf->beginGroup(QLatin1String("XDG"));
++        if(kdeconf->childKeys().contains(QLatin1String("XDG_DATA_HOME")))
++          instance()->mDataHome = \
expandEnvironmentVariables(kdeconf->value(QLatin1String("XDG_DATA_HOME")).toString());
 ++        else
++          instance()->mDataHome = instance()->homePath( "XDG_DATA_HOME", \
".local/share" ); ++        kdeconf->endGroup();
++      } else {
++#else
++      {
++#endif
++        instance()->mDataHome = instance()->homePath( "XDG_DATA_HOME", \
".local/share" ); ++      }
+     }
+     return instance()->mDataHome;
+   } else if ( qstrncmp( "config", resource, 6 ) == 0 ) {
+     if ( instance()->mConfigHome.isEmpty() ) {
+-      instance()->mConfigHome = instance()->homePath( "XDG_CONFIG_HOME", ".config" \
); ++#ifdef Q_OS_WIN
++      if(kdeconf) {
++         kdeconf->beginGroup(QLatin1String("XDG"));
++         if(kdeconf->childKeys().contains(QLatin1String("XDG_CONFIG_HOME")))
++           instance()->mConfigHome = \
expandEnvironmentVariables(kdeconf->value(QLatin1String("XDG_CONFIG_HOME")).toString());
 ++         else
++           instance()->mConfigHome = instance()->homePath( "XDG_CONFIG_HOME", \
".config" ); ++         kdeconf->endGroup();
++      } else {
++#else
++      {
++#endif
++        instance()->mConfigHome = instance()->homePath( "XDG_CONFIG_HOME", \
".config" ); ++      }
+     }
+     return instance()->mConfigHome;
+   }
+@@ -120,25 +206,40 @@
+ 
+ QStringList XdgBaseDirs::systemPathList( const char *resource )
+ {
++#ifdef Q_OS_WIN
++  static QSettings* kdeconf = getKdeConf();
++#endif
+   if ( qstrncmp( "data", resource, 4 ) == 0 ) {
+     if ( instance()->mDataDirs.isEmpty() ) {
+ #ifdef Q_OS_WIN
+-      QDir dir( QCoreApplication::applicationDirPath() );
+-      dir.cdUp();
+-      const QString defaultPathList = dir.absoluteFilePath( QLatin1String( "share" \
) ); +-      QStringList dataDirs = instance()->systemPathList( "XDG_DATA_DIRS", \
defaultPathList.toLocal8Bit().constData() ); ++      QStringList dataDirs;
++      if(kdeconf) {
++        kdeconf->beginGroup(QLatin1String("XDG"));
++        if(kdeconf->childKeys().contains(QLatin1String("XDG_DATA_DIRS"))) {
++          dataDirs = instance()->systemPathList( "XDG_DATA_DIRS", \
expandEnvironmentVariables(kdeconf->value(QLatin1String("XDG_DATA_DIRS")).toString()).toLocal8Bit().constData() \
); ++        } else {
++          QDir dir( QCoreApplication::applicationDirPath() );
++          dir.cdUp();
++          const QString defaultPathList = dir.absoluteFilePath( QLatin1String( \
"share" ) ); ++          dataDirs = instance()->systemPathList( "XDG_DATA_DIRS", \
defaultPathList.toLocal8Bit().constData() ); ++        }
++        kdeconf->endGroup();
++      } else {
++        QDir dir( QCoreApplication::applicationDirPath() );
++        dir.cdUp();
++        const QString defaultPathList = dir.absoluteFilePath( QLatin1String( \
"share" ) ); ++        dataDirs = instance()->systemPathList( "XDG_DATA_DIRS", \
defaultPathList.toLocal8Bit().constData() ); ++      }
+ #else
+       QStringList dataDirs = instance()->systemPathList( "XDG_DATA_DIRS", \
"/usr/local/share:/usr/share" ); + #endif
+ 
+-#ifdef Q_OS_WIN
+-      const QString prefixDataDir = QLatin1String( AKONADIPREFIX "/" AKONADIDATA );
+-#else
++#ifndef Q_OS_WIN
+       const QString prefixDataDir = QLatin1String( AKONADIDATA );
+-#endif
+       if ( !dataDirs.contains( prefixDataDir ) ) {
+         dataDirs << prefixDataDir;
+       }
++#endif
+ 
+ #if QT_VERSION < 0x050000
+       // fallback for users with KDE in a different prefix and not correctly set up \
XDG_DATA_DIRS, hi David ;-) +@@ -182,22 +283,34 @@
+   } else if ( qstrncmp( "config", resource, 6 ) == 0 ) {
+     if ( instance()->mConfigDirs.isEmpty() ) {
+ #ifdef Q_OS_WIN
+-      QDir dir( QCoreApplication::applicationDirPath() );
+-      dir.cdUp();
+-      const QString defaultPathList = dir.absoluteFilePath( QLatin1String( "etc" ) \
) + QLatin1Char( ';' ) + dir.absoluteFilePath( QLatin1String( "share/config" ) ); +-  \
QStringList configDirs = instance()->systemPathList( "XDG_CONFIG_DIRS", \
defaultPathList.toLocal8Bit().constData() ); ++      QStringList configDirs;
++      if(kdeconf) {
++        kdeconf->beginGroup(QLatin1String("XDG"));
++        if(kdeconf->childKeys().contains(QLatin1String("XDG_CONFIG_DIRS"))) {
++            configDirs = instance()->systemPathList( "XDG_CONFIG_DIRS", \
expandEnvironmentVariables(kdeconf->value(QLatin1String("XDG_CONFIG_DIRS")).toString()).toLocal8Bit().constData() \
); ++        } else {
++            QDir dir( QCoreApplication::applicationDirPath() );
++            dir.cdUp();
++            const QString defaultPathList = dir.absoluteFilePath( QLatin1String( \
"etc" ) ) + QLatin1Char( ';' ) + dir.absoluteFilePath( QLatin1String( "share/config" \
) ); ++            configDirs = instance()->systemPathList( "XDG_CONFIG_DIRS", \
defaultPathList.toLocal8Bit().constData() ); ++        }
++        kdeconf->endGroup();
++      } else {
++        QDir dir( QCoreApplication::applicationDirPath() );
++        dir.cdUp();
++        const QString defaultPathList = dir.absoluteFilePath( QLatin1String( "etc" \
) ) + QLatin1Char( ';' ) + dir.absoluteFilePath( QLatin1String( "share/config" ) ); \
++        configDirs = instance()->systemPathList( "XDG_CONFIG_DIRS", \
defaultPathList.toLocal8Bit().constData() ); ++      }
+ #else
+       QStringList configDirs = instance()->systemPathList( "XDG_CONFIG_DIRS", \
"/etc/xdg" ); + #endif
+ 
+-#ifdef Q_OS_WIN
+-      const QString prefixConfigDir = QLatin1String( AKONADIPREFIX "/" \
AKONADICONFIG ); +-#else
++#ifndef Q_OS_WIN
+       const QString prefixConfigDir = QLatin1String( AKONADICONFIG );
+-#endif
+       if ( !configDirs.contains( prefixConfigDir ) ) {
+         configDirs << prefixConfigDir;
+       }
++#endif
+ 
+       instance()->mConfigDirs = configDirs;
+     }
+@@ -233,10 +346,12 @@
+   if ( instance()->mExecutableDirs.isEmpty() ) {
+     QStringList executableDirs = instance()->systemPathList( "PATH", \
"/usr/local/bin:/usr/bin" ); + 
++#if !defined(Q_OS_WIN)
+     const QString prefixExecutableDir = QLatin1String( AKONADIPREFIX "/bin" );
+     if ( !executableDirs.contains( prefixExecutableDir ) ) {
+       executableDirs << prefixExecutableDir;
+     }
++#endif
+ 
+     if ( QCoreApplication::instance() != 0 ) {
+       const QString appExecutableDir = \
QCoreApplication::instance()->applicationDirPath();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic