diff --git a/pkgs/development/libraries/kde-frameworks/kinit/default.nix b/pkgs/development/libraries/kde-frameworks/kinit/default.nix index b965f761e922..f5cfa166e911 100644 --- a/pkgs/development/libraries/kde-frameworks/kinit/default.nix +++ b/pkgs/development/libraries/kde-frameworks/kinit/default.nix @@ -1,9 +1,12 @@ { kdeFramework, lib, copyPathsToStore, extra-cmake-modules, kdoctools, - kconfig, kcrash, ki18n, kio, kservice, kwindowsystem + kconfig, kcrash, ki18n, kio, kparts, kservice, kwindowsystem, plasma-framework }: +let + inherit (lib) getLib; +in kdeFramework { name = "kinit"; meta = { maintainers = [ lib.maintainers.ttuegel ]; }; @@ -12,4 +15,9 @@ kdeFramework { kconfig kcrash ki18n kio kservice kwindowsystem ]; patches = copyPathsToStore (lib.readPathsFromFile ./. ./series); + NIX_CFLAGS_COMPILE = [ + ''-DNIXPKGS_KF5_KIOCORE="${getLib kio}/lib/libKF5KIOCore.so.5"'' + ''-DNIXPKGS_KF5_PARTS="${getLib kparts}/lib/libKF5Parts.so.5"'' + ''-DNIXPKGS_KF5_PLASMA="${getLib plasma-framework}/lib/libKF5Plasma.so.5"'' + ]; } diff --git a/pkgs/development/libraries/kde-frameworks/kinit/kdeinit-extra_libs.patch b/pkgs/development/libraries/kde-frameworks/kinit/kdeinit-extra_libs.patch new file mode 100644 index 000000000000..75e632d41292 --- /dev/null +++ b/pkgs/development/libraries/kde-frameworks/kinit/kdeinit-extra_libs.patch @@ -0,0 +1,49 @@ +Index: kinit-5.32.0/src/kdeinit/kinit.cpp +=================================================================== +--- kinit-5.32.0.orig/src/kdeinit/kinit.cpp ++++ kinit-5.32.0/src/kdeinit/kinit.cpp +@@ -96,11 +96,9 @@ static const char *extra_libs[] = { + "libKF5Parts.5.dylib", + "libKF5Plasma.5.dylib" + #else +- "libKF5KIOCore.so.5", +- "libKF5Parts.so.5", +-//#ifdef __KDE_HAVE_GCC_VISIBILITY // Removed for KF5, we'll see. +- "libKF5Plasma.so.5" +-//#endif ++ NIXPKGS_KF5_KIOCORE, ++ NIXPKGS_KF5_PARTS, ++ NIXPKGS_KF5_PLASMA + #endif + }; + #endif +@@ -1533,20 +1531,6 @@ static int initXconnection() + } + #endif + +-#ifndef Q_OS_OSX +-// Find a shared lib in the lib dir, e.g. libkio.so. +-// Completely unrelated to plugins. +-static QString findSharedLib(const QString &lib) +-{ +- QString path = QFile::decodeName(CMAKE_INSTALL_PREFIX "/" LIB_INSTALL_DIR "/") + lib; +- if (QFile::exists(path)) { +- return path; +- } +- // We could also look in LD_LIBRARY_PATH, but really, who installs the main libs in different prefixes? +- return QString(); +-} +-#endif +- + extern "C" { + + static void secondary_child_handler(int) +@@ -1692,7 +1676,7 @@ int main(int argc, char **argv) + if (!d.suicide && qEnvironmentVariableIsEmpty("KDE_IS_PRELINKED")) { + const int extrasCount = sizeof(extra_libs) / sizeof(extra_libs[0]); + for (int i = 0; i < extrasCount; i++) { +- const QString extra = findSharedLib(QString::fromLatin1(extra_libs[i])); ++ const QString extra = QString::fromLatin1(extra_libs[i]); + if (!extra.isEmpty()) { + QLibrary l(extra); + l.setLoadHints(QLibrary::ExportExternalSymbolsHint); diff --git a/pkgs/development/libraries/kde-frameworks/kinit/series b/pkgs/development/libraries/kde-frameworks/kinit/series index 576b8a935bf1..9195a4e8e6b0 100644 --- a/pkgs/development/libraries/kde-frameworks/kinit/series +++ b/pkgs/development/libraries/kde-frameworks/kinit/series @@ -1,2 +1,3 @@ kinit-libpath.patch start_kdeinit-path.patch +kdeinit-extra_libs.patch