[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Fix gtk-im-modules for Gtk+3

From: huang_ying_caritas
Subject: [PATCH] Fix gtk-im-modules for Gtk+3
Date: Sun, 29 Jan 2017 16:22:18 +0800

From: Huang Ying <address@hidden>

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" <address@hidden>
 guix/profiles.scm | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/guix/profiles.scm b/guix/profiles.scm
index 495a9e2e7..9678cfcad 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."
@@ -489,7 +489,9 @@ if not found."
                    (equal? name (package-name input))
                    (if version
                        (string-prefix? version (package-version input))
-                       #t)))
+                       #t)
+                   (if output
+                       (string-suffix? output (package-output input)))))
     (define (find-among-store-items items)
       (find (lambda (item)
@@ -499,6 +501,9 @@ if not found."
                 (and (string=? name name*)
                      (if version
                          (string-prefix? version version*)
+                         #t)
+                     (if output
+                         (string-suffix? output version*)
@@ -737,9 +742,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" 
                       (gtk+-2 (manifest-lookup-package manifest "gtk+" "2")))
-    (define (build gtk gtk-version)
+    (define (build gtk gtk-version gtk-bin)
       (let ((major (string-take gtk-version 1)))
         (with-imported-modules '((guix build utils)
                                  (guix build union)
@@ -756,7 +762,7 @@ for both major versions of GTK+."
               (let* ((prefix  (string-append "/lib/gtk-" #$major ".0/"
-                     (query   (string-append #$gtk "/bin/gtk-query-immodules-"
+                     (query   (string-append #$gtk-bin 
                                              #$major ".0"))
                      (destdir (string-append #$output prefix))
                      (moddirs (cons (string-append #$gtk prefix "/immodules")
@@ -784,8 +790,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)  #t)
+                    #$(if gtk+-2 (build gtk+-2 "2.10.0" gtk+-2) #t))))
       (if (or gtk+ gtk+-2)
           (gexp->derivation "gtk-im-modules" gexp
                             #:local-build? #t

reply via email to

[Prev in Thread] Current Thread [Next in Thread]