all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Hartmut Goebel <h.goebel@crazy-compilers.com>
To: 33820@debbugs.gnu.org
Subject: [bug#33820] [PATCH 6/9] gnu: kinit: Use the store paths for dynamically loaded libs.
Date: Fri, 21 Dec 2018 11:10:49 +0100	[thread overview]
Message-ID: <20181221101052.26832-6-h.goebel@crazy-compilers.com> (raw)
In-Reply-To: <20181221101052.26832-1-h.goebel@crazy-compilers.com>

Transfer the NixOS "kdeinit-extra_libs" patch for kinit as of
2018-02-17.

* gnu/packages/patches/kinit-kdeinit-extra_libs.patch: New filee.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/kde-frameworks.scm (kinit)[source]: Use it.
  <patch-paths>: New phase.
  [inputs]: Add kparts, plasma-framework.
---
 gnu/local.mk                                       |  1 +
 gnu/packages/kde-frameworks.scm                    | 18 ++++++-
 .../patches/kinit-kdeinit-extra_libs.patch         | 55 ++++++++++++++++++++++
 3 files changed, 73 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/kinit-kdeinit-extra_libs.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 0403f82ba..783a7c624 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -854,6 +854,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/kiki-makefile.patch			\
   %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/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 435b55a49..edc2587a9 100644
--- a/gnu/packages/kde-frameworks.scm
+++ b/gnu/packages/kde-frameworks.scm
@@ -2548,8 +2548,22 @@ in applications using the KDE Frameworks.")
                     name "-" version ".tar.xz"))
               (sha256
                (base32
-                "1rq9b59gdgcpvwd694l8h55sqahpdaky0n7ag5psjlfn5myf1d95"))))
+                "1rq9b59gdgcpvwd694l8h55sqahpdaky0n7ag5psjlfn5myf1d95"))
+              ;; Use the store paths for other packages and dynamically loaded
+              ;; libs
+              (patches (search-patches "kinit-kdeinit-extra_libs.patch"))))
     (build-system cmake-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             ;; Set patched-in values:
+             (substitute* "src/kdeinit/kinit.cpp"
+               (("GUIX_PKGS_KF5_KIO") (assoc-ref inputs "kio"))
+               (("GUIX_PKGS_KF5_PARTS") (assoc-ref inputs "kparts"))
+               (("GUIX_PKGS_KF5_PLASMA") (assoc-ref inputs "plasma-framework")))
+             #t)))))
     (native-inputs
      `(("extra-cmake-modules" ,extra-cmake-modules)
        ("pkg-config" ,pkg-config)))
@@ -2567,11 +2581,13 @@ in applications using the KDE Frameworks.")
        ("kitemviews" ,kitemviews)
        ("ki18n" ,ki18n)
        ("kjobwidgets" ,kjobwidgets)
+       ("kparts" ,kparts)
        ("kservice" ,kservice)
        ("kwidgetsaddons" ,kwidgetsaddons)
        ("kwindowsystem" ,kwindowsystem)
        ("kxmlgui" ,kxmlgui)
        ("libcap" ,libcap) ; to install start_kdeinit with CAP_SYS_RESOURCE
+       ("plasma-framework" ,plasma-framework)
        ("qtbase" ,qtbase)
        ("solid" ,solid)))
     (home-page "https://community.kde.org/Frameworks")
diff --git a/gnu/packages/patches/kinit-kdeinit-extra_libs.patch b/gnu/packages/patches/kinit-kdeinit-extra_libs.patch
new file mode 100644
index 000000000..8dcd4d3e9
--- /dev/null
+++ b/gnu/packages/patches/kinit-kdeinit-extra_libs.patch
@@ -0,0 +1,55 @@
+Search the "extra libs" in GUIX_KF5INIT_LIB_PATH (which basically is a
+collection of all /lib directories). We can not hard-code the full path to the
+libsKF5Plasam, since adding palse-workspace
+
+Adopted from NixOS
+pkgs/development/libraries/kde-frameworks/kinit/kdeinit-extra_libs.patch
+
+===================================================================
+--- kinit-5.32.0/src/kdeinit/kinit-5.32.0/src/kdeinit/.orig
++++ kinit-5.32.0/src/kdeinit/kinit.cpp
+@@ -96,11 +96,9 @@
+     "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
++    "GUIX_PKGS_KF5_KIO/lib/libKF5KIOCore.so.5",
++    "GUIX_PKGS_KF5_PARTS/lib/libKF5Parts.so.5",
++    "GUIX_PKGS_KF5_PLASMA/lib/libKF5Plasma.so.5"
+ #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)
+@@ -1689,7 +1693,7 @@
+     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);
-- 
2.13.7

  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   ` Hartmut Goebel [this message]
2018-12-21 10:10   ` [bug#33820] [PATCH 7/9] gnu: kinit: Use LIBRARY_PATH to search for dynamically loaded libs Hartmut Goebel
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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181221101052.26832-6-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 external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.