From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 2AxPMJ3O4155eAAA0tVLHw (envelope-from ) for ; Fri, 12 Jun 2020 18:51:09 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id p34aLJ3O415sPgAA1q6Kng (envelope-from ) for ; Fri, 12 Jun 2020 18:51:09 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0FB329403E9 for ; Fri, 12 Jun 2020 18:51:09 +0000 (UTC) Received: from localhost ([::1]:38610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jjole-0003tc-FI for larch@yhetil.org; Fri, 12 Jun 2020 14:51:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47156) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jjolZ-0003tN-SL for guix-patches@gnu.org; Fri, 12 Jun 2020 14:51:01 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:57233) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jjolZ-00051v-JS for guix-patches@gnu.org; Fri, 12 Jun 2020 14:51:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jjolZ-0004ze-HF for guix-patches@gnu.org; Fri, 12 Jun 2020 14:51:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#39602] Generate font catalogues for the X server Resent-From: Ivan Kozlov Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 12 Jun 2020 18:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39602 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 39602@debbugs.gnu.org X-Debbugs-Original-To: guix-patches Received: via spool by submit@debbugs.gnu.org id=B.159198786019187 (code B ref -1); Fri, 12 Jun 2020 18:51:01 +0000 Received: (at submit) by debbugs.gnu.org; 12 Jun 2020 18:51:00 +0000 Received: from localhost ([127.0.0.1]:40546 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jjolY-0004zP-EK for submit@debbugs.gnu.org; Fri, 12 Jun 2020 14:51:00 -0400 Received: from lists.gnu.org ([209.51.188.17]:40926) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jjolX-0004zI-82 for submit@debbugs.gnu.org; Fri, 12 Jun 2020 14:50:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47096) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jjolW-0003ry-RD for guix-patches@gnu.org; Fri, 12 Jun 2020 14:50:58 -0400 Received: from forward500j.mail.yandex.net ([2a02:6b8:0:801:2::110]:41038) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jjolT-0004yg-Mm for guix-patches@gnu.org; Fri, 12 Jun 2020 14:50:57 -0400 Received: from mxback18j.mail.yandex.net (mxback18j.mail.yandex.net [IPv6:2a02:6b8:0:1619::94]) by forward500j.mail.yandex.net (Yandex) with ESMTP id 9CEF811C1E03 for ; Fri, 12 Jun 2020 21:44:45 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback18j.mail.yandex.net (mxback/Yandex) with ESMTP id tRSCnrXJsO-ij8ujrNF; Fri, 12 Jun 2020 21:44:45 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1591987485; bh=la9PQPr8fQkUWH7htvtLu9New8vG6d3YCtBkCRT7Yt4=; h=References:Date:Message-Id:Subject:In-Reply-To:To:From; b=N6KzUBcAq0lnyr9FVHQuUf9s5uWJ10P53fZF8n+19lcfR5zh//GD4PRSJO1iZ1Gj2 ayjxKlMbaX4ygey5QhvG/qcMEOkcYc+Gtuiha/Sm5WA7c81vpiMm/v/DIug4/eGDD0 cFldWm0c7OBmFYP+vwp7hSVZTmIHFjV/GHXPFiLg= Received: by myt5-1466095fe4e5.qloud-c.yandex.net with HTTP; Fri, 12 Jun 2020 21:44:44 +0300 From: Ivan Kozlov In-Reply-To: <2060961581700625@iva4-64850291ca1c.qloud-c.yandex.net> References: <2060961581700625@iva4-64850291ca1c.qloud-c.yandex.net> MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Fri, 12 Jun 2020 21:44:44 +0300 Message-Id: <1222911591987229@mail.yandex.ru> Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 Received-SPF: pass client-ip=2a02:6b8:0:801:2::110; envelope-from=kanichos@yandex.ru; helo=forward500j.mail.yandex.net X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -2.3 (--) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=yandex.ru header.s=mail header.b=N6KzUBcA; dmarc=fail reason="SPF not aligned (relaxed)" header.from=yandex.ru (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: 0.09 X-TUID: Js1w9RCHWEvh Is nobody interested in this? I don’t see any problems with the patch. This must have been of concern at least once, judging by fonts-dir-file’s existence. The fontpath mechanism is the only way today to make the core (server-side) fonts work reasonably. 14.02.2020, 20:17, "Ivan Kozlov" : > Actually, I am sending this as a patch. > > This should produce a "share/fontpath.d" directory in the profile which is a font catalogue as described in Xserver(1). Then the X server font path can be set to include this catalogue and it will find the installed fonts. This concerns all legacy X11 applications using the core fonts system, and most importantly xterm. > > The hook ‘fonts-dir-file’ was originally added for this purpose 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.org server stopped following symbolic links to font files for security reasons. 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)))) > > +(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 @@ >    (list info-dir-file >          manual-database >          fonts-dir-file > + fontpath-file >          ghc-package-cache-file >          ca-certificate-bundle >          glib-schemas