1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-22 13:41:26 +00:00
nixpkgs/pkgs/applications/kde/akonadi/akonadi-paths.patch

173 lines
9.2 KiB
Diff
Raw Normal View History

Index: akonadi-19.08.0/src/akonadicontrol/agentmanager.cpp
===================================================================
--- akonadi-19.08.0.orig/src/akonadicontrol/agentmanager.cpp
+++ akonadi-19.08.0/src/akonadicontrol/agentmanager.cpp
@@ -78,12 +78,12 @@ AgentManager::AgentManager(bool verbose,
2018-04-20 15:24:00 +01:00
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(QLatin1String(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(QLatin1String(NIX_OUT "/bin/akonadi_agent_server"), serviceArgs, Akonadi::ProcessControl::RestartOnCrash);
}
2018-12-03 13:01:40 +00:00
}
2018-04-20 15:24:00 +01:00
Index: akonadi-19.08.0/src/akonadicontrol/agentprocessinstance.cpp
===================================================================
--- akonadi-19.08.0.orig/src/akonadicontrol/agentprocessinstance.cpp
+++ akonadi-19.08.0/src/akonadicontrol/agentprocessinstance.cpp
@@ -62,7 +62,7 @@ bool AgentProcessInstance::start(const A
2018-04-20 15:24:00 +01:00
} else {
Q_ASSERT(agentInfo.launchMethod == AgentType::Launcher);
const QStringList arguments = QStringList() << executable << identifier();
- const QString agentLauncherExec = Akonadi::StandardDirs::findExecutable(QStringLiteral("akonadi_agent_launcher"));
+ const QString agentLauncherExec = QLatin1String(NIX_OUT "/bin/akonadi_agent_launcher");
mController->start(agentLauncherExec, arguments);
}
return true;
Index: akonadi-19.08.0/src/server/storage/dbconfigmysql.cpp
===================================================================
--- akonadi-19.08.0.orig/src/server/storage/dbconfigmysql.cpp
+++ akonadi-19.08.0/src/server/storage/dbconfigmysql.cpp
@@ -83,7 +83,6 @@ bool DbConfigMysql::init(QSettings &sett
// determine default settings depending on the driver
QString defaultHostName;
QString defaultOptions;
- QString defaultServerPath;
QString defaultCleanShutdownCommand;
#ifndef Q_OS_WIN
@@ -92,16 +91,7 @@ bool DbConfigMysql::init(QSettings &sett
2017-05-10 00:24:46 +01:00
#endif
const bool defaultInternalServer = true;
-#ifdef MYSQLD_EXECUTABLE
- if (QFile::exists(QStringLiteral(MYSQLD_EXECUTABLE))) {
- defaultServerPath = QStringLiteral(MYSQLD_EXECUTABLE);
- }
-#endif
- if (defaultServerPath.isEmpty()) {
2019-02-21 15:29:04 +00:00
- defaultServerPath = findExecutable(QStringLiteral("mysqld"));
- }
2018-04-20 15:24:00 +01:00
-
2019-02-21 15:29:04 +00:00
- const QString mysqladminPath = findExecutable(QStringLiteral("mysqladmin"));
+ const QString mysqladminPath = QLatin1String(NIXPKGS_MYSQL_MYSQLADMIN);
2017-05-10 00:24:46 +01:00
if (!mysqladminPath.isEmpty()) {
#ifndef Q_OS_WIN
defaultCleanShutdownCommand = QStringLiteral("%1 --defaults-file=%2/mysql.conf --socket=%3/%4 shutdown")
@@ -111,10 +101,10 @@ bool DbConfigMysql::init(QSettings &sett
2017-05-10 00:24:46 +01:00
#endif
}
2019-02-21 15:29:04 +00:00
- mMysqlInstallDbPath = findExecutable(QStringLiteral("mysql_install_db"));
+ mMysqlInstallDbPath = QLatin1String(NIXPKGS_MYSQL_MYSQL_INSTALL_DB);
2017-05-10 00:24:46 +01:00
qCDebug(AKONADISERVER_LOG) << "Found mysql_install_db: " << mMysqlInstallDbPath;
2019-02-21 15:29:04 +00:00
- mMysqlCheckPath = findExecutable(QStringLiteral("mysqlcheck"));
+ mMysqlCheckPath = QLatin1String(NIXPKGS_MYSQL_MYSQLCHECK);
2017-05-10 00:24:46 +01:00
qCDebug(AKONADISERVER_LOG) << "Found mysqlcheck: " << mMysqlCheckPath;
mInternalServer = settings.value(QStringLiteral("QMYSQL/StartServer"), defaultInternalServer).toBool();
@@ -131,7 +121,7 @@ bool DbConfigMysql::init(QSettings &sett
2017-05-10 00:24:46 +01:00
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 = QLatin1String(NIXPKGS_MYSQL_MYSQLD);
2017-05-10 00:24:46 +01:00
mCleanServerShutdownCommand = settings.value(QStringLiteral("CleanServerShutdownCommand"), defaultCleanShutdownCommand).toString();
settings.endGroup();
@@ -141,9 +131,6 @@ bool DbConfigMysql::init(QSettings &sett
// intentionally not namespaced as we are the only one in this db instance when using internal mode
mDatabaseName = QStringLiteral("akonadi");
}
- if (mInternalServer && (mMysqldPath.isEmpty() || !QFile::exists(mMysqldPath))) {
- mMysqldPath = defaultServerPath;
- }
qCDebug(AKONADISERVER_LOG) << "Using mysqld:" << mMysqldPath;
@@ -152,9 +139,6 @@ bool DbConfigMysql::init(QSettings &sett
settings.setValue(QStringLiteral("Name"), mDatabaseName);
settings.setValue(QStringLiteral("Host"), mHostName);
settings.setValue(QStringLiteral("Options"), mConnectionOptions);
- if (!mMysqldPath.isEmpty()) {
- settings.setValue(QStringLiteral("ServerPath"), mMysqldPath);
- }
settings.setValue(QStringLiteral("StartServer"), mInternalServer);
settings.endGroup();
settings.sync();
@@ -209,7 +193,7 @@ bool DbConfigMysql::startInternalServer(
2017-05-10 00:24:46 +01:00
#endif
// generate config file
2018-04-20 15:24:00 +01:00
- const QString globalConfig = StandardDirs::locateResourceFile("config", QStringLiteral("mysql-global.conf"));
+ const QString globalConfig = QLatin1String(NIX_OUT "/etc/xdg/akonadi/mysql-global.conf");
2018-04-20 15:24:00 +01:00
const QString localConfig = StandardDirs::locateResourceFile("config", QStringLiteral("mysql-local.conf"));
2017-05-10 00:24:46 +01:00
const QString actualConfig = StandardDirs::saveDir("data") + QLatin1String("/mysql.conf");
if (globalConfig.isEmpty()) {
Index: akonadi-19.08.0/src/server/storage/dbconfigpostgresql.cpp
===================================================================
--- akonadi-19.08.0.orig/src/server/storage/dbconfigpostgresql.cpp
+++ akonadi-19.08.0/src/server/storage/dbconfigpostgresql.cpp
@@ -140,9 +140,7 @@ bool DbConfigPostgresql::init(QSettings
// determine default settings depending on the driver
QString defaultHostName;
QString defaultOptions;
- QString defaultServerPath;
QString defaultInitDbPath;
- QString defaultPgUpgradePath;
QString defaultPgData;
2017-05-10 00:24:46 +01:00
#ifndef Q_WS_WIN // We assume that PostgreSQL is running as service on Windows
@@ -153,12 +151,8 @@ bool DbConfigPostgresql::init(QSettings
mInternalServer = settings.value(QStringLiteral("QPSQL/StartServer"), defaultInternalServer).toBool();
if (mInternalServer) {
- const auto paths = postgresSearchPaths(QStringLiteral("/usr/lib/postgresql"));
-
- defaultServerPath = QStandardPaths::findExecutable(QStringLiteral("pg_ctl"), paths);
- defaultInitDbPath = QStandardPaths::findExecutable(QStringLiteral("initdb"), paths);
+ defaultInitDbPath = QLatin1String(NIXPKGS_POSTGRES_INITDB);
2017-05-10 00:24:46 +01:00
defaultHostName = Utils::preferredSocketDirectory(StandardDirs::saveDir("data", QStringLiteral("db_misc")));
- defaultPgUpgradePath = QStandardPaths::findExecutable(QStringLiteral("pg_upgrade"), paths);
2017-05-10 00:24:46 +01:00
defaultPgData = StandardDirs::saveDir("data", QStringLiteral("db_data"));
}
@@ -177,20 +171,14 @@ bool DbConfigPostgresql::init(QSettings
mUserName = settings.value(QStringLiteral("User")).toString();
mPassword = settings.value(QStringLiteral("Password")).toString();
mConnectionOptions = settings.value(QStringLiteral("Options"), defaultOptions).toString();
- mServerPath = settings.value(QStringLiteral("ServerPath"), defaultServerPath).toString();
- if (mInternalServer && mServerPath.isEmpty()) {
- mServerPath = defaultServerPath;
- }
+ mServerPath = QLatin1String(NIXPKGS_POSTGRES_PG_CTL);
qCDebug(AKONADISERVER_LOG) << "Found pg_ctl:" << mServerPath;
mInitDbPath = settings.value(QStringLiteral("InitDbPath"), defaultInitDbPath).toString();
if (mInternalServer && mInitDbPath.isEmpty()) {
mInitDbPath = defaultInitDbPath;
}
qCDebug(AKONADISERVER_LOG) << "Found initdb:" << mServerPath;
- mPgUpgradePath = settings.value(QStringLiteral("UpgradePath"), defaultPgUpgradePath).toString();
- if (mInternalServer && mPgUpgradePath.isEmpty()) {
- mPgUpgradePath = defaultPgUpgradePath;
- }
+ mPgUpgradePath = QLatin1String(NIXPKGS_POSTGRES_PG_UPGRADE);
qCDebug(AKONADISERVER_LOG) << "Found pg_upgrade:" << mPgUpgradePath;
mPgData = settings.value(QStringLiteral("PgData"), defaultPgData).toString();
if (mPgData.isEmpty()) {
@@ -206,7 +194,6 @@ bool DbConfigPostgresql::init(QSettings
settings.setValue(QStringLiteral("Port"), mHostPort);
}
settings.setValue(QStringLiteral("Options"), mConnectionOptions);
- settings.setValue(QStringLiteral("ServerPath"), mServerPath);
settings.setValue(QStringLiteral("InitDbPath"), mInitDbPath);
settings.setValue(QStringLiteral("StartServer"), mInternalServer);
settings.endGroup();