all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: iyzsong@outlook.com
To: 45064@debbugs.gnu.org
Cc: 宋文武 <iyzsong@member.fsf.org>
Subject: [bug#45064] [PATCH 1/2] profiles: Load application specific startup files.
Date: Sun,  6 Dec 2020 14:15:14 +0800	[thread overview]
Message-ID: <TYAP286MB01857F3A772A5768FC7EC801A3CF0@TYAP286MB0185.JPNP286.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <TYAP286MB018580C92BF3E9783BD56362A3CF0@TYAP286MB0185.JPNP286.PROD.OUTLOOK.COM>

From: 宋文武 <iyzsong@member.fsf.org>

* guix/build/profiles.scm (build-etc/profile): Source application specific
startup files in 'etc/profile.d'.
---
 guix/build/profiles.scm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/guix/build/profiles.scm b/guix/build/profiles.scm
index 67ee9b665a..25165e0edb 100644
--- a/guix/build/profiles.scm
+++ b/guix/build/profiles.scm
@@ -98,7 +98,17 @@ definitions for all the SEARCH-PATHS."
       (let ((variables (evaluate-search-paths search-paths
                                               (list output))))
         (for-each (write-environment-variable-definition port)
-                  (map (abstract-profile output) variables))))))
+                  (map (abstract-profile output) variables)))
+
+      (simple-format port "
+# Load application specific startup files.
+if test -d ~a/etc/profile.d; then
+    for script in ~a/etc/profile.d/*.sh; do
+        source \"$script\"
+    done
+    unset script
+fi
+\n" output output))))
 
 (define* (ensure-writable-directory directory
                                     #:key (symlink symlink))
-- 
2.29.2





  reply	other threads:[~2020-12-06 16:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-06  5:40 [bug#45064] [PATCH 0/2] Set environment variables for GTK+ input methods via profile startup files iyzsong
2020-12-06  6:15 ` iyzsong [this message]
2020-12-07 12:09 ` Leo Prikler
2020-12-07 13:55   ` 宋文武
2020-12-07 14:47     ` Leo Prikler

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

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

  git send-email \
    --in-reply-to=TYAP286MB01857F3A772A5768FC7EC801A3CF0@TYAP286MB0185.JPNP286.PROD.OUTLOOK.COM \
    --to=iyzsong@outlook.com \
    --cc=45064@debbugs.gnu.org \
    --cc=iyzsong@member.fsf.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.