GNU bug report logs - #33820
[PATCH 0/9] Adopt NixOS patches for KDE Frameworks

Previous Next

Package: guix-patches;

Reported by: Hartmut Goebel <h.goebel <at> crazy-compilers.com>

Date: Fri, 21 Dec 2018 10:02:02 UTC

Severity: normal

Tags: patch

Done: Hartmut Goebel <h.goebel <at> crazy-compilers.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 33820 in the body.
You can then email your comments to 33820 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#33820; Package guix-patches. (Fri, 21 Dec 2018 10:02:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Hartmut Goebel <h.goebel <at> crazy-compilers.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 21 Dec 2018 10:02:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: guix-patches <at> gnu.org
Subject: [PATCH 0/9] Adopt NixOS patches for KDE Frameworks
Date: Fri, 21 Dec 2018 11:08:44 +0100
I reviewed the patches NixOS aplies to KDE, like I did for Qt (see bug
#30340). The changes in this series hold the result. I stepped over these when
trying to make KDE Plasma work.

Most changes are about using store-paths to other packages and for dynamically
loaded libs.  To ease future work, I also added comments about patches we do
not need and why.

Whenenver possible, the "patch" was implemented using `substitute`.

Hartmut Goebel (9):
  gnu: kcmutils: Make QDirIterator follow symlinks.
  gnu: kcmutils: Print plugin name when loading fails.
  gnu: kconfigwidgets: Make QDirIterator follow symlinks.
  gnu: kdelibs4support: Add todo comment for a patch from NixOS.
  gnu: kio: Search 'smbd' on $PATH.
  gnu: kinit: Use the store paths for dynamically loaded libs.
  gnu: kinit: Use LIBRARY_PATH to search for dynamically loaded libs.
  gnu: kpackage: Transfer patches from NixOS.
  gnu: kservice: Transfer patches from NixOS.

 gnu/local.mk                                       |  4 ++
 gnu/packages/kde-frameworks.scm                    | 79 ++++++++++++++++++++--
 .../patches/kinit-kdeinit-extra_libs.patch         | 55 +++++++++++++++
 gnu/packages/patches/kinit-kdeinit-libpath.patch   | 37 ++++++++++
 gnu/packages/patches/kio-search-smbd-on-PATH.patch | 30 ++++++++
 .../patches/kpackage-allow-external-paths.patch    | 13 ++++
 6 files changed, 212 insertions(+), 6 deletions(-)
 create mode 100644 gnu/packages/patches/kinit-kdeinit-extra_libs.patch
 create mode 100644 gnu/packages/patches/kinit-kdeinit-libpath.patch
 create mode 100644 gnu/packages/patches/kio-search-smbd-on-PATH.patch
 create mode 100644 gnu/packages/patches/kpackage-allow-external-paths.patch

-- 
2.13.7





Information forwarded to guix-patches <at> gnu.org:
bug#33820; Package guix-patches. (Fri, 21 Dec 2018 10:04:01 GMT) Full text and rfc822 format available.

Message #8 received at 33820 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 33820 <at> debbugs.gnu.org
Subject: [PATCH 2/9] gnu: kcmutils: Print plugin name when loading fails.
Date: Fri, 21 Dec 2018 11:10:45 +0100
Transfer the NixOS patch "kcmutils-debug-module-loader" for kcmutils as of
2018-02-17.

* gnu/packages/kde-frameworks.scm(kcmutils)<patch>: Add substitute for
  src/kcmoduleloader.cpp.
---
 gnu/packages/kde-frameworks.scm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gnu/packages/kde-frameworks.scm b/gnu/packages/kde-frameworks.scm
index d508624e7..3f0eff292 100644
--- a/gnu/packages/kde-frameworks.scm
+++ b/gnu/packages/kde-frameworks.scm
@@ -2119,6 +2119,10 @@ using the XBEL format.")
                ;; make QDirIterator follow symlinks
                (("^\\s*(QDirIterator it\\(.*, QDirIterator::Subdirectories)(\\);)" _ a b)
                 (string-append a " | QDirIterator::FollowSymlinks" b)))
+             (substitute* "src/kcmoduleloader.cpp"
+               ;; print plugin name when loading fails
+               (("^\\s*(qWarning\\(\\) << \"Error loading) (plugin:\")( << loader\\.errorString\\(\\);)" _ a b c)
+                (string-append a " KCM plugin\" << mod.service()->library() << \":\"" c)))
              #t)))))
     (inputs
      `(("kauth" ,kauth)
-- 
2.13.7





Information forwarded to guix-patches <at> gnu.org:
bug#33820; Package guix-patches. (Fri, 21 Dec 2018 10:04:02 GMT) Full text and rfc822 format available.

Message #11 received at 33820 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 33820 <at> debbugs.gnu.org
Subject: [PATCH 1/9] gnu: kcmutils: Make QDirIterator follow symlinks.
Date: Fri, 21 Dec 2018 11:10:44 +0100
Transfer the NixOS patch "kcmutils-follow-symlinks" for kcmutils as of
2018-02-17.

* gnu/packages/kde-frameworks.scm(kcmutils)<patch>: New phase.
---
 gnu/packages/kde-frameworks.scm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/kde-frameworks.scm b/gnu/packages/kde-frameworks.scm
index 29f954293..d508624e7 100644
--- a/gnu/packages/kde-frameworks.scm
+++ b/gnu/packages/kde-frameworks.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Andreas Enge <andreas <at> enge.fr>
 ;;; Copyright © 2016 Efraim Flashner <efraim <at> flashner.co.il>
-;;; Copyright © 2016,2017 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
+;;; Copyright © 2016,2017,2018 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
 ;;; Copyright © 2016 David Craven <david <at> craven.ch>
 ;;; Copyright © 2017 Thomas Danckaert <post <at> thomasdanckaert.be>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me <at> tobias.gr>
@@ -2110,6 +2110,16 @@ using the XBEL format.")
        ("kservice" ,kservice)))
     (native-inputs
      `(("extra-cmake-modules" ,extra-cmake-modules)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda _
+             (substitute* "src/kpluginselector.cpp"
+               ;; make QDirIterator follow symlinks
+               (("^\\s*(QDirIterator it\\(.*, QDirIterator::Subdirectories)(\\);)" _ a b)
+                (string-append a " | QDirIterator::FollowSymlinks" b)))
+             #t)))))
     (inputs
      `(("kauth" ,kauth)
        ("kcodecs" ,kcodecs)
-- 
2.13.7





Information forwarded to guix-patches <at> gnu.org:
bug#33820; Package guix-patches. (Fri, 21 Dec 2018 10:04:02 GMT) Full text and rfc822 format available.

Message #14 received at 33820 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 33820 <at> debbugs.gnu.org
Subject: [PATCH 3/9] gnu: kconfigwidgets: Make QDirIterator follow symlinks.
Date: Fri, 21 Dec 2018 11:10:46 +0100
Transfer the NixOS patch "qdiriterator-follow-symlinks" for kconfigwidgets as
of 2018-02-17.

* gnu/packages/kde-frameworks.scm(kconfigwidgets)<patch>: New phase.
---
 gnu/packages/kde-frameworks.scm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gnu/packages/kde-frameworks.scm b/gnu/packages/kde-frameworks.scm
index 3f0eff292..3c8063799 100644
--- a/gnu/packages/kde-frameworks.scm
+++ b/gnu/packages/kde-frameworks.scm
@@ -2174,6 +2174,13 @@ KCModules can be created with the KConfigWidgets framework.")
     (arguments
      `(#:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda _
+             (substitute* "src/khelpclient.cpp"
+               ;; make QDirIterator follow symlinks
+               (("^\\s*(QDirIterator it\\(.*, QDirIterator::Subdirectories)(\\);)" _ a b)
+                (string-append a " | QDirIterator::FollowSymlinks" b)))
+             #t))
          (add-before 'check 'check-setup
            (lambda _
              ;; make Qt render "offscreen", required for tests
-- 
2.13.7





Information forwarded to guix-patches <at> gnu.org:
bug#33820; Package guix-patches. (Fri, 21 Dec 2018 10:04:03 GMT) Full text and rfc822 format available.

Message #17 received at 33820 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 33820 <at> debbugs.gnu.org
Subject: [PATCH 4/9] gnu: kdelibs4support: Add todo comment for a patch from
 NixOS.
Date: Fri, 21 Dec 2018 11:10:47 +0100
* gnu/packages/kde-frameworks.scm(kdelibs4support): Add comment.
---
 gnu/packages/kde-frameworks.scm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gnu/packages/kde-frameworks.scm b/gnu/packages/kde-frameworks.scm
index 3c8063799..c73527b43 100644
--- a/gnu/packages/kde-frameworks.scm
+++ b/gnu/packages/kde-frameworks.scm
@@ -3467,6 +3467,8 @@ workspace.")
        ("qtx11extras" ,qtx11extras)))
     ;; FIXME: Use GuixSD ca-bundle.crt in etc/xdg/ksslcalist and
     ;; share/kf5/kssl/ca-bundle.crt
+    ;; TODO: NixOS has nix-kde-include-dir.patch to change std-dir "include"
+    ;; into "@dev@/include/". Think about whether this is needed for us, too.
     (arguments
      `(#:phases
        (modify-phases %standard-phases
-- 
2.13.7





Information forwarded to guix-patches <at> gnu.org:
bug#33820; Package guix-patches. (Fri, 21 Dec 2018 10:04:03 GMT) Full text and rfc822 format available.

Message #20 received at 33820 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 33820 <at> debbugs.gnu.org
Subject: [PATCH 5/9] gnu: kio: Search 'smbd' on $PATH.
Date: Fri, 21 Dec 2018 11:10:48 +0100
Transfer the remaining NixOS patch for kio as of 2018-02-17.

* gnu/packages/patches/kio-search-smbd-on-PATH.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/kde-frameworks.scm(kio)<source>: Use it.
---
 gnu/local.mk                                       |  1 +
 gnu/packages/kde-frameworks.scm                    |  6 ++---
 gnu/packages/patches/kio-search-smbd-on-PATH.patch | 30 ++++++++++++++++++++++
 3 files changed, 34 insertions(+), 3 deletions(-)
 create mode 100644 gnu/packages/patches/kio-search-smbd-on-PATH.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 8e1ce88bc..0403f82ba 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/kio-search-smbd-on-PATH.patch		\
   %D%/packages/patches/kmod-module-directory.patch		\
   %D%/packages/patches/kobodeluxe-paths.patch			\
   %D%/packages/patches/kobodeluxe-enemies-pipe-decl.patch	\
diff --git a/gnu/packages/kde-frameworks.scm b/gnu/packages/kde-frameworks.scm
index c73527b43..435b55a49 100644
--- a/gnu/packages/kde-frameworks.scm
+++ b/gnu/packages/kde-frameworks.scm
@@ -2595,7 +2595,8 @@ makes starting KDE applications faster and reduces memory consumption.")
                     name "-" version ".tar.xz"))
               (sha256
                (base32
-                "0rrsg3g1b204cdp58vxd5dig1ggwyvk1382p1c86vn6w8qbrq27k"))))
+                "0rrsg3g1b204cdp58vxd5dig1ggwyvk1382p1c86vn6w8qbrq27k"))
+              (patches (search-patches "kio-search-smbd-on-PATH.patch"))))
     (build-system cmake-build-system)
     (propagated-inputs
      `(("kbookmarks" ,kbookmarks)
@@ -2638,11 +2639,10 @@ makes starting KDE applications faster and reduces memory consumption.")
        (modify-phases %standard-phases
          (add-after 'unpack 'patch
            (lambda _
-             ;; Better error message (taken from nix)
+             ;; Better error message (taken from NixOS)
              (substitute* "src/kiod/kiod_main.cpp"
                (("(^\\s*qCWarning(KIOD_CATEGORY) << \"Error loading plugin:\")( << loader.errorString();)" _ a b)
                 (string-append a "<< name" b)))
-             ;; TODO: samba-search-path.patch from nix: search smbd on $PATH
              #t))
          (add-before 'check 'check-setup
            (lambda _
diff --git a/gnu/packages/patches/kio-search-smbd-on-PATH.patch b/gnu/packages/patches/kio-search-smbd-on-PATH.patch
new file mode 100644
index 000000000..47e20cfc0
--- /dev/null
+++ b/gnu/packages/patches/kio-search-smbd-on-PATH.patch
@@ -0,0 +1,30 @@
+Adopted from NixOS
+pkgs/development/libraries/kde-frameworks/kio/samba-search-path.patch
+
+===================================================================
+--- kio-5.17.0.orig/src/core/ksambashare.cpp
++++ kio-5.17.0/src/core/ksambashare.cpp
+@@ -67,13 +67,18 @@ KSambaSharePrivate::~KSambaSharePrivate(
+ 
+ bool KSambaSharePrivate::isSambaInstalled()
+ {
+-    if (QFile::exists(QStringLiteral("/usr/sbin/smbd"))
+-            || QFile::exists(QStringLiteral("/usr/local/sbin/smbd"))) {
+-        return true;
++    const QByteArray pathEnv = qgetenv("PATH");
++    if (!pathEnv.isEmpty()) {
++        QLatin1Char pathSep(':');
++        QStringList paths = QFile::decodeName(pathEnv).split(pathSep, QString::SkipEmptyParts);
++        for (QStringList::iterator it = paths.begin(); it != paths.end(); ++it) {
++            it->append("/smbd");
++            if (QFile::exists(*it)) {
++                return true;
++            }
++        }
+     }
+ 
+-    //qDebug() << "Samba is not installed!";
+-
+     return false;
+ }
+ 
-- 
2.13.7





Information forwarded to guix-patches <at> gnu.org:
bug#33820; Package guix-patches. (Fri, 21 Dec 2018 10:04:04 GMT) Full text and rfc822 format available.

Message #23 received at 33820 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 33820 <at> debbugs.gnu.org
Subject: [PATCH 6/9] gnu: kinit: Use the store paths for dynamically loaded
 libs.
Date: Fri, 21 Dec 2018 11:10:49 +0100
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





Information forwarded to guix-patches <at> gnu.org:
bug#33820; Package guix-patches. (Fri, 21 Dec 2018 10:04:04 GMT) Full text and rfc822 format available.

Message #26 received at 33820 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 33820 <at> debbugs.gnu.org
Subject: [PATCH 8/9] gnu: kpackage: Transfer patches from NixOS.
Date: Fri, 21 Dec 2018 11:10:51 +0100
Transfer the NixOS patches for kpackage as of 2018-02-17:
- Allow external paths.
- Make QDirIterator follow symlinks.

Decided to use a patch for one of the "allow external paths" changes since
'substitute*' seems not to be robust enough.

* gnu/packages/patches/kpackage-allow-external-paths.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/kde-frameworks.scm(kpackage)[source]: Use it. <patch>: New
  phase.
---
 gnu/local.mk                                             |  1 +
 gnu/packages/kde-frameworks.scm                          | 15 ++++++++++++++-
 gnu/packages/patches/kpackage-allow-external-paths.patch | 13 +++++++++++++
 3 files changed, 28 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/kpackage-allow-external-paths.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index dd2a15b14..a7db95c20 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -858,6 +858,7 @@ dist_patch_DATA =						\
   %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/kpackage-allow-external-paths.patch	\
   %D%/packages/patches/kobodeluxe-paths.patch			\
   %D%/packages/patches/kobodeluxe-enemies-pipe-decl.patch	\
   %D%/packages/patches/kobodeluxe-const-charp-conversion.patch	\
diff --git a/gnu/packages/kde-frameworks.scm b/gnu/packages/kde-frameworks.scm
index c269c4758..65233f72e 100644
--- a/gnu/packages/kde-frameworks.scm
+++ b/gnu/packages/kde-frameworks.scm
@@ -1848,7 +1848,10 @@ covers feedback and persistent events.")
                     name "-" version ".tar.xz"))
               (sha256
                (base32
-                "1xbfjwxb4gff8gg0hs5m9s0jcnzqk27rs2jr71g5ckhvs5psnkcd"))))
+                "1xbfjwxb4gff8gg0hs5m9s0jcnzqk27rs2jr71g5ckhvs5psnkcd"))
+              ;; Default to: external paths/symlinks can be followed by a
+              ;; package
+              (patches (search-patches "kpackage-allow-external-paths.patch"))))
     (build-system cmake-build-system)
     (native-inputs
      `(("extra-cmake-modules" ,extra-cmake-modules)))
@@ -1863,6 +1866,16 @@ covers feedback and persistent events.")
      `(#:tests? #f ; FIXME: 3/9 tests fail.
        #:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda _
+             ;; Make QDirIterator follow symlinks
+             (substitute* '("src/kpackage/packageloader.cpp"
+                            "src/kpackage/private/packagejobthread.cpp")
+               (("^\\s*(const QDirIterator::IteratorFlags flags = QDirIterator::Subdirectories)(;)" _ a b)
+                (string-append a " | QDirIterator::FollowSymlinks" b))
+               (("^\\s*(QDirIterator it\\(.*, QDirIterator::Subdirectories)(\\);)" _ a b)
+                (string-append a " | QDirIterator::FollowSymlinks" b)))
+             #t))
          (add-before 'check 'check-setup
            (lambda _
              (setenv "HOME" (getcwd))
diff --git a/gnu/packages/patches/kpackage-allow-external-paths.patch b/gnu/packages/patches/kpackage-allow-external-paths.patch
new file mode 100644
index 000000000..c1c9efde7
--- /dev/null
+++ b/gnu/packages/patches/kpackage-allow-external-paths.patch
@@ -0,0 +1,13 @@
+diff --git a/src/kpackage/package.cpp b/src/kpackage/package.cpp
+index 5aec9fd..b15c933 100644
+--- a/src/kpackage/package.cpp
++++ b/src/kpackage/package.cpp
+@@ -820,7 +820,7 @@ PackagePrivate::PackagePrivate()
+     : QSharedData(),
+       fallbackPackage(nullptr),
+       metadata(nullptr),
+-      externalPaths(false),
++      externalPaths(true),
+       valid(false),
+       checkedValid(false)
+ {
-- 
2.13.7





Information forwarded to guix-patches <at> gnu.org:
bug#33820; Package guix-patches. (Fri, 21 Dec 2018 10:04:05 GMT) Full text and rfc822 format available.

Message #29 received at 33820 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 33820 <at> debbugs.gnu.org
Subject: [PATCH 7/9] gnu: kinit: Use LIBRARY_PATH to search for dynamically
 loaded libs.
Date: Fri, 21 Dec 2018 11:10:50 +0100
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





Information forwarded to guix-patches <at> gnu.org:
bug#33820; Package guix-patches. (Fri, 21 Dec 2018 10:04:05 GMT) Full text and rfc822 format available.

Message #32 received at 33820 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 33820 <at> debbugs.gnu.org
Subject: [PATCH 9/9] gnu: kservice: Transfer patches from NixOS.
Date: Fri, 21 Dec 2018 11:10:52 +0100
Transfer the NixOS patches for kservice as of 2018-02-17.
- Make QDirIterator follow symlinks.
- Normalize path, but don't resolve symlinks.

* gnu/packages/kde-frameworks.scm(kservice)<patch>: New phase.
---
 gnu/packages/kde-frameworks.scm | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/gnu/packages/kde-frameworks.scm b/gnu/packages/kde-frameworks.scm
index 65233f72e..645252288 100644
--- a/gnu/packages/kde-frameworks.scm
+++ b/gnu/packages/kde-frameworks.scm
@@ -3000,6 +3000,20 @@ typed.")
      `(#:tests? #f ; FIXME: 6/10 tests fail.
        #:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           ;; Adopted from NixOS' patches "qdiriterator-follow-symlinks" and
+           ;; "no-canonicalize-path".
+           (lambda _
+             (substitute* "src/sycoca/kbuildsycoca.cpp"
+               ;; make QDirIterator follow symlinks
+               (("^\\s*(QDirIterator it\\(.*, QDirIterator::Subdirectories)(\\);)" _ a b)
+                (string-append a " | QDirIterator::FollowSymlinks" b)))
+             (substitute* "src/sycoca/vfolder_menu.cpp"
+               ;; Normalize path, but don't resolve symlinks (taken from
+               ;; NixOS)
+               (("^\\s*QString resolved = QDir\\(dir\\)\\.canonicalPath\\(\\);")
+                "QString resolved = QDir::cleanPath(dir);"))
+             #t))
          (add-before 'check 'check-setup
            (lambda _
              (setenv "HOME" (getcwd))
-- 
2.13.7





Reply sent to Hartmut Goebel <h.goebel <at> crazy-compilers.com>:
You have taken responsibility. (Fri, 04 Jan 2019 09:29:01 GMT) Full text and rfc822 format available.

Notification sent to Hartmut Goebel <h.goebel <at> crazy-compilers.com>:
bug acknowledged by developer. (Fri, 04 Jan 2019 09:29:02 GMT) Full text and rfc822 format available.

Message #37 received at 33820-done <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 33820-done <at> debbugs.gnu.org
Subject: Re: bug#33820: Acknowledgement ([PATCH 0/9] Adopt NixOS patches for
 KDE Frameworks)
Date: Fri, 4 Jan 2019 10:28:02 +0100
Applied as fb0356d9564255b6a983960d06d274b3ee3a1903






bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 01 Feb 2019 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 85 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.