From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id YIUvNgKk3mWafwAA62LTzQ:P1 (envelope-from ) for ; Wed, 28 Feb 2024 04:09:55 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id YIUvNgKk3mWafwAA62LTzQ (envelope-from ) for ; Wed, 28 Feb 2024 04:09:55 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=ultrarare.space header.s=dkim header.b=CKRiyoLO; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1709089794; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=CxrmAUiAuNNpi/74WGNjP2fOodvf/bJ7laKHOgCh67k=; b=WMJS1/sg8cLEwMn9EwW9gRzob9i995enOy+N+Mj8AtkDhq8OqEu+3F8VTkoy4Ca/ZFbrHE P3wdrC7o0LCStiolZaUL4JO6x4DjLEncfiG310ZywjIP+mHw5O0ZpyOBE3BvIluI04uRGK lmfefi3qGd6YK3aLY8DVkTXT59igWB5ocU836oEQ4uD+GYHjEzrrj4wI2jqNzznngIoJlZ 47XKXBdFHXWl0Aw41baodd0NY4svOF0k3v2ZHA4JbjBOIwtWBGj0lOwvQ7igpiBUwkQ45+ Z/eMGb2KZmmFOFdXhO8cojY4mszigejT7QfY6z+yUfCJrYh6DT30mrGvkly/nQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=ultrarare.space header.s=dkim header.b=CKRiyoLO; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1709089794; a=rsa-sha256; cv=none; b=re0XfYldqIZfHrHK5+UlzzOVXCR/6i9Bbl+wB+9K4mj++0/naQ6/Wkp5mKfXuTBHqbhUDB 5CGSiuaO/mDZ4Bcc2C3PxyXzb4aLBKOIygQBlE/1Uz3qQv49KnT/s9DM4PzgS0jUaqae71 03y1So6xUEnnH0zsZ2SaQqI62af/6faDUtaxz7Qy1cKY2p8lhVgk9FqfMGSAfy+/pSN3dm 4UXMUkQkgbeOyyRX+ZkVVVDL+sP/md98Vm8oz3xyGIBsXD9GOKpkHkOU6namO4Wupr9iyA WVs5n7+6Avh9pGnWKKub1VvJzDmjdJntowmUbU1njQSIQ41oM3p7/1m+8V4+gw== 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 7F30A24547 for ; Wed, 28 Feb 2024 04:09:54 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rfAKG-0000pX-4x; Tue, 27 Feb 2024 22:09:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rfAKE-0000pH-Qx for guix-patches@gnu.org; Tue, 27 Feb 2024 22:09:42 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rfAKE-0005rk-JR for guix-patches@gnu.org; Tue, 27 Feb 2024 22:09:42 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rfAKa-0005Rp-4X; Tue, 27 Feb 2024 22:10:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#69424] [PATCH v2 2/5] gnu: font-google-noto: Prefer variable fonts and split outputs. Resent-From: Hilton Chain Original-Sender: "Debbugs-submit" Resent-CC: hako@ultrarare.space, all_but_last@163.com, iyzsong@envs.net, guix-patches@gnu.org Resent-Date: Wed, 28 Feb 2024 03:10:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69424 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69424@debbugs.gnu.org Cc: Hilton Chain , Jiwei YANG , Hilton Chain , Zhu Zihao , =?UTF-8?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?= X-Debbugs-Original-Xcc: Hilton Chain , Zhu Zihao , =?UTF-8?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Received: via spool by 69424-submit@debbugs.gnu.org id=B69424.170908978820853 (code B ref 69424); Wed, 28 Feb 2024 03:10:04 +0000 Received: (at 69424) by debbugs.gnu.org; 28 Feb 2024 03:09:48 +0000 Received: from localhost ([127.0.0.1]:54893 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rfAKJ-0005Pz-17 for submit@debbugs.gnu.org; Tue, 27 Feb 2024 22:09:47 -0500 Received: from mail.boiledscript.com ([144.168.59.46]:39644) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rfAKF-0005Pg-Ik for 69424@debbugs.gnu.org; Tue, 27 Feb 2024 22:09:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space; s=dkim; t=1709089739; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CxrmAUiAuNNpi/74WGNjP2fOodvf/bJ7laKHOgCh67k=; b=CKRiyoLOT1vzQrAI+KGHpp1+xqvbHaYUZMOIwB0LtDtLV1F8rVBw9N5xd8Ge6hQBkEoI9g oqIEB2LwKi48E+w8GExrZ/Pps0NcdtQmTAcJDF18R+oookNS4WC42M9BJuN3mPcKCJHlCG k8GY5C7qlW3p4dehOsYpZnjTHOopg89rH0HptgFWROuVPJ23rvb6APBJ3zUr374YGSrwz9 XEAa6LaLtdu5A9zL8GdEGEzX21N1eUZpbpZk8Md2JTfPZ+rT61ZgeYCLN4eoOb8WIUpfmL TWgrOXJcr5z6CvreVYp5YwBCBbF3bc59KU7LpXyx1bvtMeVnciDXvRFIixSG7g== Date: Wed, 28 Feb 2024 11:08:33 +0800 Message-ID: <236164f917c76f445814e3cdf9bce736c7798ef9.1709089250.git.hako@ultrarare.space> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Bar: -- X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Hilton Chain X-ACL-Warn: , Hilton Chain via Guix-patches From: Hilton Chain via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -2.91 X-Spam-Score: -2.91 X-Migadu-Queue-Id: 7F30A24547 X-TUID: Hb8ZUxSg82sb * gnu/packages/fonts.scm (font-google-noto) [arguments]<#:phase>: Only install variable fonts to "out" when available. Install hinted TTFs into "ttf" output. [outputs]: Add "ttf". Suggested-by: Jiwei YANG Change-Id: Icac2927fb6c35d08504c379e273a5fc03b08ac46 --- gnu/packages/fonts.scm | 44 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm index 72bf0124c4..9a268364d7 100644 --- a/gnu/packages/fonts.scm +++ b/gnu/packages/fonts.scm @@ -1092,6 +1092,50 @@ (define-public font-google-noto (sha256 (base32 "087jg8ahpq35xwyrmvm9ivxl0wjic2j4r28bbrwqmgdva9brms40")))) (build-system font-build-system) + (arguments + (list + #:modules + '((guix build font-build-system) + (guix build utils) + (ice-9 ftw)) + #:phases + #~(modify-phases %standard-phases + (replace 'install + (lambda _ + (define install + (assoc-ref %standard-phases 'install)) + (define (scan-directory name) + (scandir name (lambda (file) + (not (member file '("." ".." "LICENSE")))))) + (define (install-font-variant variant) + "Given font variant VARIANT, install one of its formats, +variable TTF or OTF or TTF." + (with-directory-excursion variant + (let ((formats (scan-directory "."))) + (cond + ((member "variable-ttf" formats) + (with-directory-excursion "variable-ttf" + (install #:outputs `(("out" . ,#$output))))) + ((member "otf" formats) + (with-directory-excursion "otf" + (install #:outputs `(("out" . ,#$output))))) + ((member "ttf" formats) + (with-directory-excursion "ttf" + (install #:outputs `(("out" . ,#$output))))))))) + (define (install-font font) + "Given font FONT, install one of its variants, full or unhinted, +and install its hinted variant into 'ttf' output. + +unhinted and hinted variants are always available." + (with-directory-excursion font + (if (member "full" (scan-directory ".")) + (install-font-variant "full") + (install-font-variant "unhinted")) + (with-directory-excursion "hinted" + (install #:outputs `(("out" . ,#$output:ttf)))))) + (with-directory-excursion "fonts" + (for-each install-font (scan-directory ".")))))))) + (outputs '("out" "ttf")) (home-page "https://www.google.com/get/noto/") (synopsis "Fonts to cover all languages") (description "Google Noto Fonts is a family of fonts designed to support -- 2.41.0