Commit | Line | Data |
---|---|---|
4c9e7975 AE |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr> | |
93cb98d4 | 3 | ;;; Copyright © 2015, 2016 Mark H Weaver <mhw@netris.org> |
e0e87fe3 | 4 | ;;; Copyright © 2016, 2017, 2020, 2022 Efraim Flashner <efraim@flashner.co.il> |
a408e757 | 5 | ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org> |
1d4234d4 | 6 | ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net> |
e15acf8c | 7 | ;;; Copyright © 2019, 2020 Marius Bakke <mbakke@fastmail.com> |
63eb30c1 | 8 | ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com> |
ee1dc9b3 BH |
9 | ;;; Copyright © 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de> |
10 | ;;; Copyright © 2020 Julien Lepiller <julien@lepiller.eu> | |
048934c3 | 11 | ;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net> |
4c9e7975 AE |
12 | ;;; |
13 | ;;; This file is part of GNU Guix. | |
14 | ;;; | |
15 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
16 | ;;; under the terms of the GNU General Public License as published by | |
17 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
18 | ;;; your option) any later version. | |
19 | ;;; | |
20 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
21 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
22 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
23 | ;;; GNU General Public License for more details. | |
24 | ;;; | |
25 | ;;; You should have received a copy of the GNU General Public License | |
26 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
27 | ||
1ffa7090 | 28 | (define-module (gnu packages icu4c) |
59a43334 | 29 | #:use-module (gnu packages) |
ee1dc9b3 | 30 | #:use-module (gnu packages java) |
1ffa7090 | 31 | #:use-module (gnu packages perl) |
27ed6960 | 32 | #:use-module (gnu packages python) |
048934c3 | 33 | #:use-module (guix gexp) |
4c9e7975 AE |
34 | #:use-module (guix licenses) |
35 | #:use-module (guix packages) | |
63eb30c1 | 36 | #:use-module (guix utils) |
4c9e7975 | 37 | #:use-module (guix download) |
1d4234d4 | 38 | #:use-module (guix build-system ant) |
4c9e7975 AE |
39 | #:use-module (guix build-system gnu)) |
40 | ||
41 | (define-public icu4c | |
42 | (package | |
43 | (name "icu4c") | |
5492b1b5 | 44 | (version "69.1") |
4c9e7975 AE |
45 | (source (origin |
46 | (method url-fetch) | |
d5df6fc7 | 47 | (uri (string-append |
e8acfd1a MB |
48 | "https://github.com/unicode-org/icu/releases/download/release-" |
49 | (string-map (lambda (x) (if (char=? x #\.) #\- x)) version) | |
d5df6fc7 AW |
50 | "/icu4c-" |
51 | (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version) | |
52 | "-src.tgz")) | |
1319cfe9 | 53 | (sha256 |
5492b1b5 | 54 | (base32 "0icps0avkwy5df3wwc5kybxcg63hcgk4phdh9g244g0xrmx7pfjc")))) |
4c9e7975 | 55 | (build-system gnu-build-system) |
63eb30c1 MO |
56 | ;; When cross-compiling, this package needs a source directory of a |
57 | ;; native-build of itself. | |
27ed6960 | 58 | (native-inputs |
63eb30c1 MO |
59 | `(("python" ,python-minimal) |
60 | ,@(if (%current-target-system) | |
61 | `(("icu4c-build-root" ,icu4c-build-root)) | |
62 | '()))) | |
a2270ce2 | 63 | (inputs |
8394619b | 64 | (list perl)) |
4c9e7975 | 65 | (arguments |
0d93648b | 66 | `(#:configure-flags |
63eb30c1 MO |
67 | (list |
68 | "--enable-rpath" | |
69 | ,@(if (%current-target-system) | |
70 | '((string-append "--with-cross-build=" | |
71 | (assoc-ref %build-inputs "icu4c-build-root"))) | |
72 | '())) | |
a2270ce2 | 73 | #:phases |
c296d5d1 EF |
74 | (modify-phases %standard-phases |
75 | (add-after 'unpack 'chdir-to-source | |
fbd2b8da | 76 | (lambda _ (chdir "source") #t)) |
f73fe13c MB |
77 | (add-after 'chdir-to-source 'update-LDFLAGS |
78 | (lambda _ | |
79 | ;; Do not create a "data-only" libicudata.so because it causes | |
80 | ;; problems on some architectures (notably armhf and MIPS). | |
81 | (substitute* "config/mh-linux" | |
82 | (("LDFLAGSICUDT=-nodefaultlibs -nostdlib") | |
83 | "LDFLAGSICUDT=")) | |
84 | #t)) | |
b72f5255 EF |
85 | ,@(if (target-riscv64?) |
86 | `((add-after 'unpack 'disable-failing-test | |
87 | ;; It is unknown why this test is failing. | |
88 | (lambda _ | |
89 | (substitute* "source/test/intltest/numbertest_api.cpp" | |
90 | (("(TESTCASE_AUTO\\(unitUsage\\));" all) | |
91 | (string-append "//" all)))))) | |
92 | '()) | |
fbd2b8da MB |
93 | (add-after 'install 'avoid-coreutils-reference |
94 | ;; Don't keep a reference to the build tools. | |
95 | (lambda* (#:key outputs #:allow-other-keys) | |
96 | (let ((out (assoc-ref outputs "out"))) | |
97 | (substitute* (find-files (string-append out "/lib/icu") | |
98 | "\\.inc$") | |
99 | (("INSTALL_CMD=.*/bin/install") "INSTALL_CMD=install")) | |
100 | #t)))))) | |
35b9e423 | 101 | (synopsis "International Components for Unicode") |
4c9e7975 AE |
102 | (description |
103 | "ICU is a set of C/C++ and Java libraries providing Unicode and | |
35b9e423 | 104 | globalisation support for software applications. This package contains the |
4c9e7975 AE |
105 | C/C++ part.") |
106 | (license x11) | |
107 | (home-page "http://site.icu-project.org/"))) | |
a408e757 | 108 | |
aa3e9904 MB |
109 | (define-public icu4c-71 |
110 | (package | |
111 | (inherit icu4c) | |
112 | (version "71.1") | |
113 | (source (origin | |
114 | (method url-fetch) | |
115 | (uri (string-append | |
116 | "https://github.com/unicode-org/icu/releases/download/release-" | |
117 | (string-map (lambda (x) (if (char=? x #\.) #\- x)) version) | |
118 | "/icu4c-" | |
119 | (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version) | |
120 | "-src.tgz")) | |
121 | (sha256 | |
122 | (base32 | |
123 | "1gqywaqj9jmdwrng9lm6inyqmi5j2cz36db9dcqg3yk13zjyd9v7")))))) | |
124 | ||
ac407798 JB |
125 | (define-public icu4c-70 |
126 | (package | |
127 | (inherit icu4c) | |
128 | (version "70.1") | |
129 | (source (origin | |
130 | (method url-fetch) | |
131 | (uri (string-append | |
132 | "https://github.com/unicode-org/icu/releases/download/release-" | |
133 | (string-map (lambda (x) (if (char=? x #\.) #\- x)) version) | |
134 | "/icu4c-" | |
135 | (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version) | |
136 | "-src.tgz")) | |
137 | (sha256 | |
138 | (base32 | |
e0e87fe3 EF |
139 | "1m9zgkaf5lyh65nyc6n0n5bs2f5k53nnj1ih6nskpwbvq4l5884d")))) |
140 | (arguments | |
141 | (if (target-riscv64?) | |
142 | (substitute-keyword-arguments (package-arguments icu4c) | |
143 | ((#:phases phases) | |
144 | `(modify-phases ,phases | |
145 | (replace 'disable-failing-test | |
146 | ;; It is unknown why these tests are failing. | |
147 | (lambda _ | |
148 | (substitute* "source/test/cintltst/ucptrietest.c" | |
149 | ((".*addTest.*") "")) | |
150 | (substitute* "source/test/intltest/numbertest_api.cpp" | |
151 | (("(TESTCASE_AUTO\\(unitUsage\\));" all) | |
152 | (string-append "//" all)))))))) | |
153 | (package-arguments icu4c))))) | |
ac407798 | 154 | |
8169cc73 MB |
155 | (define-public icu4c-67 |
156 | (package | |
157 | (inherit icu4c) | |
158 | (version "67.1") | |
159 | (source (origin | |
160 | (method url-fetch) | |
161 | (uri (string-append | |
162 | "https://github.com/unicode-org/icu/releases/download/release-" | |
163 | (string-map (lambda (x) (if (char=? x #\.) #\- x)) version) | |
164 | "/icu4c-" | |
165 | (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version) | |
166 | "-src.tgz")) | |
167 | (sha256 | |
168 | (base32 | |
169 | "1p6mhvxl0xr2n0g6xdps3mwzwlv6mjsz3xlpm793p9aiybb0ra4l")))))) | |
e28ca84b MB |
170 | |
171 | (define-public icu4c-68 | |
172 | (package | |
173 | (inherit icu4c) | |
18a342be | 174 | (version "68.2") |
e28ca84b MB |
175 | (source (origin |
176 | (method url-fetch) | |
177 | (uri (string-append | |
178 | "https://github.com/unicode-org/icu/releases/download/release-" | |
179 | (string-map (lambda (x) (if (char=? x #\.) #\- x)) version) | |
180 | "/icu4c-" | |
181 | (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version) | |
182 | "-src.tgz")) | |
183 | (sha256 | |
184 | (base32 | |
18a342be | 185 | "09fng7a80xj8d5r1cgbgq8r47dsw5jsr6si9p2cj2ylhwgg974f7")))))) |
8169cc73 | 186 | |
63eb30c1 MO |
187 | (define-public icu4c-build-root |
188 | (package | |
189 | (inherit icu4c) | |
190 | (name "icu4c-build-root") | |
191 | (arguments | |
192 | (substitute-keyword-arguments (package-arguments icu4c) | |
193 | ((#:tests? _ '()) | |
194 | #f) | |
195 | ((#:out-of-source? _ '()) | |
196 | #t) | |
197 | ((#:phases phases) | |
198 | `(modify-phases ,phases | |
199 | (replace 'install | |
200 | (lambda* (#:key outputs #:allow-other-keys) | |
201 | (let ((out (assoc-ref outputs "out"))) | |
202 | (copy-recursively "../build" out) | |
203 | #t))))))) | |
204 | (native-inputs '()))) | |
205 | ||
1d4234d4 RW |
206 | (define-public java-icu4j |
207 | (package | |
208 | (name "java-icu4j") | |
2767ee57 | 209 | (version "70.1") |
1d4234d4 RW |
210 | (source (origin |
211 | (method url-fetch) | |
ee1dc9b3 BH |
212 | (uri (string-append |
213 | "https://github.com/unicode-org/icu/releases/download/release-" | |
214 | (string-map (lambda (x) (if (char=? x #\.) #\- x)) version) | |
215 | "/icu4j-" | |
216 | (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version) | |
217 | ".tgz")) | |
1d4234d4 | 218 | (sha256 |
2767ee57 | 219 | (base32 "0qrs75iyzn19kf54q55jn8wf6xjlpkrihdwqpxm39jdh2hz4cgvj")))) |
1d4234d4 RW |
220 | (build-system ant-build-system) |
221 | (arguments | |
ee1dc9b3 | 222 | `(#:make-flags |
048934c3 GLV |
223 | ,#~(list |
224 | (string-append "-Djunit.core.jar=" | |
225 | (car (find-files | |
226 | #$(this-package-native-input "java-junit") | |
227 | ".*.jar$"))) | |
228 | (string-append "-Djunit.junitparams.jar=" | |
229 | (car (find-files | |
230 | #$(this-package-native-input "java-junitparams") | |
231 | ".*.jar$"))) | |
232 | (string-append "-Djunit.hamcrest.jar=" | |
233 | (car (find-files | |
234 | #$(this-package-native-input "java-hamcrest-core") | |
235 | ".*.jar$")))) | |
ee1dc9b3 BH |
236 | #:phases |
237 | (modify-phases %standard-phases | |
238 | (add-before 'configure 'chdir | |
239 | (lambda _ | |
2767ee57 | 240 | (chdir ".."))) |
ee1dc9b3 BH |
241 | (add-before 'build 'remove-ivy |
242 | (lambda _ | |
243 | ;; This target wants to download ivy and use it to download | |
244 | ;; junit. | |
245 | (substitute* "build.xml" | |
2767ee57 | 246 | (("depends=\"test-init-junit-dependency\"") "")))) |
ee1dc9b3 BH |
247 | (replace 'install |
248 | (lambda* (#:key outputs #:allow-other-keys) | |
249 | (let ((share (string-append (assoc-ref outputs "out") | |
250 | "/share/java/"))) | |
251 | (mkdir-p share) | |
2767ee57 | 252 | (install-file "icu4j.jar" share))))))) |
ee1dc9b3 | 253 | (native-inputs |
8394619b | 254 | (list java-junit java-junitparams java-hamcrest-core)) |
1d4234d4 RW |
255 | (home-page "http://site.icu-project.org/") |
256 | (synopsis "International Components for Unicode") | |
257 | (description | |
258 | "ICU is a set of C/C++ and Java libraries providing Unicode and | |
259 | globalisation support for software applications. This package contains the | |
260 | Java part.") | |
261 | (license x11))) |