GNU bug report logs - #70496
[fonts-split-outputs] Remove duplications in fonts by split outputs

Previous Next

Package: guix-patches;

Reported by: iyzsong <at> envs.net

Date: Sun, 21 Apr 2024 10:22:02 UTC

Severity: normal

Tags: patch

Done: 宋文武 <iyzsong <at> envs.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: iyzsong <at> envs.net
To: 70496 <at> debbugs.gnu.org
Cc: 宋文武 <iyzsong <at> member.fsf.org>
Subject: [bug#70496] [PATCH 01/14] build-system: font: Handle multiple outputs in the install phase.
Date: Sun, 21 Apr 2024 18:28:35 +0800
From: 宋文武 <iyzsong <at> member.fsf.org>

* guix/build/font-build-system.scm (install): Prefer install files into their
specified outputs (ttf, otf, woff, otb, bdf, pcf, psf).

Change-Id: I2ecd126fe31ce4fc65c59106938e37523b0cc3d2
---
 guix/build/font-build-system.scm | 32 +++++++++++++++++++++++++++-----
 1 file changed, 27 insertions(+), 5 deletions(-)

diff --git a/guix/build/font-build-system.scm b/guix/build/font-build-system.scm
index e4784bc17d..bd166c4afe 100644
--- a/guix/build/font-build-system.scm
+++ b/guix/build/font-build-system.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017, 2022 Arun Isaac <arunisaac <at> systemreboot.net>
 ;;; Copyright © 2017 Alex Griffin <a <at> ajgrf.com>
+;;; Copyright © 2024 宋文武 <iyzsong <at> envs.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -48,13 +49,34 @@ (define* (install #:key outputs #:allow-other-keys)
   "Install the package contents."
   (let* ((out (assoc-ref outputs "out"))
          (source (getcwd))
-         (fonts (string-append out "/share/fonts")))
-    (for-each (cut install-file <> (string-append fonts "/truetype"))
+         (truetype-dir (string-append (or (assoc-ref outputs "ttf") out)
+                                      "/share/fonts/truetype"))
+         (opentype-dir (string-append (or (assoc-ref outputs "otf") out)
+                                      "/share/fonts/opentype"))
+         (web-dir (string-append (or (assoc-ref outputs "woff") out)
+                                 "/share/fonts/web"))
+         (otb-dir (string-append (or (assoc-ref outputs "otb") out)
+                                 "/share/fonts/misc"))
+         (bdf-dir (string-append (or (assoc-ref outputs "bdf") out)
+                                 "/share/fonts/misc"))
+         (pcf-dir (string-append (or (assoc-ref outputs "pcf") out)
+                                 "/share/fonts/misc"))
+         (psf-dir (string-append (or (assoc-ref outputs "psf") out)
+                                 "/share/consolefonts")))
+    (for-each (cut install-file <> truetype-dir)
               (find-files source "\\.(ttf|ttc)$"))
-    (for-each (cut install-file <> (string-append fonts "/opentype"))
+    (for-each (cut install-file <> opentype-dir)
               (find-files source "\\.(otf|otc)$"))
-    (for-each (cut install-file <> (string-append fonts "/web"))
-              (find-files source "\\.(woff|woff2)$"))))
+    (for-each (cut install-file <> web-dir)
+              (find-files source "\\.(woff|woff2)$"))
+    (for-each (cut install-file <> otb-dir)
+              (find-files source "\\.otb$"))
+    (for-each (cut install-file <> bdf-dir)
+              (find-files source "\\.bdf$"))
+    (for-each (cut install-file <> pcf-dir)
+              (find-files source "\\.pcf$"))
+    (for-each (cut install-file <> psf-dir)
+              (find-files source "\\.psfu$"))))
 
 (define %standard-phases
   (modify-phases gnu:%standard-phases
-- 
2.41.0





This bug report was last modified 120 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.