GNU bug report logs - #45064
[PATCH 0/2] Set environment variables for GTK+ input methods via profile startup files

Previous Next

Package: guix-patches;

Reported by: iyzsong <at> outlook.com

Date: Sun, 6 Dec 2020 06:07:01 UTC

Severity: normal

Tags: patch

Full log


View this message in rfc822 format

From: iyzsong <at> outlook.com
To: 45064 <at> debbugs.gnu.org
Cc: 宋文武 <iyzsong <at> 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
From: 宋文武 <iyzsong <at> 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





This bug report was last modified 4 years and 188 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.