[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/02: website: Add locales in manifest.
From: |
julien lepiller |
Subject: |
01/02: website: Add locales in manifest. |
Date: |
Sat, 10 Apr 2021 06:57:58 -0400 (EDT) |
roptat pushed a commit to branch master
in repository guix-artwork.
commit d6b24b1970f7e78932ec1936927271887e76fa70
Author: Julien Lepiller <julien@lepiller.eu>
AuthorDate: Tue Apr 6 22:16:43 2021 +0200
website: Add locales in manifest.
* website/manifest.scm: Add locale definition for all our translations.
---
website/manifest.scm | 62 +++++++++++++++++++++++++++++++++++++++++-----------
1 file changed, 49 insertions(+), 13 deletions(-)
diff --git a/website/manifest.scm b/website/manifest.scm
index eda382a..6beb78e 100644
--- a/website/manifest.scm
+++ b/website/manifest.scm
@@ -1,6 +1,8 @@
(use-modules (guix packages)
((gnu packages package-management) #:select (guix))
((gnu packages guile-xyz) #:select (haunt))
+ (gnu system locale)
+ (ice-9 rdelim)
(srfi srfi-1))
(define the-good-guile
@@ -14,17 +16,51 @@
`(("guile" ,the-good-guile)
,@(alist-delete "guile" (package-inputs haunt))))))
-(packages->manifest
- (append
- ;; Guile needs to be compatible
- (list
- guix
- the-good-guile
- haunt-the-ghost)
+(define locales
+ (locale-directory
+ (call-with-input-file "po/LINGUAS"
+ (lambda (port)
+ (let loop ((line (read-line port))
+ (locales '()))
+ (if (eof-object? line)
+ locales
+ (if (equal? (string-ref line 0) #\#)
+ (loop (read-line port) locales)
+ (loop (read-line port)
+ (cons
+ (locale-definition
+ (name (string-append line ".utf8"))
+ (source line))
+ locales)))))))
+ #:libcs
+ (list glibc)))
- ;; Other packages
- (map specification->package
- (list
- "glibc-locales"
- "git"
- "guile-syntax-highlight"))))
+(manifest
+ (cons
+ (manifest-entry
+ (name "locales")
+ (version "0")
+ (item (computed-file "locales"
+ (with-imported-modules '((guix build utils))
+ #~(let ((out (string-append #$output "/lib/locale")))
+ (use-modules (guix build utils))
+ (mkdir-p out)
+ (copy-recursively #$locales out)))))
+ (search-paths
+ (list (search-path-specification
+ (variable "GUIX_LOCPATH")
+ (files '("lib/locale"))))))
+ (manifest-entries
+ (packages->manifest
+ (append
+ ;; Guile needs to be compatible
+ (list
+ guix
+ the-good-guile
+ haunt-the-ghost)
+
+ ;; Other packages
+ (map specification->package
+ (list
+ "git"
+ "guile-syntax-highlight")))))))