aboutsummaryrefslogtreecommitdiff
path: root/gnu/artwork.scm
blob: f404467dd769c8a952b4645259f1d5315e53ce25 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014, 2015, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu artwork)
  #:use-module (guix packages)
  #:use-module (guix git-download)
  #:export (%artwork-repository))

;;; Commentary:
;;;
;;; Common place for the definition of the Guix artwork repository.
;;;
;;; Code:

(define %artwork-repository
  (let ((commit "2f2fe74c1078be605a6a93c2193fd6c715cebbb0"))
    (origin
      (method git-fetch)
      (uri (git-reference
             (url "https://git.savannah.gnu.org/git/guix/guix-artwork.git")
             (commit commit)))
      (file-name (string-append "guix-artwork-" (string-take commit 7)
                                "-checkout"))
      (sha256
       (base32
        "0c8r0phvm3wgf914n2kw1461cwdjl2zbzqvzq9x7d9pwkgv7xmq7")))))

;;; artwork.scm ends here
d #$output "/" #$version)) ;; 'localedef' executes 'gzip' to access compressed locale sources. (setenv "PATH" (string-append #+gzip "/bin:" #+libc "/bin")) (setvbuf (current-output-port) 'line) (setvbuf (current-error-port) 'line) (for-each (lambda (locale codeset name) (build-locale locale #:codeset codeset #:name name #:directory (string-append #$output "/" #$version))) '#$(map locale-definition-source locales) '#$(map locale-definition-charset locales) '#$(map locale-definition-name locales))))) (computed-file (string-append "locale-" version) build)) (define* (locale-directory locales #:key (libcs %default-locale-libcs)) "Return a locale directory containing all of LOCALES for each libc package listed in LIBCS. It is useful to list more than one libc when willing to support already-installed packages built against a different libc since the locale data format changes between libc versions." (match libcs ((libc) (single-locale-directory locales #:libc libc)) ((libcs ..1) (let ((dirs (map (lambda (libc) (single-locale-directory locales #:libc libc)) libcs))) (computed-file "locale-multiple-versions" (with-imported-modules '((guix build union)) #~(begin (use-modules (guix build union)) (union-build #$output (list #$@dirs)))) #:options '(#:local-build? #t #:substitutable? #f)))))) (define %default-locale-libcs ;; The libcs for which we build locales by default. (list glibc glibc-2.35)) (define %default-locale-definitions ;; Arbitrary set of locales that are built by default. They come as a ;; "bonus" in addition to that specified in the 'locale' field of the ;; operating system, for the user's convenience, so they shouldn't take too ;; much space. (letrec-syntax ((utf8-locale (syntax-rules () ((_ name*) (locale-definition ;; Note: We choose "utf8", which is the ;; "normalized codeset". (name (string-append name* ".utf8")) (source name*) (charset "UTF-8"))))) (utf8-locales (syntax-rules () ((_ name ...) (list (utf8-locale name) ...))))) ;; The six UN official languages plus Portuguese, with at most two ;; variants per language. (utf8-locales "ar_DZ" "en_GB" "en_US" "es_AR" "es_ES" "fr_FR" "pt_BR" "pt_PT" "ru_RU" "zh_CN"))) ;;; ;;; Locales supported by glibc. ;;; (define* (glibc-supported-locales #:optional (glibc glibc)) "Return a file-like object that contains a list of locale name/encoding pairs such as (\"oc_FR.UTF-8\" . \"UTF-8\"). Each pair corresponds to a locale supported by GLIBC." (define build (with-imported-modules (source-module-closure '((guix build gnu-build-system) (gnu build locale))) #~(begin (use-modules (guix build gnu-build-system) (gnu build locale) (ice-9 pretty-print)) (define unpack (assq-ref %standard-phases 'unpack)) (setenv "PATH" (string-append #+(file-append tar "/bin") ":" #+(file-append xz "/bin") ":" #+(file-append gzip "/bin"))) (unpack #:source #+(package-source glibc)) (let ((locales (call-with-input-file "localedata/SUPPORTED" read-supported-locales))) (call-with-output-file #$output (lambda (port) (pretty-print locales port))))))) (computed-file "glibc-supported-locales.scm" build)) ;;; locale.scm ends here