[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#32026: [PATCH v4 1/9] gnu: Add a 'update-mozilla-locales' helper for
From: |
Maxim Cournoyer |
Subject: |
bug#32026: [PATCH v4 1/9] gnu: Add a 'update-mozilla-locales' helper for maintenance. |
Date: |
Sun, 19 Feb 2023 14:23:57 -0500 |
* gnu/packages/gnuzilla.scm (update-mozilla-locales): New procedure.
(all-mozilla-locales): Comment how to proceed to update it.
---
Changes in v4:
- Strip useful comments, in the name of non-free source obfuscation
gnu/packages/gnuzilla.scm | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm
index b2e0870fea..16e2208426 100644
--- a/gnu/packages/gnuzilla.scm
+++ b/gnu/packages/gnuzilla.scm
@@ -37,6 +37,7 @@
(define-module (gnu packages gnuzilla)
#:use-module ((srfi srfi-1) #:hide (zip))
+ #:use-module (ice-9 format)
#:use-module (ice-9 match)
#:use-module (gnu packages)
#:use-module ((guix licenses) #:prefix license:)
@@ -91,7 +92,8 @@ (define-module (gnu packages gnuzilla)
#:use-module (gnu packages xiph)
#:use-module (gnu packages xdisorg)
#:use-module (gnu packages readline)
- #:use-module (gnu packages sqlite))
+ #:use-module (gnu packages sqlite)
+ #:autoload (json parser) (json->scm))
(define-public mozjs
(package
@@ -348,6 +350,10 @@ (define-public mozjs-78
(inputs
(list icu4c readline zlib))))
+
+;;;
+;;; Localization helper procedures.
+;;;
(define mozilla-compare-locales
(origin
(method hg-fetch)
@@ -371,6 +377,18 @@ (define-syntax-rule (mozilla-locales (hash-string
changeset locale) ...)
(list (mozilla-locale locale changeset hash-string)
...))
+(define (update-mozilla-locales changesets.json)
+ "Output a new list of Mozilla locales, to update the ALL-MOZILLA-LOCALES
+variable defined bellow. It requires guile-json to be installed."
+ (match (call-with-input-file changesets.json json->scm)
+ (((lang ("revision" . revision) platforms pin) ...)
+ (let ((data (reverse (map (lambda (rev lang)
+ `(,(list->string (make-list 40 #\0))
+ ,(string-take rev 12) ,lang))
+ revision lang))))
+ (format #t "~{~s~%~}" data)
+ data))))
+
(define all-mozilla-locales
(mozilla-locales
;; sha256 changeset
locale
base-commit: 636b771536b95d15a2fd68b468deeebac97d6bee
--
2.39.1
- bug#32026: [PATCH v4 1/9] gnu: Add a 'update-mozilla-locales' helper for maintenance.,
Maxim Cournoyer <=
- bug#32026: [PATCH v4 2/9] gnu: icedove: Compute a self-contained source., Maxim Cournoyer, 2023/02/19
- bug#32026: [PATCH v4 3/9] gnu: Define %icecat-base-version at the top level., Maxim Cournoyer, 2023/02/19
- bug#32026: [PATCH v4 9/9] gnu: icecat: Unbundle nss and nspr., Maxim Cournoyer, 2023/02/19
- bug#32026: [PATCH v4 8/9] gnu: icecat: Remove gtk+-2 input., Maxim Cournoyer, 2023/02/19
- bug#32026: [PATCH v4 4/9] gnu: Add icecat-l10n and icedove-l10n., Maxim Cournoyer, 2023/02/19
- bug#32026: [PATCH v4 6/9] gnu: Add language packs to icecat and icedove., Maxim Cournoyer, 2023/02/19
- bug#32026: [PATCH v4 5/9] gnu: icedove: Automatically load system-provided extensions., Maxim Cournoyer, 2023/02/19
- bug#32026: [PATCH v4 7/9] gnu: icedove: Use the locale of the system., Maxim Cournoyer, 2023/02/19