From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:49255) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2ebL-0001OJ-A1 for guix-patches@gnu.org; Fri, 14 Feb 2020 12:18:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2ebK-00082k-55 for guix-patches@gnu.org; Fri, 14 Feb 2020 12:18:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:56895) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j2ebK-00082c-1y for guix-patches@gnu.org; Fri, 14 Feb 2020 12:18:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j2ebJ-0005Q3-TK for guix-patches@gnu.org; Fri, 14 Feb 2020 12:18:01 -0500 Subject: [bug#39602] Generate font catalogues for the X server Resent-Message-ID: Received: from eggs.gnu.org ([2001:470:142:3::10]:49027) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2eaW-0000Tu-Jy for guix-patches@gnu.org; Fri, 14 Feb 2020 12:17:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2eaT-0006tf-Gr for guix-patches@gnu.org; Fri, 14 Feb 2020 12:17:11 -0500 Received: from forward101j.mail.yandex.net ([5.45.198.241]:60538) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j2eaS-0006nW-OE for guix-patches@gnu.org; Fri, 14 Feb 2020 12:17:09 -0500 Received: from mxback25o.mail.yandex.net (mxback25o.mail.yandex.net [37.140.190.105]) by forward101j.mail.yandex.net (Yandex) with ESMTP id D19E01BE1890 for ; Fri, 14 Feb 2020 20:17:05 +0300 (MSK) From: Ivan Kozlov MIME-Version: 1.0 Date: Fri, 14 Feb 2020 20:17:05 +0300 Message-Id: <2060961581700625@iva4-64850291ca1c.qloud-c.yandex.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 39602@debbugs.gnu.org Actually, I am sending this as a patch. This should produce a "share/fontpath.d" directory in the profile which i= s a font catalogue as described in Xserver(1). Then the X server font pat= h can be set to include this catalogue and it will find the installed fon= ts. This concerns all legacy X11 applications using the core fonts system= , and most importantly xterm. The hook =E2=80=98fonts-dir-file=E2=80=99 was originally added for this p= urpose as the comments can tell; you would include e. g. "share/fonts/X11= /misc" from the profile in the font path, which is a union directory with= symbolic links to fonts that want to install there and a fonts.dir file = describing all of them. This has not been working for ages, since the X.o= rg server stopped following symbolic links to font files for security rea= sons. It should be removed. --- a/guix/profiles.scm 2020-01-01 13:03:15.579056969 +0300 +++ b/guix/profiles.scm 2020-02-14 19:52:51.979902836 +0300 @@ -1293,6 +1293,37 @@ `((type . profile-hook) (hook . fonts-dir)))) =20 +(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? 'director= y (stat:type stat)) + (file-exists? = (string-append file "/fonts.dir")))) + #:directories? #t)) t= op-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=3D= " (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 @@ (list info-dir-file manual-database fonts-dir-file + fontpath-file ghc-package-cache-file ca-certificate-bundle glib-schemas