From: Julien Lepiller <julien@lepiller.eu>
To: Luis Felipe <luis.felipe.la@protonmail.com>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: website: Building fails because of missing locales
Date: Wed, 7 Apr 2021 19:22:32 +0200 [thread overview]
Message-ID: <20210407192232.6cecaa03@tachikoma.lepiller.eu> (raw)
In-Reply-To: <741C09DA-7BA1-46AC-BCAA-B9839D146C68@lepiller.eu>
[-- Attachment #1: Type: text/plain, Size: 124 bytes --]
Here's v2.
I checked that it sets GUIX_LOCPATH properly on my system (I had to add
the path specification for it to work).
[-- Attachment #2: 0001-website-Add-locales-in-manifest.patch --]
[-- Type: text/x-patch, Size: 2783 bytes --]
From 70aa3b969e1830bce9e44b8dda0a97fcb27cce89 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Tue, 6 Apr 2021 22:16:43 +0200
Subject: [PATCH] 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")))))))
--
2.31.0
next prev parent reply other threads:[~2021-04-07 17:33 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-06 15:59 website: Building fails because of missing locales Luis Felipe
2021-04-06 18:11 ` Leo Famulari
2021-04-06 20:20 ` Julien Lepiller
2021-04-07 2:20 ` Luis Felipe
2021-04-07 11:09 ` Julien Lepiller
2021-04-07 13:48 ` Luis Felipe
2021-04-07 15:10 ` Julien Lepiller
2021-04-07 16:27 ` Luis Felipe
2021-04-07 17:13 ` Julien Lepiller
2021-04-07 17:22 ` Julien Lepiller [this message]
2021-04-07 18:11 ` Luis Felipe
2021-04-08 20:04 ` Luis Felipe
2021-04-10 11:00 ` Julien Lepiller
2021-04-06 18:14 ` Julien Lepiller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210407192232.6cecaa03@tachikoma.lepiller.eu \
--to=julien@lepiller.eu \
--cc=guix-devel@gnu.org \
--cc=luis.felipe.la@protonmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).