unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH -v3] Fix gtk-im-modules for gtk+3
@ 2017-02-05  5:11 huang_ying_caritas
  2017-02-05  6:39 ` 宋文武
  0 siblings, 1 reply; 7+ messages in thread
From: huang_ying_caritas @ 2017-02-05  5:11 UTC (permalink / raw)
  To: guix-devel

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 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.

Signed-off-by: "Huang, Ying" <huang.ying.caritas@gmail.com>
---
 guix/profiles.scm | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/guix/profiles.scm b/guix/profiles.scm
index 495a9e2e7..3c32b86ba 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -476,10 +476,10 @@ 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."
+MANIFEST that is named NAME and optionally has the given VERSION prefix and
+OUTPUT, or #f if not found."
   ;; Return as a monadic value the package or store path referenced by the
   ;; manifest ENTRY, or #f if not referenced.
   (define (entry-lookup-package entry)
@@ -489,6 +489,9 @@ if not found."
                    (equal? name (package-name input))
                    (if version
                        (string-prefix? version (package-version input))
+                       #t)
+                   (if output
+                       (member output (package-outputs input))
                        #t)))
             inputs))
     (define (find-among-store-items items)
@@ -499,6 +502,9 @@ if not found."
                 (and (string=? name name*)
                      (if version
                          (string-prefix? version version*)
+                         #t)
+                     (if output
+                         (string-suffix? (string-append "-" output) version*)
                          #t))))
             items))
 
@@ -737,9 +743,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 +763,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 +792,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.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-02-09  1:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-05  5:11 [PATCH -v3] Fix gtk-im-modules for gtk+3 huang_ying_caritas
2017-02-05  6:39 ` 宋文武
2017-02-05 10:03   ` Huang, Ying
2017-02-06 12:14     ` 宋文武
2017-02-06 13:08       ` Huang, Ying
2017-02-08 12:22         ` 宋文武
2017-02-09  1:20           ` Huang, Ying

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).