Commit | Line | Data |
---|---|---|
b7f0a55a LP |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2020 Leo Prikler <leo.prikler@student.tugraz.at> | |
a18ed171 | 3 | ;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il> |
b7f0a55a LP |
4 | ;;; |
5 | ;;; This file is part of GNU Guix. | |
6 | ;;; | |
7 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
8 | ;;; under the terms of the GNU General Public License as published by | |
9 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
10 | ;;; your option) any later version. | |
11 | ;;; | |
12 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
13 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | ;;; GNU General Public License for more details. | |
16 | ;;; | |
17 | ;;; You should have received a copy of the GNU General Public License | |
18 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
19 | ||
20 | (define-module (gnu packages unicode) | |
21 | #:use-module (guix licenses) | |
22 | #:use-module (guix packages) | |
23 | #:use-module (guix download) | |
1a9f666b | 24 | #:use-module (guix utils) |
a18ed171 | 25 | #:use-module (guix build-system copy) |
b7f0a55a LP |
26 | #:use-module (guix build-system trivial)) |
27 | ||
5a2ef79d LP |
28 | (define-public ucd |
29 | (package | |
30 | (name "ucd") | |
31 | (version "12.0.0") | |
32 | (source | |
33 | (origin | |
34 | (method url-fetch/zipbomb) | |
35 | (uri (string-append "https://www.unicode.org/Public/zipped/" version | |
36 | "/UCD.zip")) | |
37 | (sha256 | |
38 | (base32 | |
39 | "1ighy39cjkmqnv1797wrxjz76mv1fdw7zp5j04q55bkwxsdkvrmh")))) | |
a18ed171 | 40 | (build-system copy-build-system) |
5a2ef79d | 41 | (arguments |
a18ed171 EF |
42 | '(#:install-plan |
43 | '(("." "share/ucd/")))) | |
5a2ef79d LP |
44 | (home-page "https://www.unicode.org") |
45 | (synopsis "Unicode Character Database") | |
46 | (description | |
47 | "The @dfn{Unicode Character Database} (UCD) consists of a number of data | |
48 | files listing Unicode character properties and related data. It also includes | |
49 | test data for conformance to several important Unicode algorithms.") | |
50 | (license unicode))) | |
51 | ||
b7f0a55a LP |
52 | (define (unicode-emoji-file name version hash) |
53 | (origin | |
54 | (method url-fetch) | |
55 | (uri (string-append "https://www.unicode.org/Public/emoji/" | |
56 | version | |
57 | "/emoji-" name ".txt")) | |
58 | (sha256 (base32 hash)))) | |
59 | ||
60 | (define-public unicode-emoji | |
61 | (package | |
62 | (name "unicode-emoji") | |
63 | (version "12.0") | |
64 | (source #f) | |
65 | (build-system trivial-build-system) | |
66 | (arguments | |
67 | `(#:modules ((guix build utils)) | |
68 | #:builder | |
69 | (let ((out (string-append %output "/share/unicode/emoji"))) | |
70 | (use-modules (guix build utils)) | |
71 | (mkdir-p out) | |
72 | (for-each | |
73 | (lambda (input) | |
74 | (copy-file | |
75 | (cdr input) | |
76 | (string-append out "/" | |
77 | (substring (car input) 8) ; strip "unicode-" | |
78 | ".txt"))) | |
79 | %build-inputs) | |
80 | #t))) | |
81 | (inputs | |
82 | `(("unicode-emoji-data" | |
83 | ,(unicode-emoji-file | |
84 | "data" version | |
85 | "03sf7h1d6kb9m5s02lif88jsi5kjszpkfvcymaqxj8ds70ar9pgv")) | |
86 | ("unicode-emoji-sequences" | |
87 | ,(unicode-emoji-file | |
88 | "sequences" version | |
89 | "1hghki2rn3n7m4lwpwi2a5wrsf2nij4bxga9ldabx4g0g2k23svs")) | |
90 | ("unicode-emoji-test" | |
91 | ,(unicode-emoji-file | |
92 | "test" version | |
93 | "1dqd0fh999mh6naj816ni113m9dimfy3ih9nffjq2lrv9mmlgdck")) | |
94 | ("unicode-emoji-variation-sequences" | |
95 | ,(unicode-emoji-file | |
96 | "variation-sequences" version | |
97 | "1cccwx5bl79w4c19vi5dhjqxrph92s8hihp9y8s2cqvdzmgbln7a")) | |
98 | ("unicode-emoji-zwj-sequences" | |
99 | ,(unicode-emoji-file | |
100 | "zwj-sequences" version | |
101 | "1l791nbijmmhwa7kmvfn8gp26ban512l6mgqpz1mnbq3xm19181n")))) | |
102 | (home-page "https://www.unicode.org") | |
103 | (synopsis "Unicode Emoji data") | |
104 | (description | |
105 | "This package includes data files listing characters and sequences, that | |
106 | Unicode emoji supporting fonts or keyboards should support according to the | |
107 | Unicode Technological Standard #51.") | |
108 | (license unicode))) | |
1a9f666b LP |
109 | |
110 | (define-public unicode-cldr-common | |
111 | (package | |
112 | (name "unicode-cldr-common") | |
113 | (version "36.0") | |
114 | (source | |
115 | (origin | |
116 | (method url-fetch/zipbomb) | |
117 | (uri (string-append "https://unicode.org/Public/cldr/" | |
118 | (version-major version) | |
119 | "/cldr-common-" version ".zip")) | |
120 | (sha256 | |
121 | (base32 | |
122 | "0hxsc3j5zb32hmiaj0r3ajchmklx6zng6zlh1ca6s9plq5b9w9q7")))) | |
4beac3a8 | 123 | (build-system copy-build-system) |
1a9f666b | 124 | (arguments |
4beac3a8 EF |
125 | '(#:install-plan |
126 | '(("common" "share/unicode/cldr/")))) | |
1a9f666b LP |
127 | (home-page "https://www.unicode.org") |
128 | (synopsis "Locale data repository") | |
129 | (description | |
130 | "The Unicode Common Locale Data Repository (CLDR) is a large repository | |
131 | of locale data, including among others | |
132 | ||
133 | @itemize | |
134 | @item patterns for formatting and parsing, | |
135 | @item name translations, | |
adca9882 | 136 | @item and various information on languages, scripts and country-specific |
1a9f666b LP |
137 | conventions. |
138 | @end itemize\n") | |
139 | (license unicode))) |