From 7e24e1e58d6f53d9c77f6015229d0c35f7e66bca Mon Sep 17 00:00:00 2001 From: Hartmut Goebel Date: Fri, 25 Dec 2020 23:02:18 +0100 Subject: guix: qt-build-system, qt-utils: Unify wrapping of qt-programs. Unify (guix qt-build-system wrap-all-programs) and (guix qt-utils wrap-qt-program), so both behave the same. The functions now reside in qt-utils to make them easily available for packages not using the qt-build-system. * guix/build/qt-build-system.scm (variables-for-wrapping, wrap-all-programs): Move from here ... * guix/build/qt-utils.scm (variables-for-wrapping, wrap-all-qt-programs): ... to here. Base the later on (wrap-qt-program*): New function, carved out from old wrap-all-programs. (wrap-qt-program): Base on wrap-qt-program*, change arguments in an incompatible way. * gnu/packages/bittorrent.scm (qbittorrent)[arguments]{wrap-qt}: Adjust to new interface of wrap-qt-program. * gnu/packages/finance.scm (electron-cash): Likewise. * gnu/packages/geo.scm (qgis): Likewise. * gnu/packages/password-utils.scm (qtpass): Likewise. * gnu/packages/video.scm (openshot): Likewise. * gnu/packages/web-browsers.scm (kristall): Likewise. --- guix/build/qt-utils.scm | 105 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 85 insertions(+), 20 deletions(-) (limited to 'guix/build/qt-utils.scm') diff --git a/guix/build/qt-utils.scm b/guix/build/qt-utils.scm index d2486ee86c..3fbdb6be61 100644 --- a/guix/build/qt-utils.scm +++ b/guix/build/qt-utils.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016 David Craven +;;; Copyright © 2019, 2020, 2021 Hartmut Goebel ;;; ;;; This file is part of GNU Guix. ;;; @@ -18,23 +19,87 @@ (define-module (guix build qt-utils) #:use-module (guix build utils) - #:export (wrap-qt-program)) - -(define (wrap-qt-program out program) - (define (suffix env-var path) - (let ((env-val (getenv env-var))) - (if env-val (string-append env-val ":" path) path))) - - (let ((qml-path (suffix "QML2_IMPORT_PATH" - (string-append out "/lib/qt5/qml"))) - (plugin-path (suffix "QT_PLUGIN_PATH" - (string-append out "/lib/qt5/plugins"))) - (xdg-data-path (suffix "XDG_DATA_DIRS" - (string-append out "/share"))) - (xdg-config-path (suffix "XDG_CONFIG_DIRS" - (string-append out "/etc/xdg")))) - (wrap-program (string-append out "/bin/" program) - `("QML2_IMPORT_PATH" = (,qml-path)) - `("QT_PLUGIN_PATH" = (,plugin-path)) - `("XDG_DATA_DIRS" = (,xdg-data-path)) - `("XDG_CONFIG_DIRS" = (,xdg-config-path))))) + #:use-module (ice-9 match) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) + #:export (wrap-qt-program + wrap-all-qt-programs)) + + +(define (variables-for-wrapping base-directories) + + (define (collect-sub-dirs base-directories subdirectory) + (filter-map + (lambda (dir) + (let ((directory (string-append dir subdirectory))) + (if (directory-exists? directory) directory #f))) + base-directories)) + + (filter + (lambda (var-to-wrap) (not (null? (last var-to-wrap)))) + (map + (lambda (var-spec) + `(,(first var-spec) = ,(collect-sub-dirs base-directories (last var-spec)))) + (list + ;; these shall match the search-path-specification for Qt and KDE + ;; libraries + '("XDG_DATA_DIRS" "/share") + '("XDG_CONFIG_DIRS" "/etc/xdg") + '("QT_PLUGIN_PATH" "/lib/qt5/plugins") + '("QML2_IMPORT_PATH" "/lib/qt5/qml"))))) + + +(define* (wrap-qt-program* program #:key inputs output-dir) + + (define input-directories + ;; FIXME: Filter out unwanted inputs, e.g. cmake + (match inputs + (((_ . dir) ...) + dir))) + + (let ((vars-to-wrap (variables-for-wrapping + (cons output-dir input-directories)))) + (when (not (null? vars-to-wrap)) + (apply wrap-program program vars-to-wrap)))) + + +(define* (wrap-qt-program program-name #:key inputs output) + "Wrap the specified programm (which must reside in the OUTPUT's \"/bin\" +directory) with suitably set environment variables. + +This is like qt-build-systems's phase \"qt-wrap\", but only the named program +is wrapped." + (wrap-qt-program* (string-append output "/bin/" program-name) + #:output-dir output #:inputs inputs)) + + +(define* (wrap-all-qt-programs #:key inputs outputs + (qt-wrap-excluded-outputs '()) + #:allow-other-keys) + "Implement qt-build-systems's phase \"qt-wrap\": look for executables in +\"bin\", \"sbin\" and \"libexec\" of all outputs and create wrappers with +suitably set environment variables if found. + +Wrapping is not applied to outputs whose name is listed in +QT-WRAP-EXCLUDED-OUTPUTS. This is useful when an output is known not +to contain any Qt binaries, and where wrapping would gratuitously +add a dependency of that output on Qt." + (define (find-files-to-wrap output-dir) + (append-map + (lambda (dir) + (if (directory-exists? dir) (find-files dir ".*") (list))) + (list (string-append output-dir "/bin") + (string-append output-dir "/sbin") + (string-append output-dir "/libexec") + (string-append output-dir "/lib/libexec")))) + + (define handle-output + (match-lambda + ((output . output-dir) + (unless (member output qt-wrap-excluded-outputs) + (for-each (cut wrap-qt-program* <> + #:output-dir output-dir #:inputs inputs) + (find-files-to-wrap output-dir)))))) + + (for-each handle-output outputs) + #t) -- cgit v1.2.3 From 30759c4aadf279e470e8d7f94de332a31c1b9f42 Mon Sep 17 00:00:00 2001 From: Hartmut Goebel Date: Wed, 19 Aug 2020 10:44:27 +0200 Subject: guix: qt-utils: Wrapped executables honor user's envvars. Prior to this change, wrappers did set the specified environment variables to a fixed value, overwriting any user settings. This inhibited propagating e.g. XDG_DATA_DIRS from a profile to the application. Now user environment variables are prefixed (if the variable defines some "binary" search path, e.g. QT_PLUGIN_PATH) or suffixed (if the variable defines some config or data search path, e.g. XDG_DATA_DIRS). The code could also allow to overwrite, anyhow currently no variable is defined like this. * guix/build/qt-utils.scm (variables-for-wrapping): For each env-var to be wrapped, specify whether it should prefix, suffix or overwrite the user's variable. --- guix/build/qt-utils.scm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'guix/build/qt-utils.scm') diff --git a/guix/build/qt-utils.scm b/guix/build/qt-utils.scm index 3fbdb6be61..030059522d 100644 --- a/guix/build/qt-utils.scm +++ b/guix/build/qt-utils.scm @@ -39,14 +39,15 @@ (lambda (var-to-wrap) (not (null? (last var-to-wrap)))) (map (lambda (var-spec) - `(,(first var-spec) = ,(collect-sub-dirs base-directories (last var-spec)))) + (list (first var-spec) (second var-spec) + (collect-sub-dirs base-directories (third var-spec)))) (list ;; these shall match the search-path-specification for Qt and KDE ;; libraries - '("XDG_DATA_DIRS" "/share") - '("XDG_CONFIG_DIRS" "/etc/xdg") - '("QT_PLUGIN_PATH" "/lib/qt5/plugins") - '("QML2_IMPORT_PATH" "/lib/qt5/qml"))))) + '("XDG_DATA_DIRS" suffix "/share") + '("XDG_CONFIG_DIRS" suffix "/etc/xdg") + '("QT_PLUGIN_PATH" prefix "/lib/qt5/plugins") + '("QML2_IMPORT_PATH" prefix "/lib/qt5/qml"))))) (define* (wrap-qt-program* program #:key inputs output-dir) -- cgit v1.2.3 From 76174aa9914c55219bfb9169f7fc565edccad940 Mon Sep 17 00:00:00 2001 From: Jakub Kądziołka Date: Sun, 10 Jan 2021 18:49:12 +0100 Subject: build-system: qt: Exclude useless inputs from wrapped variables. * guix/build-system/qt.scm (qt-build)[qt-wrap-excluded-inputs]: New argument. * guix/build/qt-utils.scm (%qt-wrap-excluded-inputs): New variable. (wrap-qt-program*)[qt-wrap-excluded-inputs]: New argument. Filter excluded inputs. (wrap-qt-program)[qt-wrap-excluded-inputs]: New argument. (wrap-all-qt-programs)[qt-wrap-excluded-inputs]: New argument. Co-authored-by: Hartmut Goebel --- guix/build-system/qt.scm | 5 +++++ guix/build/qt-utils.scm | 29 ++++++++++++++++++++--------- 2 files changed, 25 insertions(+), 9 deletions(-) (limited to 'guix/build/qt-utils.scm') diff --git a/guix/build-system/qt.scm b/guix/build-system/qt.scm index 1bd89bfa4d..e1368db1d9 100644 --- a/guix/build-system/qt.scm +++ b/guix/build-system/qt.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2013 Cyril Roelandt ;;; Copyright © 2017 Ricardo Wurmus ;;; Copyright © 2019 Hartmut Goebel +;;; Copyright © 2020 Jakub Kądziołka ;;; ;;; This file is part of GNU Guix. ;;; @@ -22,6 +23,8 @@ (define-module (guix build-system qt) #:use-module (guix store) #:use-module (guix utils) + #:use-module ((guix build qt-utils) + #:select (%qt-wrap-excluded-inputs)) #:use-module (guix derivations) #:use-module (guix search-paths) #:use-module (guix build-system) @@ -125,6 +128,7 @@ (phases '(@ (guix build qt-build-system) %standard-phases)) (qt-wrap-excluded-outputs ''()) + (qt-wrap-excluded-inputs %qt-wrap-excluded-inputs) (system (%current-system)) (imported-modules %qt-build-system-modules) (modules '((guix build qt-build-system) @@ -148,6 +152,7 @@ provides a 'CMakeLists.txt' file as its build system." search-paths) #:phases ,phases #:qt-wrap-excluded-outputs ,qt-wrap-excluded-outputs + #:qt-wrap-excluded-inputs ,qt-wrap-excluded-inputs #:configure-flags ,configure-flags #:make-flags ,make-flags #:out-of-source? ,out-of-source? diff --git a/guix/build/qt-utils.scm b/guix/build/qt-utils.scm index 030059522d..a03b09f05e 100644 --- a/guix/build/qt-utils.scm +++ b/guix/build/qt-utils.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016 David Craven ;;; Copyright © 2019, 2020, 2021 Hartmut Goebel +;;; Copyright © 2020 Jakub Kądziołka ;;; ;;; This file is part of GNU Guix. ;;; @@ -23,8 +24,11 @@ #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:export (wrap-qt-program - wrap-all-qt-programs)) + wrap-all-qt-programs + %qt-wrap-excluded-inputs)) +(define %qt-wrap-excluded-inputs + '(list "cmake" "extra-cmake-modules" "qttools")) (define (variables-for-wrapping base-directories) @@ -50,13 +54,16 @@ '("QML2_IMPORT_PATH" prefix "/lib/qt5/qml"))))) -(define* (wrap-qt-program* program #:key inputs output-dir) +(define* (wrap-qt-program* program #:key inputs output-dir + qt-wrap-excluded-inputs) (define input-directories - ;; FIXME: Filter out unwanted inputs, e.g. cmake - (match inputs - (((_ . dir) ...) - dir))) + (filter-map + (match-lambda + ((label . directory) + (and (not (member label qt-wrap-excluded-inputs)) + directory))) + inputs)) (let ((vars-to-wrap (variables-for-wrapping (cons output-dir input-directories)))) @@ -64,18 +71,21 @@ (apply wrap-program program vars-to-wrap)))) -(define* (wrap-qt-program program-name #:key inputs output) +(define* (wrap-qt-program program-name #:key inputs output + (qt-wrap-excluded-inputs %qt-wrap-excluded-inputs)) "Wrap the specified programm (which must reside in the OUTPUT's \"/bin\" directory) with suitably set environment variables. This is like qt-build-systems's phase \"qt-wrap\", but only the named program is wrapped." (wrap-qt-program* (string-append output "/bin/" program-name) - #:output-dir output #:inputs inputs)) + #:output-dir output #:inputs inputs + #:qt-wrap-excluded-inputs qt-wrap-excluded-inputs)) (define* (wrap-all-qt-programs #:key inputs outputs (qt-wrap-excluded-outputs '()) + (qt-wrap-excluded-inputs %qt-wrap-excluded-inputs) #:allow-other-keys) "Implement qt-build-systems's phase \"qt-wrap\": look for executables in \"bin\", \"sbin\" and \"libexec\" of all outputs and create wrappers with @@ -99,7 +109,8 @@ add a dependency of that output on Qt." ((output . output-dir) (unless (member output qt-wrap-excluded-outputs) (for-each (cut wrap-qt-program* <> - #:output-dir output-dir #:inputs inputs) + #:output-dir output-dir #:inputs inputs + #:qt-wrap-excluded-inputs qt-wrap-excluded-inputs) (find-files-to-wrap output-dir)))))) (for-each handle-output outputs) -- cgit v1.2.3 From 86c9f5a5fa60b0344d2c521f1c08a912a8cce872 Mon Sep 17 00:00:00 2001 From: Jakub Kądziołka Date: Sun, 10 Jan 2021 21:28:36 +0100 Subject: guix: qt-utils: Don't include useless inputs in wrapped variables. 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 --- guix/build/qt-utils.scm | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) (limited to 'guix/build/qt-utils.scm') 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)))) -- cgit v1.2.3 From 20cf23e4f89ad97bd089d87b9fe2622fecd088ee Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 2 Jul 2021 13:49:00 -0400 Subject: build: qt-utils: Refactor the code to filter XDG_DATA_DIRS. This partially reinstate the reverted c5fd1b0bd362f8b8578a76a26a65ba5d00d48992. * guix/build/qt-utils.scm (variables-for-wrapping)[collect-sub-dirs]: Add 'selectors' parameter and honor it. Change caller to handle selectors. Modified-by: Maxim Cournoyer --- guix/build/qt-utils.scm | 70 +++++++++++++++++++++++++------------------------ 1 file changed, 36 insertions(+), 34 deletions(-) (limited to 'guix/build/qt-utils.scm') diff --git a/guix/build/qt-utils.scm b/guix/build/qt-utils.scm index 8e6db10ca1..9f09623ddc 100644 --- a/guix/build/qt-utils.scm +++ b/guix/build/qt-utils.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2016 David Craven ;;; Copyright © 2019, 2020, 2021 Hartmut Goebel ;;; Copyright © 2020 Jakub Kądziołka +;;; Copyright © 2021 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -36,40 +37,41 @@ ;; contain any of the standard subdirectories. (define (variables-for-wrapping base-directories output-directory) - (define (collect-sub-dirs base-directories subdirectory-spec) - (filter-map - (lambda (dir) - (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 - (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" ("/applications" "/fonts" - "/icons" "/mime")) - '("XDG_CONFIG_DIRS" suffix "/etc/xdg") - '("QT_PLUGIN_PATH" prefix "/lib/qt5/plugins") - '("QML2_IMPORT_PATH" prefix "/lib/qt5/qml"))))) - + (define (collect-sub-dirs base-directories subdirectory selectors) + ;; Append SUBDIRECTORY and each of BASE-DIRECTORIES, and return the subset + ;; that exists and has at least one of the SELECTORS sub-directories, + ;; unless SELECTORS is the empty list. + (filter-map (lambda (dir) + (let ((directory (string-append dir subdirectory))) + (and (directory-exists? directory) + (or (null? selectors) + (any (lambda (selector) + (directory-exists? + (string-append directory selector))) + selectors)) + directory))) + base-directories)) + + (filter-map + (match-lambda + ((variable type directory selectors ...) + (match (collect-sub-dirs base-directories directory selectors) + (() + #f) + (directories + `(,variable ,type ,directories))))) + ;; These shall match the search-path-specification for Qt and KDE + ;; libraries. + (list '("XDG_DATA_DIRS" suffix "/share" + ;; These are "selectors": consider /share if and only if at least + ;; one of these sub-directories exist. This avoids adding + ;; irrelevant packages to XDG_DATA_DIRS just because they have a + ;; /share sub-directory. + "/applications" "/cursors" "/fonts" "/icons" "/glib-2.0/schemas" + "/mime" "/sounds" "/themes" "/wallpapers") + '("XDG_CONFIG_DIRS" suffix "/etc/xdg") + '("QT_PLUGIN_PATH" prefix "/lib/qt5/plugins") + '("QML2_IMPORT_PATH" prefix "/lib/qt5/qml")))) (define* (wrap-qt-program* program #:key inputs output-dir qt-wrap-excluded-inputs) -- cgit v1.2.3 From d5c9cc6d9d979bfca5f035429bcf510a0a2285a3 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Fri, 2 Jul 2021 14:05:38 -0400 Subject: build: qt-utils: Wrappers set 'QTWEBENGINEPROCESS_PATH' if needed. This reinstate commit the reverted fed28a9632ba69225151757e44a5d70e9b0652a2, now rebased on top of conflicting changes. * guix/build/qt-utils.scm: Remove extraneous newlines. (variables-for-wrapping): Add comments. Define a file type entry for each variable definition, and use it to determine if we should look for directories versus plain files. : New environment variable. (wrap-all-qt-programs): Remove trailing #t. --- guix/build/qt-utils.scm | 54 +++++++++++++++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 20 deletions(-) (limited to 'guix/build/qt-utils.scm') diff --git a/guix/build/qt-utils.scm b/guix/build/qt-utils.scm index 9f09623ddc..c2b80cab7d 100644 --- a/guix/build/qt-utils.scm +++ b/guix/build/qt-utils.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2019, 2020, 2021 Hartmut Goebel ;;; Copyright © 2020 Jakub Kądziołka ;;; Copyright © 2021 Ludovic Courtès +;;; Copyright © 2021 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -37,16 +38,22 @@ ;; contain any of the standard subdirectories. (define (variables-for-wrapping base-directories output-directory) - (define (collect-sub-dirs base-directories subdirectory selectors) + (define (collect-sub-dirs base-directories file-type subdirectory selectors) ;; Append SUBDIRECTORY and each of BASE-DIRECTORIES, and return the subset ;; that exists and has at least one of the SELECTORS sub-directories, - ;; unless SELECTORS is the empty list. + ;; unless SELECTORS is the empty list. FILE-TYPE should by 'directory or + ;; 'regular file. For the later, it allows searching for plain files + ;; rather than directories. + (define exists? (match file-type + ('directory directory-exists?) + ('regular file-exists?))) + (filter-map (lambda (dir) (let ((directory (string-append dir subdirectory))) - (and (directory-exists? directory) + (and (exists? directory) (or (null? selectors) (any (lambda (selector) - (directory-exists? + (exists? (string-append directory selector))) selectors)) directory))) @@ -54,24 +61,34 @@ (filter-map (match-lambda - ((variable type directory selectors ...) - (match (collect-sub-dirs base-directories directory selectors) + ((variable type file-type directory selectors ...) + (match (collect-sub-dirs base-directories file-type directory selectors) (() #f) (directories `(,variable ,type ,directories))))) ;; These shall match the search-path-specification for Qt and KDE ;; libraries. - (list '("XDG_DATA_DIRS" suffix "/share" - ;; These are "selectors": consider /share if and only if at least - ;; one of these sub-directories exist. This avoids adding - ;; irrelevant packages to XDG_DATA_DIRS just because they have a - ;; /share sub-directory. - "/applications" "/cursors" "/fonts" "/icons" "/glib-2.0/schemas" - "/mime" "/sounds" "/themes" "/wallpapers") - '("XDG_CONFIG_DIRS" suffix "/etc/xdg") - '("QT_PLUGIN_PATH" prefix "/lib/qt5/plugins") - '("QML2_IMPORT_PATH" prefix "/lib/qt5/qml")))) + (list + ;; The XDG environment variables are defined with the 'suffix type, which + ;; allows the users to override or extend their value, so that custom icon + ;; themes can be honored, for example. + '("XDG_DATA_DIRS" suffix directory "/share" + ;; These are "selectors": consider /share if and only if at least + ;; one of these sub-directories exist. This avoids adding + ;; irrelevant packages to XDG_DATA_DIRS just because they have a + ;; /share sub-directory. + "/applications" "/cursors" "/fonts" "/icons" "/glib-2.0/schemas" + "/mime" "/sounds" "/themes" "/wallpapers") + '("XDG_CONFIG_DIRS" suffix directory "/etc/xdg") + ;; The following variables can be extended by the user, but not + ;; overridden, to ensure proper operation. + '("QT_PLUGIN_PATH" prefix directory "/lib/qt5/plugins") + '("QML2_IMPORT_PATH" prefix directory "/lib/qt5/qml") + ;; QTWEBENGINEPROCESS_PATH accepts a single value, which makes 'exact the + ;; most suitable environment variable type for it. + '("QTWEBENGINEPROCESS_PATH" = regular + "/lib/qt5/libexec/QtWebEngineProcess")))) (define* (wrap-qt-program* program #:key inputs output-dir qt-wrap-excluded-inputs) @@ -90,7 +107,6 @@ (when (not (null? vars-to-wrap)) (apply wrap-program program vars-to-wrap)))) - (define* (wrap-qt-program program-name #:key inputs output (qt-wrap-excluded-inputs %qt-wrap-excluded-inputs)) "Wrap the specified programm (which must reside in the OUTPUT's \"/bin\" @@ -102,7 +118,6 @@ is wrapped." #:output-dir output #:inputs inputs #:qt-wrap-excluded-inputs qt-wrap-excluded-inputs)) - (define* (wrap-all-qt-programs #:key inputs outputs (qt-wrap-excluded-outputs '()) (qt-wrap-excluded-inputs %qt-wrap-excluded-inputs) @@ -133,5 +148,4 @@ add a dependency of that output on Qt." #:qt-wrap-excluded-inputs qt-wrap-excluded-inputs) (find-files-to-wrap output-dir)))))) - (for-each handle-output outputs) - #t) + (for-each handle-output outputs)) -- cgit v1.2.3