From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Subject: [PATCH 2/5] profiles: gtk-icon-themes: Use 'gtk-update-icon-cache' from 'gtk+:bin'. Date: Sat, 6 Aug 2016 18:46:13 +0800 Message-ID: <20160806104616.13089-2-iyzsong@gmail.com> References: <20160806104616.13089-1-iyzsong@gmail.com> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVz7s-0000Eo-AI for guix-devel@gnu.org; Sat, 06 Aug 2016 06:46:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bVz7o-0005Bu-Os for guix-devel@gnu.org; Sat, 06 Aug 2016 06:46:42 -0400 Received: from mail.openmailbox.org ([62.4.1.34]:33832) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVz7o-0005Bq-IH for guix-devel@gnu.org; Sat, 06 Aug 2016 06:46:40 -0400 In-Reply-To: <20160806104616.13089-1-iyzsong@gmail.com> 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: guix-devel@gnu.org Cc: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= * guix/profiles.scm (gtk-icon-themes): Use 'gtk-update-icon-cacnhe' from the "bin" output of gtk+ package. --- guix/profiles.scm | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/guix/profiles.scm b/guix/profiles.scm index db807a8..9c2dbba 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -642,7 +642,18 @@ MANIFEST. Single-file bundles are required by programs such as Git and Lynx." (define (gtk-icon-themes manifest) "Return a derivation that unions all icon themes from manifest entries and creates the GTK+ 'icon-theme.cache' file for each theme." - (mlet %store-monad ((gtk+ (manifest-lookup-package manifest "gtk+"))) + (define gtk+ ; lazy reference + (module-ref (resolve-interface '(gnu packages gtk)) 'gtk+)) + + (mlet %store-monad ((%gtk+ (manifest-lookup-package manifest "gtk+")) + ;; XXX: Can't use gtk-update-icon-cache corresponding + ;; to the gtk+ referenced by 'manifest'. Because + ;; '%gtk+' can be either a package or store path, and + ;; there's no way to get the "bin" output for the later. + (gtk-update-icon-cache + -> #~(string-append #+gtk+:bin + "/bin/gtk-update-icon-cache"))) + (define build (with-imported-modules '((guix build utils) (guix build union) @@ -659,9 +670,7 @@ creates the GTK+ 'icon-theme.cache' file for each theme." (let* ((destdir (string-append #$output "/share/icons")) (icondirs (filter file-exists? (map (cut string-append <> "/share/icons") - '#$(manifest-inputs manifest)))) - (update-icon-cache (string-append - #+gtk+ "/bin/gtk-update-icon-cache"))) + '#$(manifest-inputs manifest))))) ;; Union all the icons. (mkdir-p (string-append #$output "/share")) @@ -676,11 +685,11 @@ creates the GTK+ 'icon-theme.cache' file for each theme." ;; "abiword_48.png". Ignore these. (when (file-is-directory? dir) (ensure-writable-directory dir) - (system* update-icon-cache "-t" dir "--quiet")))) + (system* #+gtk-update-icon-cache "-t" dir "--quiet")))) (scandir destdir (negate (cut member <> '("." ".."))))))))) ;; Don't run the hook when there's nothing to do. - (if gtk+ + (if %gtk+ (gexp->derivation "gtk-icon-themes" build #:local-build? #t #:substitutable? #f) -- 2.8.4