Merge branch 'master' into staging
[jackhill/guix/guix.git] / gnu / packages / unicode.scm
CommitLineData
b7f0a55a 1;;; GNU Guix --- Functional package management for GNU
719bbcc1 2;;; Copyright © 2020 Liliana Marie Prikler <liliana.prikler@gmail.com>
a18ed171 3;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
7074b9af 4;;; Copyright © 2021 Felix Gruber <felgru@posteo.net>
b7f0a55a
LP
5;;;
6;;; This file is part of GNU Guix.
7;;;
8;;; GNU Guix is free software; you can redistribute it and/or modify it
9;;; under the terms of the GNU General Public License as published by
10;;; the Free Software Foundation; either version 3 of the License, or (at
11;;; your option) any later version.
12;;;
13;;; GNU Guix is distributed in the hope that it will be useful, but
14;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;;; GNU General Public License for more details.
17;;;
18;;; You should have received a copy of the GNU General Public License
19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21(define-module (gnu packages unicode)
7074b9af
FG
22 #:use-module (gnu packages autotools)
23 #:use-module (guix git-download)
b7f0a55a
LP
24 #:use-module (guix licenses)
25 #:use-module (guix packages)
26 #:use-module (guix download)
1a9f666b 27 #:use-module (guix utils)
a18ed171 28 #:use-module (guix build-system copy)
7074b9af 29 #:use-module (guix build-system gnu)
b7f0a55a
LP
30 #:use-module (guix build-system trivial))
31
7074b9af
FG
32(define-public libunibreak
33 (package
34 (name "libunibreak")
35 (version "5.0")
36 (source (origin
37 (method git-fetch)
38 (uri (git-reference
39 (url "https://github.com/adah1972/libunibreak")
40 (commit (string-append "libunibreak_"
41 (string-replace-substring version "." "_")))))
42 (file-name (git-file-name name version))
43 (sha256
44 (base32
45 "0r5dndhwsiy65lmavz3vdgal9nl8g97hbmdjg6zyq3zh5hs87vwf"))))
46 (build-system gnu-build-system)
47 (native-inputs
48 (list autoconf-wrapper
49 automake
50 libtool
51 ucd-next ; required for tests
52 ))
53 (arguments
54 `(#:parallel-tests? #f ; parallel tests cause non-deterministic
55 ; build failures
56 #:phases
57 (modify-phases %standard-phases
58 (add-before 'check 'pre-check
59 (lambda* (#:key inputs #:allow-other-keys)
60 (for-each (lambda (file)
61 (copy-file
62 (search-input-file inputs
63 (string-append "/share/ucd/auxiliary/"
64 file))
65 (string-append "src/" file)))
66 '("LineBreakTest.txt"
67 "WordBreakTest.txt"
68 "GraphemeBreakTest.txt")))))))
69 (home-page "http://vimgadgets.sourceforge.net/libunibreak/")
70 (synopsis "Unicode line breaking and word breaking algorithms")
71 (description
72 "Libunibreak is an implementation of the line breaking and word
73breaking algorithms as described in Unicode Standard Annex 14 and
74Unicode Standard Annex 29. It is designed to be used in a generic text
75renderer.")
76 (license zlib)))
77
5a2ef79d
LP
78(define-public ucd
79 (package
80 (name "ucd")
3ff2ac49 81 (version "14.0.0")
5a2ef79d
LP
82 (source
83 (origin
84 (method url-fetch/zipbomb)
85 (uri (string-append "https://www.unicode.org/Public/zipped/" version
86 "/UCD.zip"))
87 (sha256
3ff2ac49 88 (base32 "001nq9w52ijma0vps40xwy2q6ylpyf1393lzb128ibypnmv54fh3"))))
a18ed171 89 (build-system copy-build-system)
5a2ef79d 90 (arguments
a18ed171
EF
91 '(#:install-plan
92 '(("." "share/ucd/"))))
5a2ef79d
LP
93 (home-page "https://www.unicode.org")
94 (synopsis "Unicode Character Database")
95 (description
96 "The @dfn{Unicode Character Database} (UCD) consists of a number of data
97files listing Unicode character properties and related data. It also includes
98test data for conformance to several important Unicode algorithms.")
99 (license unicode)))
100
e2e39d2c
FG
101(define-public ucd-next
102 (package
103 (inherit ucd)
104 (name "ucd-next")
105 (version "14.0.0")
106 (source
107 (origin
108 (method url-fetch/zipbomb)
109 (uri (string-append "https://www.unicode.org/Public/zipped/" version
110 "/UCD.zip"))
111 (sha256
112 (base32
113 "001nq9w52ijma0vps40xwy2q6ylpyf1393lzb128ibypnmv54fh3"))))))
114
b7f0a55a
LP
115(define (unicode-emoji-file name version hash)
116 (origin
117 (method url-fetch)
118 (uri (string-append "https://www.unicode.org/Public/emoji/"
119 version
120 "/emoji-" name ".txt"))
121 (sha256 (base32 hash))))
122
123(define-public unicode-emoji
124 (package
125 (name "unicode-emoji")
126 (version "12.0")
127 (source #f)
128 (build-system trivial-build-system)
129 (arguments
130 `(#:modules ((guix build utils))
131 #:builder
132 (let ((out (string-append %output "/share/unicode/emoji")))
133 (use-modules (guix build utils))
134 (mkdir-p out)
135 (for-each
136 (lambda (input)
137 (copy-file
138 (cdr input)
139 (string-append out "/"
140 (substring (car input) 8) ; strip "unicode-"
141 ".txt")))
142 %build-inputs)
143 #t)))
144 (inputs
145 `(("unicode-emoji-data"
146 ,(unicode-emoji-file
147 "data" version
148 "03sf7h1d6kb9m5s02lif88jsi5kjszpkfvcymaqxj8ds70ar9pgv"))
149 ("unicode-emoji-sequences"
150 ,(unicode-emoji-file
151 "sequences" version
152 "1hghki2rn3n7m4lwpwi2a5wrsf2nij4bxga9ldabx4g0g2k23svs"))
153 ("unicode-emoji-test"
154 ,(unicode-emoji-file
155 "test" version
156 "1dqd0fh999mh6naj816ni113m9dimfy3ih9nffjq2lrv9mmlgdck"))
157 ("unicode-emoji-variation-sequences"
158 ,(unicode-emoji-file
159 "variation-sequences" version
160 "1cccwx5bl79w4c19vi5dhjqxrph92s8hihp9y8s2cqvdzmgbln7a"))
161 ("unicode-emoji-zwj-sequences"
162 ,(unicode-emoji-file
163 "zwj-sequences" version
164 "1l791nbijmmhwa7kmvfn8gp26ban512l6mgqpz1mnbq3xm19181n"))))
165 (home-page "https://www.unicode.org")
166 (synopsis "Unicode Emoji data")
167 (description
168 "This package includes data files listing characters and sequences, that
169Unicode emoji supporting fonts or keyboards should support according to the
170Unicode Technological Standard #51.")
171 (license unicode)))
1a9f666b
LP
172
173(define-public unicode-cldr-common
174 (package
175 (name "unicode-cldr-common")
176 (version "36.0")
177 (source
178 (origin
179 (method url-fetch/zipbomb)
180 (uri (string-append "https://unicode.org/Public/cldr/"
181 (version-major version)
182 "/cldr-common-" version ".zip"))
183 (sha256
184 (base32
185 "0hxsc3j5zb32hmiaj0r3ajchmklx6zng6zlh1ca6s9plq5b9w9q7"))))
4beac3a8 186 (build-system copy-build-system)
1a9f666b 187 (arguments
4beac3a8
EF
188 '(#:install-plan
189 '(("common" "share/unicode/cldr/"))))
1a9f666b
LP
190 (home-page "https://www.unicode.org")
191 (synopsis "Locale data repository")
192 (description
193 "The Unicode Common Locale Data Repository (CLDR) is a large repository
194of locale data, including among others
195
196@itemize
197@item patterns for formatting and parsing,
198@item name translations,
adca9882 199@item and various information on languages, scripts and country-specific
1a9f666b
LP
200 conventions.
201@end itemize\n")
202 (license unicode)))