[bug#33820,9/9] gnu: kservice: Transfer patches from NixOS.

Message ID 20181221101052.26832-9-h.goebel@crazy-compilers.com
State Accepted
Commit fb0356d9564255b6a983960d06d274b3ee3a1903
Headers show
Series Adopt NixOS patches for KDE Frameworks | expand

Checks

Context Check Description
cbaines/applying patch fail Apply failed
cbaines/applying patch fail Apply failed
cbaines/applying patch fail Apply failed
cbaines/applying patch fail Apply failed
cbaines/applying patch fail Apply failed

Commit Message

Hartmut Goebel Dec. 21, 2018, 10:10 a.m. UTC
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(+)

Patch

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))