Subject: Re: [patch] font-cns11643: ... unzip error

From: Brendan Tildesley <[email-masked]>
Date: Tue, 1 Feb 2022 02:23:50 +0100 (CET)

> On 01/31/2022 1:35 PM Maxime Devos <[email-masked]> wrote:
> 
>  
> Brendan Tildesley schreef op ma 31-01-2022 om 12:23 [+0100]:
> > I just noticed there is also this:
> > 
> > starting phase `install-locale'
> > warning: failed to install 'en_US.utf8' locale: Invalid argument
> > 
> > 
> > It occurs for other font-build-system fonts too. Adding glibc-utf8-locales or glibc-locales didn't fix it.
> > I don't understand it because its just based off gnu-build-system which doesn't have that issue.
> > 
> > It doesn't GUIX_LOCPATH either
> 
> Perhaps the cause is that font-build-system doesn't have glibc among
> its (implicit) native-inputs, and hence there's no GUIX_LOCPATH search
> path (see <https://issues.guix.gnu.org/22138>)?
> 
> Adding glibc to the native-inputs might work.
> 
> Greetings,
> Maxime. 

Fixed it (attached).

From 7af44a6109dae1c056abb10d18e8eecb7113e836 Mon Sep 17 00:00:00 2001
From: Brendan Tildesley <[email-masked]>
Date: Mon, 31 Jan 2022 12:55:23 +1100
Subject: [PATCH] gnu: font-cns11643: Update to 98.1.20220104.

* gnu/packages/fonts.scm (font-cns11643): Update to 98.1.20220104.
Use stable archive.org link.
Only extract the files we need, and fix an error caused by unzip
"missmatch local filename" warnings.
---
 gnu/packages/fonts.scm | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm
index 8afb453970..e3a974b6b0 100644
--- a/gnu/packages/fonts.scm
+++ b/gnu/packages/fonts.scm
@@ -18,7 +18,7 @@
 ;;; Copyright © 2017 José Miguel Sánchez García <[email-masked]>
 ;;; Copyright © 2017 Alex Griffin <[email-masked]>
 ;;; Copyright © 2017 Clément Lassieur <[email-masked]>
-;;; Copyright © 2017 Brendan Tildesley <[email-masked]>
+;;; Copyright © 2017, 2022 Brendan Tildesley <[email-masked]>
 ;;; Copyright © 2017, 2018, 2019, 2020 Arun Isaac <[email-masked]>
 ;;; Copyright © 2017 Mohammed Sadiq <[email-masked]>
 ;;; Copyright © 2018 Charlie Ritter <[email-masked]>
@@ -530,17 +530,26 @@ (define-public font-adobe-source-han-sans
 (define-public font-cns11643
   ;; Since upstream doesn't provide any version numbers, the date of the last
   ;; edit is used, taken from https://data.gov.tw/dataset/5961
-  ;; XXX: The source is also updated in-place, so it may be desirable to mirror
-  ;; it elsewhere to avoid suddenly losing the current source file.
+  ;; Use the archive.org mirror since the source is updated in place.
   (package
     (name "font-cns11643")
-    (version "98.1.20180605")
+    (version "98.1.20220104")
     (source (origin
               (method url-fetch)
-              (uri "http://www.cns11643.gov.tw/AIDB/Open_Data.zip")
+              (uri (string-append
+                    "https://web.archive.org/web/20220119072046/"
+                    "http://www.cns11643.gov.tw/AIDB/Open_Data.zip"))
               (sha256
                (base32
-                "000a9whrjr1cd4pjc23pbl60zwkq3wcb5g61p9qi7fn3hwkp0kyw"))))
+                "0ygq7a0gb0nah74wlvf84kss68k514dml1wkcihv2s5v5j9rys0y"))))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'unpack
+           (lambda* (#:key source #:allow-other-keys)
+             ;; Prevent filename warnings from causing an error, and only
+             ;; extract the .ttf files we need.
+             (invoke "unzip" "-j" source "Open_Data/Fonts/*ttf"))))))
     (build-system font-build-system)
     (home-page "http://www.cns11643.gov.tw/AIDB/welcome.do")
     (synopsis "CJK TrueType fonts, TW-Kai and TW-Sung")
-- 
2.34.0