[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
51/56: profiles: Add xdg-desktop-database hook.
From: |
??? |
Subject: |
51/56: profiles: Add xdg-desktop-database hook. |
Date: |
Mon, 02 May 2016 13:38:41 +0000 |
iyzsong pushed a commit to branch gnome-updates
in repository guix.
commit ec20f03b584266641341c25cf91b0c8ab6c46a64
Author: 宋文武 <address@hidden>
Date: Thu Feb 4 15:33:07 2016 +0800
profiles: Add xdg-desktop-database hook.
* guix/profiles.scm (xdg-desktop-database): New function.
(%default-profile-hooks): Add it.
---
guix/profiles.scm | 38 +++++++++++++++++++++++++++++++++++++-
1 file changed, 37 insertions(+), 1 deletion(-)
diff --git a/guix/profiles.scm b/guix/profiles.scm
index a3277ce..c298bac 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -686,13 +686,49 @@ creates the GTK+ 'icon-theme.cache' file for each theme."
#:substitutable? #f)
(return #f))))
+(define (xdg-desktop-database manifest)
+ "Return a derivation that builds the @file{mimeinfo.cache} database from
+desktop files. It's used to query what applications can handle a given
+MIME type."
+ (define desktop-file-utils
+ (module-ref (resolve-interface '(gnu packages gnome))
+ 'desktop-file-utils))
+
+ (define build
+ #~(begin
+ (use-modules (srfi srfi-26)
+ (guix build utils)
+ (guix build union))
+ (let* ((destdir (string-append #$output "/share/applications"))
+ (appdirs (filter file-exists?
+ (map (cut string-append <>
+ "/share/applications")
+ '#$(manifest-inputs manifest))))
+ (update-desktop-database (string-append
+ #+desktop-file-utils
+ "/bin/update-desktop-database")))
+ (mkdir-p (string-append #$output "/share"))
+ (union-build destdir appdirs
+ #:log-port (%make-void-port "w"))
+ (zero? (system* update-desktop-database destdir)))))
+
+ ;; Don't run the hook when 'desktop-file-utils' is not installed.
+ (if (manifest-lookup manifest (manifest-pattern (name "desktop-file-utils")))
+ (gexp->derivation "xdg-desktop-database" build
+ #:modules '((guix build utils)
+ (guix build union))
+ #:local-build? #t
+ #:substitutable? #f)
+ (with-monad %store-monad (return #f))))
+
(define %default-profile-hooks
;; This is the list of derivation-returning procedures that are called by
;; default when making a non-empty profile.
(list info-dir-file
ghc-package-cache-file
ca-certificate-bundle
- gtk-icon-themes))
+ gtk-icon-themes
+ xdg-desktop-database))
(define* (profile-derivation manifest
#:key
- 47/56: gnu: nautilus: Update to 3.20.1., (continued)
- 47/56: gnu: nautilus: Update to 3.20.1., ???, 2016/05/02
- 37/56: gnu: gnome-control-center: Update to 3.20.1., ???, 2016/05/02
- 04/56: Revert "Revert "gnu: gjs: Skip test_utf8_inout test."", ???, 2016/05/02
- 46/56: gnu: grilo-plugins: Update to 0.3.1., ???, 2016/05/02
- 56/56: gnu: yelp: Add gsettings-desktop-schemas to inputs., ???, 2016/05/02
- 32/56: gnu: mutter: Update to 3.20.1., ???, 2016/05/02
- 38/56: gnu: gnome-shell: Update to 3.20.1., ???, 2016/05/02
- 53/56: gnu: gnome: Add desktop-file-utils., ???, 2016/05/02
- 23/56: gnu: totem: Update to 3.20.1., ???, 2016/05/02
- 50/56: gnu: gst-plugins-good: Disable a failing rtprtx test., ???, 2016/05/02
- 51/56: profiles: Add xdg-desktop-database hook.,
??? <=
- 36/56: gnu: gdm: Update to 3.20.1., ???, 2016/05/02