diff options
author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2021-04-10 00:49:04 -0400 |
---|---|---|
committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2021-04-10 00:55:18 -0400 |
commit | fed28a9632ba69225151757e44a5d70e9b0652a2 (patch) | |
tree | 88d6e1aff50d52a73571b31f3c307f9f50843ad3 | |
parent | fba9e5fb54b7eaff8d8cdc1163dac4ea7d0f8e89 (diff) | |
download | guix-fed28a9632ba69225151757e44a5d70e9b0652a2.tar guix-fed28a9632ba69225151757e44a5d70e9b0652a2.tar.gz |
build-system/qt: Fix wrapping with QTWEBENGINEPROCESS_PATH.
This is a follow up commit to 06eb21856f, which added QTWEBENGINEPROCESS_PATH
to the list of wrapped variables. Unfortunately it wouldn't be set, as its
value is a plain file rather than a directory, and the code only checked for
directories.
* guix/build/qt-build-system.scm (variables-for-wrapping): Define a file type
entry for each variable definition, and use it to determine if we should look
for directories versus plain files.
-rw-r--r-- | guix/build/qt-build-system.scm | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/guix/build/qt-build-system.scm b/guix/build/qt-build-system.scm index bd8e694209..f59b0c420f 100644 --- a/guix/build/qt-build-system.scm +++ b/guix/build/qt-build-system.scm @@ -49,17 +49,23 @@ (define (variables-for-wrapping base-directories) - (define (collect-sub-dirs base-directories subdirectory + (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))) @@ -67,8 +73,8 @@ (filter-map (match-lambda - ((variable directory selectors ...) - (match (collect-sub-dirs base-directories directory + ((variable file-type directory selectors ...) + (match (collect-sub-dirs base-directories file-type directory selectors) (() #f) @@ -77,7 +83,7 @@ ;; These shall match the search-path-specification for Qt and KDE ;; libraries. - (list '("XDG_DATA_DIRS" "/share" + (list '("XDG_DATA_DIRS" directory "/share" ;; These are "selectors": consider /share if and only if at least ;; one of these sub-directories exist. This avoids adding @@ -85,10 +91,11 @@ ;; /share sub-directory. "/glib-2.0/schemas" "/sounds" "/themes" "/cursors" "/wallpapers" "/icons" "/mime") - '("XDG_CONFIG_DIRS" "/etc/xdg") - '("QT_PLUGIN_PATH" "/lib/qt5/plugins") - '("QML2_IMPORT_PATH" "/lib/qt5/qml") - '("QTWEBENGINEPROCESS_PATH" "/lib/qt5/libexec/QtWebEngineProcess")))) + '("XDG_CONFIG_DIRS" directory "/etc/xdg") + '("QT_PLUGIN_PATH" directory "/lib/qt5/plugins") + '("QML2_IMPORT_PATH" directory "/lib/qt5/qml") + '("QTWEBENGINEPROCESS_PATH" regular + "/lib/qt5/libexec/QtWebEngineProcess")))) (define* (wrap-all-programs #:key inputs outputs (qt-wrap-excluded-outputs '()) |