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