[PATCH] guix: qt-build-system: Wrapped executables honor user's envvars.

  • Done
  • quality assurance status badge
Details
2 participants
  • Zhu Zihao
  • Hartmut Goebel
Owner
unassigned
Submitted by
Hartmut Goebel
Severity
normal
H
H
Hartmut Goebel wrote on 13 Dec 2020 16:41
(address . guix-patches@gnu.org)
93d83462d1445ffd001039eebb1f2a84e6ccf3a9.1607873941.git.h.goebel@crazy-compilers.com
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-build-system.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-build-system.scm | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

Toggle diff (26 lines)
diff --git a/guix/build/qt-build-system.scm b/guix/build/qt-build-system.scm
index 005157b0a4..72d2d3b03b 100644
--- a/guix/build/qt-build-system.scm
+++ b/guix/build/qt-build-system.scm
@@ -60,14 +60,14 @@
(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-all-programs #:key inputs outputs
(qt-wrap-excluded-outputs '())
--
2.21.3
Z
Z
Zhu Zihao wrote on 18 Dec 2020 05:14
(address . 45221@debbugs.gnu.org)(address . h.goebel@crazy-compilers.com)
86r1nnzr63.fsf@163.com
Good work! I think this can help solve #45193[1].

And there're still some issues I mentioned in that issues.

1. We may need to fix `wrap-qt-program` in qt-utils.scm. It's
implementation is quite weird(See my reply in [1]). Or we can remove
this function and make package use

(assoc-ref qt-build-system:%standard-phases 'qt-wrap)

instead.

2. We should search directories in outputs, now we just search all
inputs. Some Qt programs were deployed with a bundle of Qt plugins in
their prefix. If we miss these dirs, they won't run.


--
Retrieve my PGP public key:

gpg --recv-keys D47A9C8B2AE3905B563D9135BE42B352A9F6821F

Zihao
-----BEGIN PGP SIGNATURE-----

iIsEARYIADMWIQTUepyLKuOQW1Y9kTW+QrNSqfaCHwUCX9wstBUcYWxsX2J1dF9s
YXN0QDE2My5jb20ACgkQvkKzUqn2gh9cCgEA+4F+klhZPot+usbQXY2O+rraohi5
A1lP+JD3H8SUt2gBANow0aDvq1bZhH4/kMZuEHt/To9oibkpWD/f8F/0zYAJ
=Xd1x
-----END PGP SIGNATURE-----

H
?