* [PATCH] profiles: xdg-mime-database: Run the hook when have GLib based applications.
@ 2016-08-11 13:21 宋文武
0 siblings, 0 replies; only message in thread
From: 宋文武 @ 2016-08-11 13:21 UTC (permalink / raw)
To: guix-devel; +Cc: 宋文武
* guix/profiles.scm (xdg-mime-database): Run the hook when GLIB is referenced by
the manifest. Add SHARED-MIME-INFO to the mime packages of `update-mime-database'.
---
guix/profiles.scm | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/guix/profiles.scm b/guix/profiles.scm
index 9c2dbba..169c700 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -732,9 +732,12 @@ MIME type."
(define (xdg-mime-database manifest)
"Return a derivation that builds the @file{mime.cache} database from manifest
entries. It's used to query the MIME type of a given file."
- (mlet %store-monad ((shared-mime-info
+ (define shared-mime-info ; lazy reference
+ (module-ref (resolve-interface '(gnu packages gnome)) 'shared-mime-info))
+
+ (mlet %store-monad ((glib
(manifest-lookup-package
- manifest "shared-mime-info")))
+ manifest "glib")))
(define build
(with-imported-modules '((guix build utils)
(guix build union))
@@ -747,7 +750,8 @@ entries. It's used to query the MIME type of a given file."
(pkgdirs (filter file-exists?
(map (cut string-append <>
"/share/mime/packages")
- '#$(manifest-inputs manifest))))
+ (cons #+shared-mime-info
+ '#$(manifest-inputs manifest)))))
(update-mime-database (string-append
#+shared-mime-info
"/bin/update-mime-database")))
@@ -757,8 +761,8 @@ entries. It's used to query the MIME type of a given file."
(setenv "XDG_DATA_HOME" datadir)
(exit (zero? (system* update-mime-database destdir)))))))
- ;; Don't run the hook when 'shared-mime-info' is referenced.
- (if shared-mime-info
+ ;; Don't run the hook when there are no GLib based applications.
+ (if glib
(gexp->derivation "xdg-mime-database" build
#:local-build? #t
#:substitutable? #f)
--
2.8.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-08-11 13:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-11 13:21 [PATCH] profiles: xdg-mime-database: Run the hook when have GLib based applications 宋文武
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.