summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--guix/profiles.scm32
1 files changed, 32 insertions, 0 deletions
diff --git a/guix/profiles.scm b/guix/profiles.scm
index 0d38b2513f..4b7c557f8a 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -1293,6 +1293,37 @@ files for the fonts of the @var{manifest} entries."
`((type . profile-hook)
(hook . fonts-dir))))
+(define (fontpath-file manifest)
+ (define build
+ #~(begin
+ (use-modules (srfi srfi-1) (srfi srfi-26) (guix build utils))
+ (let* ((top-font-dirs (filter file-exists?
+ (map (cut string-append <>
+ "/share/fonts")
+ '#$(manifest-inputs manifest))))
+ (font-dirs (append-map (lambda (dir)
+ (find-files dir
+ (lambda (file stat)
+ (and (eq? 'directory (stat:type stat))
+ (file-exists? (string-append file "/fonts.dir"))))
+ #:directories? #t)) top-font-dirs))
+ (fonpath-dir (string-append #$output "/share/fontpath.d")))
+ (mkdir-p fontpath-dir)
+ (chdir fontpath-dir)
+ (for-each (lambda (dir pri)
+ (symlink dir (string-append (basename dir) ":pri=" (number->string pri))))
+ font-dirs
+ (iota (length font-dirs) 1)))))
+ (gexp->derivation "fontpath.d" build
+ #:modules '((guix build utils)
+ (srfi srfi-1)
+ (srfi srfi-26))
+ #:local-build? #t
+ #:substitutable? #f
+ #:properties
+ `((type . profile-hook)
+ (hook . fontpath-dir))))
+
(define (manual-database manifest)
"Return a derivation that builds the manual page database (\"mandb\") for
the entries in MANIFEST."
@@ -1430,6 +1461,7 @@ MANIFEST."
(list info-dir-file
manual-database
fonts-dir-file
+ fontpath-file
ghc-package-cache-file
ca-certificate-bundle
glib-schemas