From patchwork Thu Nov 16 19:15:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 56535 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 14F3F27BBE2; Thu, 16 Nov 2023 19:18:58 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 0E1F427BBE9 for ; Thu, 16 Nov 2023 19:18:57 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r3hsO-0004Qu-KU; Thu, 16 Nov 2023 14:18:08 -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 1r3hsM-0004Nc-4O for guix-patches@gnu.org; Thu, 16 Nov 2023 14:18:06 -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 1r3hsL-0004gj-Rm for guix-patches@gnu.org; Thu, 16 Nov 2023 14:18:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r3hsL-0003pU-Ja for guix-patches@gnu.org; Thu, 16 Nov 2023 14:18:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#67019] [PATCH v2 15/16] gnu: Add font-katex. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Nov 2023 19:18:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67019 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 67019@debbugs.gnu.org Cc: Philip McGrath , Liliana Marie Prikler Received: via spool by 67019-submit@debbugs.gnu.org id=B67019.170016223214585 (code B ref 67019); Thu, 16 Nov 2023 19:18:05 +0000 Received: (at 67019) by debbugs.gnu.org; 16 Nov 2023 19:17:12 +0000 Received: from localhost ([127.0.0.1]:44607 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3hrU-0003n5-AJ for submit@debbugs.gnu.org; Thu, 16 Nov 2023 14:17:12 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:48699) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3hr5-0003iU-Jf for 67019@debbugs.gnu.org; Thu, 16 Nov 2023 14:16:49 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id AFAE85C0176; Thu, 16 Nov 2023 14:16:47 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 16 Nov 2023 14:16:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1700162207; x=1700248607; bh=hzOWIYY8DG eo2gwVnQmIMFa+q3DnC8RCm3VUsXPBkXI=; b=DHlF81scWg5IOEXhJ691LhqREU oHZRf35whrF9j8Virb3wqUMQ4Fg1O7+9Ae0qrjF1zlr3dq4jyIxibPUJdPx+Hwdn gqDe33j5f9+e14ImRup857FL1i2OgyzLogcZX8J2k6yxliG0ymO0OfWbvJPLMZSj DUVhJO89od96ubo0Ot5XMNJqNE8Zg61ZV8fNm0/7NKhHoLknw7dzxeej2RcIVpXv R5cp8qjRMFo96p3IPeL+iQXwboRNAqOeqX+3H0gWAL3YNGPUDTvHOCpDHZseYY65 Yu42AX8x08PQXNRK3x9ljGHW0BVqB3aGe5vj0jsk79/Z8oGSRSPeOVsf8OKw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1700162207; x= 1700248607; bh=hzOWIYY8DGeo2gwVnQmIMFa+q3DnC8RCm3VUsXPBkXI=; b=S ddzJ5TLSPjyuCaCZMm5xeRf1pHrxkWDdZnXC6OI5jB1iwyC9lu8meuP+8SkefUsP oy1QvAYIeWaZabDQ4kkSLf4H57nbf3kWbDI285xmeWXFbIm7X+czbaTj/Tl/U5lz qbrdULWYtOH6FUp+jNQSXbYzRgMqIMsiuwFqjpGN+EYxxFp30kk8E1OfpUMicS7s NF7H6ws3GynrkO4hVHFaJj/VS4V6suHLaSD1ZE/dWL6K9qnPSQNrUPHm93tW8SFI CRTO+x9BHsmKPjm7NeE07loz7cY3pNLW56Ob1mbTaNYVar2lsfvMl1UpP1ZO6NQc HBsGMXxu9eqAUVk1JfZZQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudefkedguddvtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefrhhhi lhhiphcuofgtifhrrghthhcuoehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtg homheqnecuggftrfgrthhtvghrnhepjeeuveduleduteelfeevhfehtdeikeelheegheej geetkeefhedukeevhedvgefgnecuffhomhgrihhnpehgihhthhhusgdrtghomhdpkhgrth gvgidrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhr ohhmpehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomh X-ME-Proxy: Feedback-ID: i2b1146f3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 16 Nov 2023 14:16:47 -0500 (EST) From: Philip McGrath Date: Thu, 16 Nov 2023 14:15:53 -0500 Message-ID: <16f8bf6f752e012ec9a61c8cfc6029cb7c46e536.1700161584.git.philip@philipmcgrath.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 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: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/javascript.scm (font-katex): New variable. --- gnu/packages/javascript.scm | 74 +++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/gnu/packages/javascript.scm b/gnu/packages/javascript.scm index 97cb3b6270..ee7a48154c 100644 --- a/gnu/packages/javascript.scm +++ b/gnu/packages/javascript.scm @@ -30,9 +30,15 @@ (define-module (gnu packages javascript) #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages compression) + #:use-module (gnu packages fontutils) #:use-module (gnu packages java) #:use-module (gnu packages node) + #:use-module (gnu packages perl) + #:use-module (gnu packages python) + #:use-module (gnu packages python-compression) + #:use-module (gnu packages python-xyz) #:use-module (gnu packages readline) + #:use-module (gnu packages tex) #:use-module (gnu packages uglifyjs) #:use-module (gnu packages web) #:use-module (guix gexp) @@ -41,6 +47,7 @@ (define-module (gnu packages javascript) #:use-module (guix git-download) #:use-module (guix build-system ant) #:use-module (guix build-system cmake) + #:use-module (guix build-system copy) #:use-module (guix build-system gnu) #:use-module (guix build-system minify) #:use-module (guix build-system node) @@ -372,6 +379,73 @@ (define-public js-mathjax-for-r-mathjaxr (base32 "1q063l6477z285j6h5wvccp6iswvlp0jmb96sgk32sh0lf7nhknh"))))))))) +(define-public font-katex + (package + (name "font-katex") + (version "0.16.4") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/KaTeX/KaTeX") + (commit (string-append "v" version)))) + (sha256 + (base32 + "0z6y2188lhfv0gk0hp4rm37g6fs99qb3ab2q3n9g76ga9dwxhw3s")) + (snippet + ;; unbundle generated files + #~(begin + (use-modules (guix build utils)) + (delete-file "src/fontMetricsData.js") + (delete-file-recursively "fonts"))) + (file-name (git-file-name "katex" version)))) + (build-system copy-build-system) + (native-inputs (list (texlive-updmap.cfg + (list texlive-amsfonts + texlive-cm + texlive-fonts-rsfs)) + fontforge + mftrace + ttfautohint + perl + perl-json + python + python-fonttools + python-brotli + python-zopfli + which)) + (arguments + (list + #:install-plan + #~`(("fonts/" "share/fonts/truetype/katex/") + ("src/fontMetricsData.js" "share/katex/")) + #:imported-modules + `((guix build union) + ,@%copy-build-system-modules) + #:modules + '((guix build copy-build-system) + (guix build union) + (guix build utils)) + #:phases + #~(modify-phases %standard-phases + (add-before 'install 'build + (lambda args + (invoke "make" "-C" "src/fonts" "all") + (union-build "fonts" + '("src/fonts/ttf" + "src/fonts/woff" + "src/fonts/woff2") + #:symlink copy-file))) + (add-after 'build 'build-metrics + (lambda args + (with-directory-excursion "dockers/fonts" + ;; script assumes it is run from this directory + (invoke "./buildMetrics.sh"))))))) + (home-page "https://katex.org") + (synopsis "Fonts for KaTeX") + (description "This package contains the fonts required for KaTeX.") + (license license:expat))) + (define-public js-commander (package (name "js-commander")