From: Hartmut Goebel <h.goebel@crazy-compilers.com>
To: 33820@debbugs.gnu.org
Subject: [bug#33820] [PATCH 7/9] gnu: kinit: Use LIBRARY_PATH to search for dynamically loaded libs.
Date: Fri, 21 Dec 2018 11:10:50 +0100 [thread overview]
Message-ID: <20181221101052.26832-7-h.goebel@crazy-compilers.com> (raw)
In-Reply-To: <20181221101052.26832-1-h.goebel@crazy-compilers.com>
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(-)
create mode 100644 gnu/packages/patches/kinit-kdeinit-libpath.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index 783a7c624..dd2a15b14 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -855,6 +855,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 edc2587a9..c269c4758 100644
--- a/gnu/packages/kde-frameworks.scm
+++ b/gnu/packages/kde-frameworks.scm
@@ -2551,7 +2551,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 000000000..89cf1a941
--- /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());
--
2.13.7
next prev parent reply other threads:[~2018-12-21 10:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-21 10:08 [bug#33820] [PATCH 0/9] Adopt NixOS patches for KDE Frameworks Hartmut Goebel
2018-12-21 10:10 ` [bug#33820] [PATCH 1/9] gnu: kcmutils: Make QDirIterator follow symlinks Hartmut Goebel
2018-12-21 10:10 ` [bug#33820] [PATCH 2/9] gnu: kcmutils: Print plugin name when loading fails Hartmut Goebel
2018-12-21 10:10 ` [bug#33820] [PATCH 3/9] gnu: kconfigwidgets: Make QDirIterator follow symlinks Hartmut Goebel
2018-12-21 10:10 ` [bug#33820] [PATCH 4/9] gnu: kdelibs4support: Add todo comment for a patch from NixOS Hartmut Goebel
2018-12-21 10:10 ` [bug#33820] [PATCH 5/9] gnu: kio: Search 'smbd' on $PATH Hartmut Goebel
2018-12-21 10:10 ` [bug#33820] [PATCH 6/9] gnu: kinit: Use the store paths for dynamically loaded libs Hartmut Goebel
2018-12-21 10:10 ` Hartmut Goebel [this message]
2018-12-21 10:10 ` [bug#33820] [PATCH 8/9] gnu: kpackage: Transfer patches from NixOS Hartmut Goebel
2018-12-21 10:10 ` [bug#33820] [PATCH 9/9] gnu: kservice: " Hartmut Goebel
[not found] ` <handler.33820.B.15453865187770.ack@debbugs.gnu.org>
2019-01-04 9:28 ` bug#33820: Acknowledgement ([PATCH 0/9] Adopt NixOS patches for KDE Frameworks) Hartmut Goebel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181221101052.26832-7-h.goebel@crazy-compilers.com \
--to=h.goebel@crazy-compilers.com \
--cc=33820@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).