unofficial mirror of guix-patches@gnu.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 2/2] profiles: gtk-im-modules: Set environment variables for input methods.
Date: Sun,  6 Dec 2020 14:15:15 +0800	[thread overview]
Message-ID: <TYAP286MB01853FA44EBA3C46C5CCE754A3CF0@TYAP286MB0185.JPNP286.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20201206061515.10449-1-iyzsong@outlook.com>

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

* guix/profiles.scm (gtk-im-modules): Set 'GUIX_GTK2_IM_MODULE_FILE' and
'GUIX_GTK3_IM_MODULE_FILE' via profile startup files.
---
 guix/profiles.scm | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/guix/profiles.scm b/guix/profiles.scm
index 1b15257210..c998329e8a 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -1151,7 +1151,10 @@ for both major versions of GTK+."
                                             (map (cut string-append <> prefix "/immodules")
                                                  '#$(manifest-inputs manifest)))))
                      (modules (append-map (cut find-files <> "\\.so$")
-                                          moddirs)))
+                                          moddirs))
+                     (im-env  (string-append "GUIX_GTK" #$major "_IM_MODULE_FILE"))
+                     (envfile (string-append #$output "/etc/profile.d/gtk"
+                                             #$major "-im-modules.sh")))
 
                 ;; Generate a new immodules cache file.
                 (mkdir-p (string-append #$output prefix))
@@ -1167,7 +1170,12 @@ for both major versions of GTK+."
                             (write-char (read-char pipe) out))))
                       #t)
                     (lambda ()
-                      (close-pipe pipe)))))))))
+                      (close-pipe pipe)))
+                  ;; Set environment variable for GTK+ input method modules.
+                  (mkdir-p (dirname envfile))
+                  (with-output-to-file envfile
+                    (lambda ()
+                      (simple-format #t "export ~a=~a\n" im-env outfile)))))))))
 
     ;; Don't run the hook when there's nothing to do.
     (let* ((pkg-gtk+ (module-ref        ; lazy reference
-- 
2.29.2





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

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20201206061515.10449-1-iyzsong@outlook.com>]

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=TYAP286MB01853FA44EBA3C46C5CCE754A3CF0@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 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).