akonadi: fix runtime paths
This commit is contained in:
parent
f5c00c43bb
commit
3acfd31050
|
@ -1,20 +0,0 @@
|
||||||
{
|
|
||||||
mkDerivation, lib,
|
|
||||||
extra-cmake-modules,
|
|
||||||
kcompletion, kconfigwidgets, kdbusaddons, kdesignerplugin, kiconthemes,
|
|
||||||
kio,
|
|
||||||
boost, kitemmodels
|
|
||||||
}:
|
|
||||||
|
|
||||||
mkDerivation {
|
|
||||||
name = "akonadi";
|
|
||||||
meta = {
|
|
||||||
license = [ lib.licenses.lgpl21 ];
|
|
||||||
maintainers = [ lib.maintainers.ttuegel ];
|
|
||||||
};
|
|
||||||
nativeBuildInputs = [ extra-cmake-modules ];
|
|
||||||
buildInputs = [
|
|
||||||
kcompletion kconfigwidgets kdbusaddons kdesignerplugin kiconthemes kio
|
|
||||||
];
|
|
||||||
propagatedBuildInputs = [ boost kitemmodels ];
|
|
||||||
}
|
|
|
@ -0,0 +1,105 @@
|
||||||
|
Index: akonadi-17.04.0/src/server/storage/dbconfigmysql.cpp
|
||||||
|
===================================================================
|
||||||
|
--- akonadi-17.04.0.orig/src/server/storage/dbconfigmysql.cpp
|
||||||
|
+++ akonadi-17.04.0/src/server/storage/dbconfigmysql.cpp
|
||||||
|
@@ -76,20 +76,11 @@ bool DbConfigMysql::init(QSettings &sett
|
||||||
|
defaultServerPath = QStringLiteral(MYSQLD_EXECUTABLE);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
- const QStringList mysqldSearchPath = QStringList()
|
||||||
|
- << QStringLiteral("/usr/bin")
|
||||||
|
- << QStringLiteral("/usr/sbin")
|
||||||
|
- << QStringLiteral("/usr/local/sbin")
|
||||||
|
- << QStringLiteral("/usr/local/libexec")
|
||||||
|
- << QStringLiteral("/usr/libexec")
|
||||||
|
- << QStringLiteral("/opt/mysql/libexec")
|
||||||
|
- << QStringLiteral("/opt/local/lib/mysql5/bin")
|
||||||
|
- << QStringLiteral("/opt/mysql/sbin");
|
||||||
|
if (defaultServerPath.isEmpty()) {
|
||||||
|
- defaultServerPath = XdgBaseDirs::findExecutableFile(QStringLiteral("mysqld"), mysqldSearchPath);
|
||||||
|
+ defaultServerPath = QStringLiteral(NIXPKGS_MYSQL_MYSQLD);
|
||||||
|
}
|
||||||
|
|
||||||
|
- const QString mysqladminPath = XdgBaseDirs::findExecutableFile(QStringLiteral("mysqladmin"), mysqldSearchPath);
|
||||||
|
+ const QString mysqladminPath = QStringLiteral(NIXPKGS_MYSQL_MYSQLADMIN);
|
||||||
|
if (!mysqladminPath.isEmpty()) {
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
|
defaultCleanShutdownCommand = QStringLiteral("%1 --defaults-file=%2/mysql.conf --socket=%3/mysql.socket shutdown")
|
||||||
|
@@ -99,10 +90,10 @@ bool DbConfigMysql::init(QSettings &sett
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
- mMysqlInstallDbPath = XdgBaseDirs::findExecutableFile(QStringLiteral("mysql_install_db"), mysqldSearchPath);
|
||||||
|
+ mMysqlInstallDbPath = QStringLiteral(NIXPKGS_MYSQL_MYSQL_INSTALL_DB);
|
||||||
|
qCDebug(AKONADISERVER_LOG) << "Found mysql_install_db: " << mMysqlInstallDbPath;
|
||||||
|
|
||||||
|
- mMysqlCheckPath = XdgBaseDirs::findExecutableFile(QStringLiteral("mysqlcheck"), mysqldSearchPath);
|
||||||
|
+ mMysqlCheckPath = QStringLiteral(NIXPKGS_MYSQL_MYSQLCHECK);
|
||||||
|
qCDebug(AKONADISERVER_LOG) << "Found mysqlcheck: " << mMysqlCheckPath;
|
||||||
|
|
||||||
|
mInternalServer = settings.value(QStringLiteral("QMYSQL/StartServer"), defaultInternalServer).toBool();
|
||||||
|
@@ -119,7 +110,7 @@ bool DbConfigMysql::init(QSettings &sett
|
||||||
|
mUserName = settings.value(QStringLiteral("User")).toString();
|
||||||
|
mPassword = settings.value(QStringLiteral("Password")).toString();
|
||||||
|
mConnectionOptions = settings.value(QStringLiteral("Options"), defaultOptions).toString();
|
||||||
|
- mMysqldPath = settings.value(QStringLiteral("ServerPath"), defaultServerPath).toString();
|
||||||
|
+ mMysqldPath = QStringLiteral(NIXPKGS_MYSQL_MYSQLD);
|
||||||
|
mCleanServerShutdownCommand = settings.value(QStringLiteral("CleanServerShutdownCommand"), defaultCleanShutdownCommand).toString();
|
||||||
|
settings.endGroup();
|
||||||
|
|
||||||
|
@@ -196,7 +187,7 @@ bool DbConfigMysql::startInternalServer(
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// generate config file
|
||||||
|
- const QString globalConfig = XdgBaseDirs::findResourceFile("config", QStringLiteral("akonadi/mysql-global.conf"));
|
||||||
|
+ const QString globalConfig = QStringLiteral(NIX_OUT "/etc/xdg/akonadi/mysql-global.conf");
|
||||||
|
const QString localConfig = XdgBaseDirs::findResourceFile("config", QStringLiteral("akonadi/mysql-local.conf"));
|
||||||
|
const QString actualConfig = StandardDirs::saveDir("data") + QLatin1String("/mysql.conf");
|
||||||
|
if (globalConfig.isEmpty()) {
|
||||||
|
Index: akonadi-17.04.0/src/server/storage/dbconfigpostgresql.cpp
|
||||||
|
===================================================================
|
||||||
|
--- akonadi-17.04.0.orig/src/server/storage/dbconfigpostgresql.cpp
|
||||||
|
+++ akonadi-17.04.0/src/server/storage/dbconfigpostgresql.cpp
|
||||||
|
@@ -97,8 +97,8 @@ bool DbConfigPostgresql::init(QSettings
|
||||||
|
}
|
||||||
|
postgresSearchPath.append(postgresVersionedSearchPaths);
|
||||||
|
|
||||||
|
- defaultServerPath = XdgBaseDirs::findExecutableFile(QStringLiteral("pg_ctl"), postgresSearchPath);
|
||||||
|
- defaultInitDbPath = XdgBaseDirs::findExecutableFile(QStringLiteral("initdb"), postgresSearchPath);
|
||||||
|
+ defaultServerPath = QStringLiteral(NIXPKGS_POSTGRES_PG_CTL);
|
||||||
|
+ defaultInitDbPath = QStringLiteral(NIXPKGS_POSTGRES_INITDB);
|
||||||
|
defaultHostName = Utils::preferredSocketDirectory(StandardDirs::saveDir("data", QStringLiteral("db_misc")));
|
||||||
|
defaultPgData = StandardDirs::saveDir("data", QStringLiteral("db_data"));
|
||||||
|
}
|
||||||
|
Index: akonadi-17.04.0/src/akonadicontrol/agentprocessinstance.cpp
|
||||||
|
===================================================================
|
||||||
|
--- akonadi-17.04.0.orig/src/akonadicontrol/agentprocessinstance.cpp
|
||||||
|
+++ akonadi-17.04.0/src/akonadicontrol/agentprocessinstance.cpp
|
||||||
|
@@ -62,7 +62,7 @@ bool AgentProcessInstance::start(const A
|
||||||
|
} else {
|
||||||
|
Q_ASSERT(agentInfo.launchMethod == AgentType::Launcher);
|
||||||
|
const QStringList arguments = QStringList() << executable << identifier();
|
||||||
|
- const QString agentLauncherExec = XdgBaseDirs::findExecutableFile(QStringLiteral("akonadi_agent_launcher"));
|
||||||
|
+ const QString agentLauncherExec = QStringLiteral(NIX_OUT "/bin/akonadi_agent_launcher");
|
||||||
|
mController->start(agentLauncherExec, arguments);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
Index: akonadi-17.04.0/src/akonadicontrol/agentmanager.cpp
|
||||||
|
===================================================================
|
||||||
|
--- akonadi-17.04.0.orig/src/akonadicontrol/agentmanager.cpp
|
||||||
|
+++ akonadi-17.04.0/src/akonadicontrol/agentmanager.cpp
|
||||||
|
@@ -102,12 +102,12 @@ AgentManager::AgentManager(bool verbose,
|
||||||
|
mStorageController = new Akonadi::ProcessControl;
|
||||||
|
mStorageController->setShutdownTimeout(15 * 1000); // the server needs more time for shutdown if we are using an internal mysqld
|
||||||
|
connect(mStorageController, &Akonadi::ProcessControl::unableToStart, this, &AgentManager::serverFailure);
|
||||||
|
- mStorageController->start(QStringLiteral("akonadiserver"), serviceArgs, Akonadi::ProcessControl::RestartOnCrash);
|
||||||
|
+ mStorageController->start(QStringLiteral(NIX_OUT "/bin/akonadiserver"), serviceArgs, Akonadi::ProcessControl::RestartOnCrash);
|
||||||
|
|
||||||
|
if (mAgentServerEnabled) {
|
||||||
|
mAgentServer = new Akonadi::ProcessControl;
|
||||||
|
connect(mAgentServer, &Akonadi::ProcessControl::unableToStart, this, &AgentManager::agentServerFailure);
|
||||||
|
- mAgentServer->start(QStringLiteral("akonadi_agent_server"), serviceArgs, Akonadi::ProcessControl::RestartOnCrash);
|
||||||
|
+ mAgentServer->start(QStringLiteral(NIX_OUT "/bin/akonadi_agent_server"), serviceArgs, Akonadi::ProcessControl::RestartOnCrash);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef QT_NO_DEBUG
|
|
@ -0,0 +1,14 @@
|
||||||
|
Index: akonadi-17.04.0/src/server/storage/dbconfigmysql.cpp
|
||||||
|
===================================================================
|
||||||
|
--- akonadi-17.04.0.orig/src/server/storage/dbconfigmysql.cpp
|
||||||
|
+++ akonadi-17.04.0/src/server/storage/dbconfigmysql.cpp
|
||||||
|
@@ -229,8 +229,7 @@ bool DbConfigMysql::startInternalServer(
|
||||||
|
bool confUpdate = false;
|
||||||
|
QFile actualFile(actualConfig);
|
||||||
|
// update conf only if either global (or local) is newer than actual
|
||||||
|
- if ((QFileInfo(globalConfig).lastModified() > QFileInfo(actualFile).lastModified()) ||
|
||||||
|
- (QFileInfo(localConfig).lastModified() > QFileInfo(actualFile).lastModified())) {
|
||||||
|
+ if (true) {
|
||||||
|
QFile globalFile(globalConfig);
|
||||||
|
QFile localFile(localConfig);
|
||||||
|
if (globalFile.open(QFile::ReadOnly) && actualFile.open(QFile::WriteOnly)) {
|
|
@ -0,0 +1,36 @@
|
||||||
|
{
|
||||||
|
mkDerivation, copyPathsToStore, lib,
|
||||||
|
extra-cmake-modules,
|
||||||
|
kcompletion, kconfigwidgets, kdbusaddons, kdesignerplugin, kiconthemes,
|
||||||
|
kio,
|
||||||
|
boost, kitemmodels,
|
||||||
|
mysql
|
||||||
|
}:
|
||||||
|
|
||||||
|
mkDerivation {
|
||||||
|
name = "akonadi";
|
||||||
|
meta = {
|
||||||
|
license = [ lib.licenses.lgpl21 ];
|
||||||
|
maintainers = [ lib.maintainers.ttuegel ];
|
||||||
|
};
|
||||||
|
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series);
|
||||||
|
nativeBuildInputs = [ extra-cmake-modules ];
|
||||||
|
buildInputs = [
|
||||||
|
kcompletion kconfigwidgets kdbusaddons kdesignerplugin kiconthemes kio
|
||||||
|
];
|
||||||
|
propagatedBuildInputs = [ boost kitemmodels ];
|
||||||
|
cmakeFlags = [
|
||||||
|
"-DMYSQLD_EXECUTABLE=${lib.getBin mysql}/bin/mysqld"
|
||||||
|
];
|
||||||
|
NIX_CFLAGS_COMPILE = [
|
||||||
|
''-DNIXPKGS_MYSQL_MYSQLD="${lib.getBin mysql}/bin/mysqld"''
|
||||||
|
''-DNIXPKGS_MYSQL_MYSQLADMIN="${lib.getBin mysql}/bin/mysqladmin"''
|
||||||
|
''-DNIXPKGS_MYSQL_MYSQL_INSTALL_DB="${lib.getBin mysql}/bin/mysql_install_db"''
|
||||||
|
''-DNIXPKGS_MYSQL_MYSQLCHECK="${lib.getBin mysql}/bin/mysqlcheck"''
|
||||||
|
''-DNIXPKGS_POSTGRES_PG_CTL=""''
|
||||||
|
''-DNIXPKGS_POSTGRES_INITDB=""''
|
||||||
|
];
|
||||||
|
preConfigure = ''
|
||||||
|
NIX_CFLAGS_COMPILE+=" -DNIX_OUT=\"$out\""
|
||||||
|
'';
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
akonadi-paths.patch
|
||||||
|
akonadi-timestamps.patch
|
|
@ -48,7 +48,7 @@ let
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
kdelibs = callPackage ./kdelibs { inherit attica phonon; };
|
kdelibs = callPackage ./kdelibs { inherit attica phonon; };
|
||||||
akonadi = callPackage ./akonadi.nix {};
|
akonadi = callPackage ./akonadi {};
|
||||||
akonadi-contacts = callPackage ./akonadi-contacts.nix {};
|
akonadi-contacts = callPackage ./akonadi-contacts.nix {};
|
||||||
akonadi-mime = callPackage ./akonadi-mime.nix {};
|
akonadi-mime = callPackage ./akonadi-mime.nix {};
|
||||||
ark = callPackage ./ark/default.nix {};
|
ark = callPackage ./ark/default.nix {};
|
||||||
|
|
Loading…
Reference in New Issue