From mboxrd@z Thu Jan 1 00:00:00 1970 From: iyzsong@member.fsf.org (=?utf-8?B?5a6L5paH5q2m?=) Subject: Re: [PATCH -v3] Fix gtk-im-modules for gtk+3 Date: Sun, 05 Feb 2017 14:39:14 +0800 Message-ID: <87k295dtv1.fsf@member.fsf.org> References: <20170205051145.4693-1-huang_ying_caritas@163.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35963) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1caGyz-00040I-K4 for guix-devel@gnu.org; Sun, 05 Feb 2017 02:11:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1caGyw-0000AJ-G2 for guix-devel@gnu.org; Sun, 05 Feb 2017 02:11:33 -0500 Received: from lb1.openmailbox.org ([5.79.108.160]:56332) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1caGyw-00007n-7Z for guix-devel@gnu.org; Sun, 05 Feb 2017 02:11:30 -0500 In-Reply-To: <20170205051145.4693-1-huang_ying_caritas@163.com> (huang ying caritas's message of "Sun, 5 Feb 2017 13:11:45 +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: huang_ying_caritas@163.com Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain 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 output "bin" instead of "out". > > * guix/profiles.scm (manifest-lookup-package): New argument output to select > package or store path. > (gtk-im-modules): Use "bin" output to find gtk-query-immodules-3.0 > > The fix works, but appears hacky, because I haven't read much guix source > code, so I don't know the best solution. > Thank you! The patch looks good to me, but: I think we can split this into 2 patches, one for adding output selecting to 'manifest-lookup-package' and another for fixing 'gtk-im-modules'. And to fix 'gtk-im-modules', we can pass the path of current 'gtk-query-modules-x.x' instead of the one in profile to the build procedure, so users don't need to install gtk+:bin explicitly (but it always pull in the dependency of latest gtk+:bin). This may or may not be the desired behavior... Here is what I mean: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-profiles-gtk-im-modules-Fix-for-gtk3.patch >From 54a9b4de63f87084984a1632800a039b155592f0 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 | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/guix/profiles.scm b/guix/profiles.scm index 495a9e2e7..cb93b8b67 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 @@ -784,8 +782,18 @@ 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" + #~(string-append + #$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 -- 2.11.0 --=-=-= Content-Type: text/plain It seems works and doesn't pull in both version of gtk+ when only one is installed, but I'm not sure :-) --=-=-=--