summary refs log tree commit diff
path: root/gnu/packages/patches/kinit-kdeinit-libpath.patch
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2019-01-09 10:48:42 +0200
committerEfraim Flashner <efraim@flashner.co.il>2019-01-09 10:52:41 +0200
commit0e289672503a4e1599ef826d49f2fa5575081942 (patch)
treecdaec28207956090b7cebff805135754dcb22f06 /gnu/packages/patches/kinit-kdeinit-libpath.patch
parent0109b89c5834b5374f248dc3681702180013f41f (diff)
parent6df4d8338d2bf94ab729e3b12e42ace0a06687ae (diff)
downloadguix-0e289672503a4e1599ef826d49f2fa5575081942.tar.gz
Merge remote-tracking branch 'origin/master' into staging
Diffstat (limited to 'gnu/packages/patches/kinit-kdeinit-libpath.patch')
-rw-r--r--gnu/packages/patches/kinit-kdeinit-libpath.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/gnu/packages/patches/kinit-kdeinit-libpath.patch b/gnu/packages/patches/kinit-kdeinit-libpath.patch
new file mode 100644
index 0000000000..89cf1a941d
--- /dev/null
+++ b/gnu/packages/patches/kinit-kdeinit-libpath.patch
@@ -0,0 +1,37 @@
+Search libraries in GUIX_KF5INIT_LIB_PATH.
+
+Based on an idea by NixOs
+pkgs/development/libraries/kde-frameworks/kinit/kinit-libpath.patch
+
+===================================================================
+--- kinit-5.32.0/src/kdeinit/kinit.cpp.orig	2017-10-22 21:02:20.908765455 +0200
++++ kinit-5.32.0/src/kdeinit/kinit.cpp	2017-10-22 21:03:25.312818248 +0200
+@@ -623,20 +623,18 @@
+             if (libpath_relative) {
+                 // NB: Because Qt makes the actual dlopen() call, the
+                 //     RUNPATH of kdeinit is *not* respected - see
+                 //     https://sourceware.org/bugzilla/show_bug.cgi?id=13945
+                 //     - so we try hacking it in ourselves
+-                QString install_lib_dir = QFile::decodeName(
+-                        CMAKE_INSTALL_PREFIX "/" LIB_INSTALL_DIR "/");
+-                QString orig_libpath = libpath;
+-                libpath = install_lib_dir + libpath;
+-                l.setFileName(libpath);
+-                if (!l.load()) {
+-                    libpath = orig_libpath;
+-                    l.setFileName(libpath);
+-                    l.load();
+-                }
++                // Try to load the library relative to the active profiles.
++                QByteArrayList profiles = qgetenv("LIBRARY_PATH").split(':');
++                for (const QByteArray &profile: profiles) {
++                    if (!profile.isEmpty()) {
++                        l.setFileName(QFile::decodeName(profile) + QStringLiteral("/") + libpath);
++                        if (l.load()) break;
++                    }
++		}
+             } else {
+                 l.load();
+             }
+             if (!l.isLoaded()) {
+                 QString ltdlError(l.errorString());