mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-11 21:59:08 -05:00
profiles: xdg-mime-database: Run the hook when have GLib based applications.
* 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'.
This commit is contained in:
parent
0d4b5eb1fd
commit
801d316b20
1 changed files with 9 additions and 5 deletions
|
@ -723,9 +723,12 @@ (define build
|
||||||
(define (xdg-mime-database manifest)
|
(define (xdg-mime-database manifest)
|
||||||
"Return a derivation that builds the @file{mime.cache} database from 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."
|
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-lookup-package
|
||||||
manifest "shared-mime-info")))
|
manifest "glib")))
|
||||||
(define build
|
(define build
|
||||||
(with-imported-modules '((guix build utils)
|
(with-imported-modules '((guix build utils)
|
||||||
(guix build union))
|
(guix build union))
|
||||||
|
@ -738,7 +741,8 @@ (define build
|
||||||
(pkgdirs (filter file-exists?
|
(pkgdirs (filter file-exists?
|
||||||
(map (cut string-append <>
|
(map (cut string-append <>
|
||||||
"/share/mime/packages")
|
"/share/mime/packages")
|
||||||
'#$(manifest-inputs manifest))))
|
(cons #+shared-mime-info
|
||||||
|
'#$(manifest-inputs manifest)))))
|
||||||
(update-mime-database (string-append
|
(update-mime-database (string-append
|
||||||
#+shared-mime-info
|
#+shared-mime-info
|
||||||
"/bin/update-mime-database")))
|
"/bin/update-mime-database")))
|
||||||
|
@ -748,8 +752,8 @@ (define build
|
||||||
(setenv "XDG_DATA_HOME" datadir)
|
(setenv "XDG_DATA_HOME" datadir)
|
||||||
(exit (zero? (system* update-mime-database destdir)))))))
|
(exit (zero? (system* update-mime-database destdir)))))))
|
||||||
|
|
||||||
;; Don't run the hook when 'shared-mime-info' is referenced.
|
;; Don't run the hook when there are no GLib based applications.
|
||||||
(if shared-mime-info
|
(if glib
|
||||||
(gexp->derivation "xdg-mime-database" build
|
(gexp->derivation "xdg-mime-database" build
|
||||||
#:local-build? #t
|
#:local-build? #t
|
||||||
#:substitutable? #f)
|
#:substitutable? #f)
|
||||||
|
|
Loading…
Reference in a new issue