gnu: Remove unneeded uses of 'libiconv'.
[jackhill/guix/guix.git] / gnu / packages / unicode.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2020 Liliana Marie Prikler <liliana.prikler@gmail.com>
3 ;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2021 Felix Gruber <felgru@posteo.net>
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)
22 #:use-module (gnu packages autotools)
23 #:use-module (guix git-download)
24 #:use-module (guix licenses)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix utils)
28 #:use-module (guix build-system copy)
29 #:use-module (guix build-system gnu)
30 #:use-module (guix build-system trivial))
31
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
73 breaking algorithms as described in Unicode Standard Annex 14 and
74 Unicode Standard Annex 29. It is designed to be used in a generic text
75 renderer.")
76 (license zlib)))
77
78 (define-public ucd
79 (package
80 (name "ucd")
81 (version "12.0.0")
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
88 (base32
89 "1ighy39cjkmqnv1797wrxjz76mv1fdw7zp5j04q55bkwxsdkvrmh"))))
90 (build-system copy-build-system)
91 (arguments
92 '(#:install-plan
93 '(("." "share/ucd/"))))
94 (home-page "https://www.unicode.org")
95 (synopsis "Unicode Character Database")
96 (description
97 "The @dfn{Unicode Character Database} (UCD) consists of a number of data
98 files listing Unicode character properties and related data. It also includes
99 test data for conformance to several important Unicode algorithms.")
100 (license unicode)))
101
102 (define-public ucd-next
103 (package
104 (inherit ucd)
105 (name "ucd-next")
106 (version "14.0.0")
107 (source
108 (origin
109 (method url-fetch/zipbomb)
110 (uri (string-append "https://www.unicode.org/Public/zipped/" version
111 "/UCD.zip"))
112 (sha256
113 (base32
114 "001nq9w52ijma0vps40xwy2q6ylpyf1393lzb128ibypnmv54fh3"))))))
115
116 (define (unicode-emoji-file name version hash)
117 (origin
118 (method url-fetch)
119 (uri (string-append "https://www.unicode.org/Public/emoji/"
120 version
121 "/emoji-" name ".txt"))
122 (sha256 (base32 hash))))
123
124 (define-public unicode-emoji
125 (package
126 (name "unicode-emoji")
127 (version "12.0")
128 (source #f)
129 (build-system trivial-build-system)
130 (arguments
131 `(#:modules ((guix build utils))
132 #:builder
133 (let ((out (string-append %output "/share/unicode/emoji")))
134 (use-modules (guix build utils))
135 (mkdir-p out)
136 (for-each
137 (lambda (input)
138 (copy-file
139 (cdr input)
140 (string-append out "/"
141 (substring (car input) 8) ; strip "unicode-"
142 ".txt")))
143 %build-inputs)
144 #t)))
145 (inputs
146 `(("unicode-emoji-data"
147 ,(unicode-emoji-file
148 "data" version
149 "03sf7h1d6kb9m5s02lif88jsi5kjszpkfvcymaqxj8ds70ar9pgv"))
150 ("unicode-emoji-sequences"
151 ,(unicode-emoji-file
152 "sequences" version
153 "1hghki2rn3n7m4lwpwi2a5wrsf2nij4bxga9ldabx4g0g2k23svs"))
154 ("unicode-emoji-test"
155 ,(unicode-emoji-file
156 "test" version
157 "1dqd0fh999mh6naj816ni113m9dimfy3ih9nffjq2lrv9mmlgdck"))
158 ("unicode-emoji-variation-sequences"
159 ,(unicode-emoji-file
160 "variation-sequences" version
161 "1cccwx5bl79w4c19vi5dhjqxrph92s8hihp9y8s2cqvdzmgbln7a"))
162 ("unicode-emoji-zwj-sequences"
163 ,(unicode-emoji-file
164 "zwj-sequences" version
165 "1l791nbijmmhwa7kmvfn8gp26ban512l6mgqpz1mnbq3xm19181n"))))
166 (home-page "https://www.unicode.org")
167 (synopsis "Unicode Emoji data")
168 (description
169 "This package includes data files listing characters and sequences, that
170 Unicode emoji supporting fonts or keyboards should support according to the
171 Unicode Technological Standard #51.")
172 (license unicode)))
173
174 (define-public unicode-cldr-common
175 (package
176 (name "unicode-cldr-common")
177 (version "36.0")
178 (source
179 (origin
180 (method url-fetch/zipbomb)
181 (uri (string-append "https://unicode.org/Public/cldr/"
182 (version-major version)
183 "/cldr-common-" version ".zip"))
184 (sha256
185 (base32
186 "0hxsc3j5zb32hmiaj0r3ajchmklx6zng6zlh1ca6s9plq5b9w9q7"))))
187 (build-system copy-build-system)
188 (arguments
189 '(#:install-plan
190 '(("common" "share/unicode/cldr/"))))
191 (home-page "https://www.unicode.org")
192 (synopsis "Locale data repository")
193 (description
194 "The Unicode Common Locale Data Repository (CLDR) is a large repository
195 of locale data, including among others
196
197 @itemize
198 @item patterns for formatting and parsing,
199 @item name translations,
200 @item and various information on languages, scripts and country-specific
201 conventions.
202 @end itemize\n")
203 (license unicode)))