gnu: Remove python2-pyaudio.
[jackhill/guix/guix.git] / gnu / packages / icu4c.scm
CommitLineData
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>
8c42a25b 4;;; Copyright © 2016, 2017, 2020 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 104globalisation support for software applications. This package contains the
4c9e7975
AE
105C/C++ part.")
106 (license x11)
107 (home-page "http://site.icu-project.org/")))
a408e757 108
ac407798
JB
109(define-public icu4c-70
110 (package
111 (inherit icu4c)
112 (version "70.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 "1m9zgkaf5lyh65nyc6n0n5bs2f5k53nnj1ih6nskpwbvq4l5884d"))))))
124
8169cc73
MB
125(define-public icu4c-67
126 (package
127 (inherit icu4c)
128 (version "67.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
139 "1p6mhvxl0xr2n0g6xdps3mwzwlv6mjsz3xlpm793p9aiybb0ra4l"))))))
e28ca84b
MB
140
141(define-public icu4c-68
142 (package
143 (inherit icu4c)
18a342be 144 (version "68.2")
e28ca84b
MB
145 (source (origin
146 (method url-fetch)
147 (uri (string-append
148 "https://github.com/unicode-org/icu/releases/download/release-"
149 (string-map (lambda (x) (if (char=? x #\.) #\- x)) version)
150 "/icu4c-"
151 (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version)
152 "-src.tgz"))
153 (sha256
154 (base32
18a342be 155 "09fng7a80xj8d5r1cgbgq8r47dsw5jsr6si9p2cj2ylhwgg974f7"))))))
8169cc73 156
63eb30c1
MO
157(define-public icu4c-build-root
158 (package
159 (inherit icu4c)
160 (name "icu4c-build-root")
161 (arguments
162 (substitute-keyword-arguments (package-arguments icu4c)
163 ((#:tests? _ '())
164 #f)
165 ((#:out-of-source? _ '())
166 #t)
167 ((#:phases phases)
168 `(modify-phases ,phases
169 (replace 'install
170 (lambda* (#:key outputs #:allow-other-keys)
171 (let ((out (assoc-ref outputs "out")))
172 (copy-recursively "../build" out)
173 #t)))))))
174 (native-inputs '())))
175
1d4234d4
RW
176(define-public java-icu4j
177 (package
178 (name "java-icu4j")
2767ee57 179 (version "70.1")
1d4234d4
RW
180 (source (origin
181 (method url-fetch)
ee1dc9b3
BH
182 (uri (string-append
183 "https://github.com/unicode-org/icu/releases/download/release-"
184 (string-map (lambda (x) (if (char=? x #\.) #\- x)) version)
185 "/icu4j-"
186 (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version)
187 ".tgz"))
1d4234d4 188 (sha256
2767ee57 189 (base32 "0qrs75iyzn19kf54q55jn8wf6xjlpkrihdwqpxm39jdh2hz4cgvj"))))
1d4234d4
RW
190 (build-system ant-build-system)
191 (arguments
ee1dc9b3 192 `(#:make-flags
048934c3
GLV
193 ,#~(list
194 (string-append "-Djunit.core.jar="
195 (car (find-files
196 #$(this-package-native-input "java-junit")
197 ".*.jar$")))
198 (string-append "-Djunit.junitparams.jar="
199 (car (find-files
200 #$(this-package-native-input "java-junitparams")
201 ".*.jar$")))
202 (string-append "-Djunit.hamcrest.jar="
203 (car (find-files
204 #$(this-package-native-input "java-hamcrest-core")
205 ".*.jar$"))))
ee1dc9b3
BH
206 #:phases
207 (modify-phases %standard-phases
208 (add-before 'configure 'chdir
209 (lambda _
2767ee57 210 (chdir "..")))
ee1dc9b3
BH
211 (add-before 'build 'remove-ivy
212 (lambda _
213 ;; This target wants to download ivy and use it to download
214 ;; junit.
215 (substitute* "build.xml"
2767ee57 216 (("depends=\"test-init-junit-dependency\"") ""))))
ee1dc9b3
BH
217 (replace 'install
218 (lambda* (#:key outputs #:allow-other-keys)
219 (let ((share (string-append (assoc-ref outputs "out")
220 "/share/java/")))
221 (mkdir-p share)
2767ee57 222 (install-file "icu4j.jar" share)))))))
ee1dc9b3 223 (native-inputs
8394619b 224 (list java-junit java-junitparams java-hamcrest-core))
1d4234d4
RW
225 (home-page "http://site.icu-project.org/")
226 (synopsis "International Components for Unicode")
227 (description
228 "ICU is a set of C/C++ and Java libraries providing Unicode and
229globalisation support for software applications. This package contains the
230Java part.")
231 (license x11)))