From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Huang\, Ying" Subject: Re: [PATCH -v2] Fix gtk-im-modules for Gtk+3 Date: Fri, 03 Feb 2017 19:21:56 +0800 Message-ID: <87a8a3r02z.fsf@163.com> References: <20170130030649.1716-1-huang_ying_caritas@163.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41591) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZcBT-00069Q-Rp for guix-devel@gnu.org; Fri, 03 Feb 2017 06:37:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cZcBP-0005VE-Si for guix-devel@gnu.org; Fri, 03 Feb 2017 06:37:43 -0500 Received: from mproxyhzb1.163.com ([123.58.178.201]:33155) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZcBO-0005QR-T5 for guix-devel@gnu.org; Fri, 03 Feb 2017 06:37:39 -0500 In-Reply-To: <20170130030649.1716-1-huang_ying_caritas@163.com> (huang ying caritas's message of "Mon, 30 Jan 2017 11:06:49 +0800") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org Hi, All, huang_ying_caritas@163.com writes: > From: Huang Ying > > Gtk+3 now have multiple outputs, so the gtk-query-immodules-3.0 should be find > in bin output. > > The fix works, but appears hacky, because I haven't read much guix source > code, so I don't know the best solution. I know this fix isn't good, but the problem exists. Could anyone help me to fix it properly? Without the fix, I could not use fcitx input method. Because XIM immodule will hang some applications like gedit. Best Regards, Huang, Ying > Signed-off-by: "Huang, Ying" > --- > guix/profiles.scm | 15 ++++++++++----- > 1 file changed, 10 insertions(+), 5 deletions(-) > > diff --git a/guix/profiles.scm b/guix/profiles.scm > index 495a9e2e7..9ae6dbf09 100644 > --- a/guix/profiles.scm > +++ b/guix/profiles.scm > @@ -476,7 +476,7 @@ replace it." > (cons (gexp-input thing output) deps))) > (manifest-entries manifest))) > > -(define* (manifest-lookup-package manifest name #:optional version) > +(define* (manifest-lookup-package manifest name #:optional version output) > "Return as a monadic value the first package or store path referenced by > MANIFEST that is named NAME and optionally has the given VERSION prefix, or #f > if not found." > @@ -499,6 +499,9 @@ if not found." > (and (string=? name name*) > (if version > (string-prefix? version version*) > + #t) > + (if output > + (string-suffix? output version*) > #t)))) > items)) > > @@ -737,9 +740,10 @@ creates the GTK+ 'icon-theme.cache' file for each theme." > for both major versions of GTK+." > > (mlet %store-monad ((gtk+ (manifest-lookup-package manifest "gtk+" "3")) > + (gtk+-bin (manifest-lookup-package manifest "gtk+" "3" "bin")) > (gtk+-2 (manifest-lookup-package manifest "gtk+" "2"))) > > - (define (build gtk gtk-version) > + (define (build gtk gtk-version gtk-bin out) > (let ((major (string-take gtk-version 1))) > (with-imported-modules '((guix build utils) > (guix build union) > @@ -756,7 +760,8 @@ for both major versions of GTK+." > > (let* ((prefix (string-append "/lib/gtk-" #$major ".0/" > #$gtk-version)) > - (query (string-append #$gtk "/bin/gtk-query-immodules-" > + (query (string-append (ungexp gtk-bin out) > + "/bin/gtk-query-immodules-" > #$major ".0")) > (destdir (string-append #$output prefix)) > (moddirs (cons (string-append #$gtk prefix "/immodules") > @@ -784,8 +789,8 @@ for both major versions of GTK+." > > ;; Don't run the hook when there's nothing to do. > (let ((gexp #~(begin > - #$(if gtk+ (build gtk+ "3.0.0") #t) > - #$(if gtk+-2 (build gtk+-2 "2.10.0") #t)))) > + #$(if gtk+ (build gtk+ "3.0.0" gtk+-bin "bin") #t) > + #$(if gtk+-2 (build gtk+-2 "2.10.0" gtk+-2 "out") #t)))) > (if (or gtk+ gtk+-2) > (gexp->derivation "gtk-im-modules" gexp > #:local-build? #t