guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/03: system: Make sure fonts are searched for in the system profile.


From: Ludovic Courtès
Subject: 03/03: system: Make sure fonts are searched for in the system profile.
Date: Sun, 20 Mar 2016 14:33:53 +0000

civodul pushed a commit to branch master
in repository guix.

commit e71ef7adaece7e132a5059139122b45083ea1b39
Author: Ludovic Courtès <address@hidden>
Date:   Sun Mar 20 15:27:44 2016 +0100

    system: Make sure fonts are searched for in the system profile.
    
    This fixes a bug whereby fonts in /run/current-system/profile would be
    invisible to Fontconfig.
    
    * gnu/packages/fontutils.scm (fontconfig): Add comment about system
    profile not being searched.
    * gnu/system/shadow.scm (default-skeletons)[fonts.conf-content,
    fonts.conf]: New variable.
    Add FONTS.CONF to the skeletons.
---
 gnu/packages/fontutils.scm |    4 ++++
 gnu/system/shadow.scm      |   23 +++++++++++++++++++++++
 2 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/gnu/packages/fontutils.scm b/gnu/packages/fontutils.scm
index 01a0ee7..7e3f293 100644
--- a/gnu/packages/fontutils.scm
+++ b/gnu/packages/fontutils.scm
@@ -94,8 +94,12 @@ anti-aliased glyph bitmap generation with 256 gray levels.")
             (string-append "--with-default-fonts="
                            (assoc-ref %build-inputs "gs-fonts")
                            "/share/fonts")
+
             ;; register fonts from user profile
+            ;; TODO: Add /run/current-system/profile/share/fonts and remove
+            ;; the skeleton that works around it from 'default-skeletons'.
             "--with-add-fonts=~/.guix-profile/share/fonts"
+
             ;; python is not actually needed
             "PYTHON=false")
       #:phases
diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm
index 6e62aee..a13ef11 100644
--- a/gnu/system/shadow.scm
+++ b/gnu/system/shadow.scm
@@ -131,6 +131,12 @@
 (define (default-skeletons)
   "Return the default skeleton files for /etc/skel.  These files are copied by
 'useradd' in the home directory of newly created user accounts."
+  (define fonts.conf-content
+    ;; SXML for ~/.config/fontconfig/fonts.conf.  This works around the fact
+    ;; that Fontconfig currently does not such this directory by default,
+    ;; thereby ignoring fonts installed system-wide (FIXME).
+    `(fontconfig (dir "/run/current-system/profile/share/fonts")))
+
   (define copy-guile-wm
     #~(begin
         (use-modules (guix build utils))
@@ -174,6 +180,22 @@ source /etc/profile\n"))
         (xdefaults (plain-file "Xdefaults" "\
 XTerm*utf8: always
 XTerm*metaSendsEscape: true\n"))
+        (fonts.conf (computed-file
+                     "fonts.conf"
+                     #~(begin
+                         (use-modules (guix build utils)
+                                      (sxml simple))
+
+                         (define dir
+                           (string-append #$output
+                                          "/fontconfig"))
+
+                         (mkdir-p dir)
+                         (call-with-output-file (string-append dir
+                                                             "/fonts.conf")
+                           (lambda (port)
+                             (sxml->xml '#$fonts.conf-content port))))
+                     #:modules '((guix build utils))))
         (gdbinit   (plain-file "gdbinit" "\
 # Tell GDB where to look for separate debugging files.
 set debug-file-directory ~/.guix-profile/lib/debug\n")))
@@ -182,6 +204,7 @@ set debug-file-directory ~/.guix-profile/lib/debug\n")))
       (".zlogin" ,zlogin)
       (".Xdefaults" ,xdefaults)
       (".guile-wm" ,guile-wm)
+      (".config" ,fonts.conf)
       (".gdbinit" ,gdbinit))))
 
 (define (skeleton-directory skeletons)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]