unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Hartmut Goebel <h.goebel@crazy-compilers.com>
To: 45193@debbugs.gnu.org, guix-patches@gnu.org
Subject: bug#45193: [PATCH 2/4] guix: qt-utils: Wrapped executables honor user's envvars.
Date: Mon, 11 Jan 2021 15:41:42 +0100	[thread overview]
Message-ID: <ceef8786cf0bf12fcec3fcce066d7f82f4bb746d.1610376081.git.h.goebel@crazy-compilers.com> (raw)
In-Reply-To: <e8cfff4ab1dd7f0c39875d22057e4ef45a10cc7b.1610376081.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-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(-)

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





       reply	other threads:[~2021-01-11 14:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <e8cfff4ab1dd7f0c39875d22057e4ef45a10cc7b.1610376081.git.h.goebel@crazy-compilers.com>
2021-01-11 14:41 ` Hartmut Goebel [this message]
2021-01-11 14:41 ` bug#45193: [PATCH 3/4] build-system: qt: Exclude useless inputs from wrapped variables Hartmut Goebel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ceef8786cf0bf12fcec3fcce066d7f82f4bb746d.1610376081.git.h.goebel@crazy-compilers.com \
    --to=h.goebel@crazy-compilers.com \
    --cc=45193@debbugs.gnu.org \
    --cc=guix-patches@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).