From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 14 12:17:16 2020 Received: (at submit) by debbugs.gnu.org; 14 Feb 2020 17:17:16 +0000 Received: from localhost ([127.0.0.1]:34634 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j2eaa-0005Ok-Dx for submit@debbugs.gnu.org; Fri, 14 Feb 2020 12:17:16 -0500 Received: from lists.gnu.org ([209.51.188.17]:42817) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j2eaY-0005Oc-55 for submit@debbugs.gnu.org; Fri, 14 Feb 2020 12:17:14 -0500 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 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_40,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,SPOOFED_FREEMAIL,URIBL_BLOCKED autolearn=disabled version=3.3.2 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) Received: from localhost (localhost [::1]) by mxback25o.mail.yandex.net (mxback/Yandex) with ESMTP id tSxXywOvDK-H5Emtv9N; Fri, 14 Feb 2020 20:17:05 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1581700625; bh=x2P37CPtuu6kyVaa9H4pGBkmbDxyiHa4EqgWq9kuFik=; h=Message-Id:Date:Subject:To:From; b=Efzrg+Aq2Sj/YI3ZZNkxs1QCjGGFssm5f61AnUIeSKlBYXyDZvuAoNALPWZLHf5O+ EnlJJNXhKswm4PY0bSvwl5enu+zLZcr4gyKzyP32sSOLS4bPuVkMa0z61jOvbdPbFR gLzfmvVuH9+rHyEa2lP6mA0g7DaGY5Z9JO6dC7VQ= Authentication-Results: mxback25o.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: by iva4-64850291ca1c.qloud-c.yandex.net with HTTP; Fri, 14 Feb 2020 20:17:05 +0300 From: Ivan Kozlov To: guix-patches Subject: Generate font catalogues for the X server MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.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 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 5.45.198.241 X-Spam-Score: 2.3 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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 fin [...] Content analysis details: (2.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: x.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (kanichos[at]yandex.ru) -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [209.51.188.17 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 2.0 SPOOFED_FREEMAIL No description available. X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 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 From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 12 14:51:00 2020 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= Authentication-Results: mxback18j.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: by myt5-1466095fe4e5.qloud-c.yandex.net with HTTP; Fri, 12 Jun 2020 21:44:44 +0300 From: Ivan Kozlov To: guix-patches In-Reply-To: <2060961581700625@iva4-64850291ca1c.qloud-c.yandex.net> References: <2060961581700625@iva4-64850291ca1c.qloud-c.yandex.net> Subject: Re: Generate font catalogues for the X server 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-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) 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 From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 22 16:11:14 2020 Received: (at 39602) by debbugs.gnu.org; 22 Jun 2020 20:11:14 +0000 Received: from localhost ([127.0.0.1]:34641 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jnSmg-0000sx-26 for submit@debbugs.gnu.org; Mon, 22 Jun 2020 16:11:14 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:53049) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jnSmb-0000sh-An for 39602@debbugs.gnu.org; Mon, 22 Jun 2020 16:11:12 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 2C5465C0E65; Mon, 22 Jun 2020 16:11:04 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 22 Jun 2020 16:11:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= from:to:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=fm3; bh=6x0P3fqRJhka8UdgkfnzFVnvWk siSDXzojYyjI6hlYk=; b=VR3AFqu0nn4G1Yir4nSpA1qKr5ZJSqb5O5X6V5WOBW bhWECUyPepYDkyI83nrJWtd81tN8/8mioJhJtvQZnUJJRFN4CO96yFJGBlISONWJ J81wUvafgvFahdKRPJoZbcmhAHcgdDvBw95DE31Yz5j+mRHYrgFxshaFPwqrm5z0 EO/l5RpBHBsnK36iUmQoPkpQvrwl41qSmBv/DC4qbqlp3MxLNcGiGFxWn66fXa2e JqxPP5nKpdfOeeI1Ia9/UFc9HU+7ngeVlnEVZwpAsqhgShu3DTDoPtaE+gbnMTz5 Vo+MdnB3KFQSmlc0Ee3nEgBRlwzkUIL0JCQUGyTtB6Ng== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=6x0P3f qRJhka8UdgkfnzFVnvWksiSDXzojYyjI6hlYk=; b=tcfZMuBvnT0bjl2IbFApGW IS2iwfxmzM4TBwcPkG2PAs3sknjBj+BL9ltxAgpQkpHWnxyutCrdwsa0Ik03vE89 eaxBCDab8+Cd+bvRJdN97pGIF/wV++JMGMCH1Q5Tq5HeApTt3kR1+yaf/Mh1GZKk 7gXvfQPjw01iMj8GRsK/meQaB/sOE0l6kUsM7AJMVcZHD962eDlxc3/IfNRvSdWk 5EGl9TW8hNA0gSItjDOOn0Gmdeo0fRtPllx4mHuPaJG5AqhT+JPAhBNx7ZgKZc5b uqyp9MorpZ0slBRQ037vZaV+YwFEmwOc/aa+Q4p90ge0oiQbO08dyQVtFoAvUydw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudekvddgudegkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufgjfhffkfggtgesghdtre ertddtjeenucfhrhhomhepofgrrhhiuhhsuceurghkkhgvuceomhgsrghkkhgvsehfrghs thhmrghilhdrtghomheqnecuggftrfgrthhtvghrnhepudevieeigffhfeejfeduleffie dujeeukefgtefhuefhfeduleeltdfggeevleefnecukfhppeekkedrleehrddutdeirdek tdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmsg grkhhkvgesfhgrshhtmhgrihhlrdgtohhm X-ME-Proxy: Received: from localhost (ti0006q161-3115.bb.online.no [88.95.106.80]) by mail.messagingengine.com (Postfix) with ESMTPA id 584B93280060; Mon, 22 Jun 2020 16:11:03 -0400 (EDT) From: Marius Bakke To: Ivan Kozlov , 39602@debbugs.gnu.org Subject: Re: [bug#39602] Generate font catalogues for the X server In-Reply-To: <2060961581700625@iva4-64850291ca1c.qloud-c.yandex.net> References: <2060961581700625@iva4-64850291ca1c.qloud-c.yandex.net> Date: Mon, 22 Jun 2020 22:11:01 +0200 Message-ID: <87k0zyc14a.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 39602 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ivan Kozlov writes: > 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 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 =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/m= isc" from the profile in the font path, which is a union directory with sym= bolic links to fonts that want to install there and a fonts.dir file descri= bing all of them. This has not been working for ages, since the X.org serve= r stopped following symbolic links to font files for security reasons. It s= hould be removed. Thanks for this investigation, and the patch! Overall it LGTM, but I wonder how useful it is, seeing as no one has reported the issue. Would it make sense to add hooks in the configuration system instead for setting font path and a font union? A patch to remove the legacy broken 'fonts-dir-file' generation from (guix profiles) would be welcome, by the way. Thanks, Marius --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl7xEFUACgkQoqBt8qM6 VPo6JAf+I3yM+lOO/MwUBjqXXAJUj+egPaG3zD9erp8VMElegfIGH4ay4w2nZ3pd 9FdZDO2qk+4J+R61fIy9bm3rkrK5tipOGlqH+wwl8fD8zESURq0nyJO8umQjP3lW IZzBuAVe3UAZAaqfF7fUwua7rK9LW8T0ipXJGtvOhVZgUNYcAOL/IhqV/seO5IHd 7k/o9O2wuedz6UHpkcnITvujKjqj9F2kdK95K/VrQn0yNWyI+/aGzumSiehPNu4t rMEv8pkbISSN6k0K9wNJ0agnKSFeY1w68NI58KlNDOTETv2n1xgEKsP/B2GH/KnI vCRswEOOTKKg2q1Q2mpUhkWRzAwtig== =vG5u -----END PGP SIGNATURE----- --=-=-=--