GNU bug report logs - #45787
[PATCH 4/4] guix: qt-utils: Don't include useless inputs in wrapped variables.

Previous Next

Package: guix-patches;

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

Date: Mon, 11 Jan 2021 14:43:04 UTC

Severity: normal

Tags: patch

Merged with 45784, 45785, 45786

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 45787 in the body.
You can then email your comments to 45787 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#45787; Package guix-patches. (Mon, 11 Jan 2021 14:43:04 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. (Mon, 11 Jan 2021 14:43:04 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: 45193 <at> debbugs.gnu.org,
	guix-patches <at> gnu.org
Cc: Jakub Kądziołka <kuba <at> kadziolka.net>
Subject: [PATCH 4/4] guix: qt-utils: Don't include useless inputs in wrapped
 variables.
Date: Mon, 11 Jan 2021 15:41:44 +0100
From: Jakub Kądziołka <kuba <at> kadziolka.net>

Include only those inputs into XDG_DATA_DIRS having
some subdirectory of /share which is typically used by Qt.

* guix/build/qt-utils.scm (variables-for-wrapping): Take the
  output directory as an argument for special handling. Check for
  subdirectories of /share used by Qt before including inputs in
  XDG_DATA_DIRS.
  (wrap-qt-program*): Pass the output directory to variables-for-wrapping.

Co-authored-by: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
---
 guix/build/qt-utils.scm | 36 +++++++++++++++++++++++++++---------
 1 file changed, 27 insertions(+), 9 deletions(-)

diff --git a/guix/build/qt-utils.scm b/guix/build/qt-utils.scm
index a03b09f05e..8e6db10ca1 100644
--- a/guix/build/qt-utils.scm
+++ b/guix/build/qt-utils.scm
@@ -30,25 +30,42 @@
 (define %qt-wrap-excluded-inputs
   '(list "cmake" "extra-cmake-modules" "qttools"))
 
-(define (variables-for-wrapping base-directories)
+;; NOTE: Apart from standard subdirectories of /share, Qt also provides
+;; facilities for per-application data directories, such as
+;; /share/quassel. Thus, we include the output directory even if it doesn't
+;; contain any of the standard subdirectories.
+(define (variables-for-wrapping base-directories output-directory)
 
-  (define (collect-sub-dirs base-directories subdirectory)
+  (define (collect-sub-dirs base-directories subdirectory-spec)
     (filter-map
      (lambda (dir)
-       (let ((directory (string-append dir subdirectory)))
-         (if (directory-exists? directory) directory #f)))
+       (match
+        subdirectory-spec
+        ((subdir)
+         (and (directory-exists? (string-append dir subdir))
+              (string-append dir (car subdirectory-spec))))
+        ((subdir children)
+         (and
+          (or
+           (and (string=? dir output-directory)
+                (directory-exists? (string-append dir subdir)))
+           (or-map
+            (lambda (kid) (directory-exists? (string-append dir subdir kid)))
+            children))
+          (string-append dir subdir)))))
      base-directories))
 
   (filter
    (lambda (var-to-wrap) (not (null? (last var-to-wrap))))
    (map
-    (lambda (var-spec)
-      (list (first var-spec) (second var-spec)
-            (collect-sub-dirs base-directories (third var-spec))))
+    (match-lambda
+     ((var kind . subdir-spec)
+      `(,var ,kind ,(collect-sub-dirs base-directories subdir-spec))))
     (list
      ;; these shall match the search-path-specification for Qt and KDE
      ;; libraries
-     '("XDG_DATA_DIRS" suffix "/share")
+     '("XDG_DATA_DIRS" suffix "/share" ("/applications" "/fonts"
+                                        "/icons" "/mime"))
      '("XDG_CONFIG_DIRS" suffix "/etc/xdg")
      '("QT_PLUGIN_PATH" prefix "/lib/qt5/plugins")
      '("QML2_IMPORT_PATH" prefix "/lib/qt5/qml")))))
@@ -66,7 +83,8 @@
      inputs))
 
   (let ((vars-to-wrap (variables-for-wrapping
-                       (cons output-dir input-directories))))
+                       (cons output-dir input-directories)
+                       output-dir)))
     (when (not (null? vars-to-wrap))
       (apply wrap-program program vars-to-wrap))))
 
-- 
2.21.3





Merged 45784 45785 45786 45787. Request was from Hartmut Goebel <h.goebel <at> goebel-consult.de> to control <at> debbugs.gnu.org. (Mon, 11 Jan 2021 15:47:02 GMT) Full text and rfc822 format available.

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

This bug report was last modified 4 years and 107 days ago.

Previous Next


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