unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: huang_ying_caritas@163.com
To: guix-devel@gnu.org
Subject: [PATCH -v2] Fix gtk-im-modules for Gtk+3
Date: Mon, 30 Jan 2017 11:06:49 +0800	[thread overview]
Message-ID: <20170130030649.1716-1-huang_ying_caritas@163.com> (raw)

From: Huang Ying <huang.ying.caritas@gmail.com>

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.

Signed-off-by: "Huang, Ying" <huang.ying.caritas@gmail.com>
---
 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
-- 
2.11.0

             reply	other threads:[~2017-01-30  3:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-30  3:06 huang_ying_caritas [this message]
2017-02-03 11:21 ` [PATCH -v2] Fix gtk-im-modules for Gtk+3 Huang, Ying
2017-02-04 17:28 ` Danny Milosavljevic
2017-02-04 23:42   ` Huang, Ying
2017-02-06  1:08 ` Ricardo Wurmus
2017-02-06 10:28   ` Huang, Ying

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=20170130030649.1716-1-huang_ying_caritas@163.com \
    --to=huang_ying_caritas@163.com \
    --cc=guix-devel@gnu.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).