From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Huang\, Ying" Subject: Re: [PATCH -v3] Fix gtk-im-modules for gtk+3 Date: Thu, 09 Feb 2017 09:20:59 +0800 Message-ID: <87mvdw40sk.fsf@yhuang-dev.intel.com> References: <20170205051145.4693-1-huang_ying_caritas@163.com> <87k295dtv1.fsf@member.fsf.org> <871svdhs47.fsf@163.com> <87lgtj7bzq.fsf@member.fsf.org> <87vasna2m0.fsf@163.com> <87a89wvpn9.fsf@member.fsf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55310) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cbdQ4-0001rp-Uh for guix-devel@gnu.org; Wed, 08 Feb 2017 20:21:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cbdQ0-0003q5-1A for guix-devel@gnu.org; Wed, 08 Feb 2017 20:21:08 -0500 Received: from mga06.intel.com ([134.134.136.31]:12633) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cbdPz-0003pt-Lw for guix-devel@gnu.org; Wed, 08 Feb 2017 20:21:03 -0500 In-Reply-To: <87a89wvpn9.fsf@member.fsf.org> (=?utf-8?B?IuWui+aWh+atpiIn?= =?utf-8?B?cw==?= message of "Wed, 08 Feb 2017 20:22:02 +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: =?utf-8?B?5a6L5paH5q2m?= Cc: guix-devel@gnu.org iyzsong@member.fsf.org (宋文武) writes: > "Huang, Ying" writes: > >> Hi, Wenwu, >> >> iyzsong@member.fsf.org (宋文武) writes: >> >>> "Huang, Ying" writes: >>> >>>> [...] >>>>> - #$(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" >>>>> + #~(string-append >>>>> + #$gtk+:bin "/bin/gtk-query-immodules-3.0")) >>>> >>>> If "gtk+" is store path instead of package, this doesn't work. In a >>>> previous version, "gtk+" will be store path, it is package now. If it >>>> will always be package in the future. We can pass the store path of >>>> target output too. >>> >>> Oh, you're right! >>> >>> We can use the gtk+ package object here: >>> >>> [attachment] >>> >>> 0001-profiles-gtk-im-modules-Fix-for-gtk3.patch >>> >>> From a0b9a36b4e902fd6f456fa596c6220c708c35f71 Mon Sep 17 00:00:00 2001 >>> From: "huang_ying_caritas@163.com" >>> Date: Sun, 5 Feb 2017 13:41:47 +0800 >>> Subject: [PATCH] profiles: gtk-im-modules: Fix for gtk3. >>> >>> Gtk+3 now have multiple outputs, so the gtk-query-immodules-3.0 should be find >>> in output "bin" instead of "out". >>> >>> * guix/profiles.scm (gtk-im-modules): Pass the path of gtk-query-immodules-x.x >>> as 'query' argument to the 'build' procedure. >>> --- >>> guix/profiles.scm | 26 +++++++++++++++++++------- >>> 1 file changed, 19 insertions(+), 7 deletions(-) >>> >>> diff --git a/guix/profiles.scm b/guix/profiles.scm >>> index 495a9e2e7..de82eae34 100644 >>> --- a/guix/profiles.scm >>> +++ b/guix/profiles.scm >>> @@ -739,7 +739,7 @@ for both major versions of GTK+." >>> (mlet %store-monad ((gtk+ (manifest-lookup-package manifest "gtk+" "3")) >>> (gtk+-2 (manifest-lookup-package manifest "gtk+" "2"))) >>> >>> - (define (build gtk gtk-version) >>> + (define (build gtk gtk-version query) >>> (let ((major (string-take gtk-version 1))) >>> (with-imported-modules '((guix build utils) >>> (guix build union) >>> @@ -756,8 +756,6 @@ for both major versions of GTK+." >>> >>> (let* ((prefix (string-append "/lib/gtk-" #$major ".0/" >>> #$gtk-version)) >>> - (query (string-append #$gtk "/bin/gtk-query-immodules-" >>> - #$major ".0")) >>> (destdir (string-append #$output prefix)) >>> (moddirs (cons (string-append #$gtk prefix "/immodules") >>> (filter file-exists? >>> @@ -768,7 +766,7 @@ for both major versions of GTK+." >>> >>> ;; Generate a new immodules cache file. >>> (mkdir-p (string-append #$output prefix)) >>> - (let ((pipe (apply open-pipe* OPEN_READ query modules)) >>> + (let ((pipe (apply open-pipe* OPEN_READ #$query modules)) >>> (outfile (string-append #$output prefix >>> "/immodules-gtk" #$major ".cache"))) >>> (dynamic-wind >>> @@ -783,9 +781,23 @@ for both major versions of GTK+." >>> (close-pipe pipe))))))))) >>> >>> ;; 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)))) >>> + (let* ((pkg-gtk+ (module-ref ; lazy reference >>> + (resolve-interface '(gnu packages gtk)) 'gtk+)) >>> + (gexp #~(begin >>> + #$(if gtk+ >>> + (build >>> + gtk+ "3.0.0" >>> + ;; Use 'gtk-query-immodules-3.0' from the 'bin' >>> + ;; output of latest gtk+ package. >>> + #~(string-append >>> + #$pkg-gtk+:bin "/bin/gtk-query-immodules-3.0")) >>> + #t) >>> + #$(if gtk+-2 >>> + (build >>> + gtk+-2 "2.10.0" >>> + #~(string-append >>> + #$gtk+-2 "/bin/gtk-query-immodules-2.0")) >>> + #t)))) >>> (if (or gtk+ gtk+-2) >>> (gexp->derivation "gtk-im-modules" gexp >>> #:local-build? #t >> >> This should work. But I don't think it is perfect. It may refer to the >> gtk-query-immodules-3.0 not with the exact same version. > > Yes.. but it's acceptable, if we don't require and use gtk+:bin in > profile, then I think the latest gtk+ is the only choice? Yes. I think so. > Pushed, thank you! Thanks! Best Regards, Huang, Ying