guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

07/09: gnu: kinit: Use LIBRARY_PATH to search for dynamically loaded lib


From: guix-commits
Subject: 07/09: gnu: kinit: Use LIBRARY_PATH to search for dynamically loaded libs.
Date: Fri, 4 Jan 2019 04:11:45 -0500 (EST)

htgoebel pushed a commit to branch master
in repository guix.

commit 16b8aff85bcdb9799496c4a27257210cd45158e5
Author: Hartmut Goebel <address@hidden>
Date:   Thu Mar 1 23:08:44 2018 +0100

    gnu: kinit: Use LIBRARY_PATH to search for dynamically loaded libs.
    
    Transfer the NixOS "kdeinit-libpath" patch for kinit as of
    2018-02-17.
    
    * gnu/packages/patches/kinit-kdeinit-libpath.patch: New file.
    * gnu/local.mk (dist_patch_DATA): Add it.
    * gnu/packages/kde-frameworks.scm (kinit)[source]: Use it.
---
 gnu/local.mk                                     |  1 +
 gnu/packages/kde-frameworks.scm                  |  3 +-
 gnu/packages/patches/kinit-kdeinit-libpath.patch | 37 ++++++++++++++++++++++++
 3 files changed, 40 insertions(+), 1 deletion(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 5b983c6..2fed38f 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -856,6 +856,7 @@ dist_patch_DATA =                                           
\
   %D%/packages/patches/kiki-missing-includes.patch             \
   %D%/packages/patches/kiki-portability-64bit.patch            \
   %D%/packages/patches/kinit-kdeinit-extra_libs.patch          \
+  %D%/packages/patches/kinit-kdeinit-libpath.patch             \
   %D%/packages/patches/kio-search-smbd-on-PATH.patch           \
   %D%/packages/patches/kmod-module-directory.patch             \
   %D%/packages/patches/kobodeluxe-paths.patch                  \
diff --git a/gnu/packages/kde-frameworks.scm b/gnu/packages/kde-frameworks.scm
index 7aae50f..2d48661 100644
--- a/gnu/packages/kde-frameworks.scm
+++ b/gnu/packages/kde-frameworks.scm
@@ -2529,7 +2529,8 @@ in applications using the KDE Frameworks.")
                 "1rq9b59gdgcpvwd694l8h55sqahpdaky0n7ag5psjlfn5myf1d95"))
               ;; Use the store paths for other packages and dynamically loaded
               ;; libs
-              (patches (search-patches "kinit-kdeinit-extra_libs.patch"))))
+              (patches (search-patches "kinit-kdeinit-extra_libs.patch"
+                                       "kinit-kdeinit-libpath.patch"))))
     (build-system cmake-build-system)
     (arguments
      `(#:phases
diff --git a/gnu/packages/patches/kinit-kdeinit-libpath.patch 
b/gnu/packages/patches/kinit-kdeinit-libpath.patch
new file mode 100644
index 0000000..89cf1a9
--- /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());



reply via email to

[Prev in Thread] Current Thread [Next in Thread]