gnu: emacs-consult: Fix grammar.
[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>
4e080fbb 4;;; Copyright © 2016, 2017 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>
4c9e7975
AE
11;;;
12;;; This file is part of GNU Guix.
13;;;
14;;; GNU Guix is free software; you can redistribute it and/or modify it
15;;; under the terms of the GNU General Public License as published by
16;;; the Free Software Foundation; either version 3 of the License, or (at
17;;; your option) any later version.
18;;;
19;;; GNU Guix is distributed in the hope that it will be useful, but
20;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22;;; GNU General Public License for more details.
23;;;
24;;; You should have received a copy of the GNU General Public License
25;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26
1ffa7090 27(define-module (gnu packages icu4c)
59a43334 28 #:use-module (gnu packages)
ee1dc9b3 29 #:use-module (gnu packages java)
1ffa7090 30 #:use-module (gnu packages perl)
27ed6960 31 #:use-module (gnu packages python)
4c9e7975
AE
32 #:use-module (guix licenses)
33 #:use-module (guix packages)
63eb30c1 34 #:use-module (guix utils)
4c9e7975 35 #:use-module (guix download)
1d4234d4 36 #:use-module (guix build-system ant)
4c9e7975
AE
37 #:use-module (guix build-system gnu))
38
39(define-public icu4c
40 (package
41 (name "icu4c")
8d425d74 42 (version "66.1")
4c9e7975
AE
43 (source (origin
44 (method url-fetch)
d5df6fc7 45 (uri (string-append
e8acfd1a
MB
46 "https://github.com/unicode-org/icu/releases/download/release-"
47 (string-map (lambda (x) (if (char=? x #\.) #\- x)) version)
d5df6fc7
AW
48 "/icu4c-"
49 (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version)
50 "-src.tgz"))
63bd6643
MB
51 (patch-flags '("-p2"))
52 (patches (search-patches "icu4c-CVE-2020-10531.patch"))
1319cfe9 53 (sha256
8d425d74 54 (base32 "0bharwzc9nzkbrcf405z2nb3h7q0711z450arz0mjmdrk8hg58sj"))))
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
0d93648b 64 `(("perl" ,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))
fbd2b8da
MB
85 (add-after 'install 'avoid-coreutils-reference
86 ;; Don't keep a reference to the build tools.
87 (lambda* (#:key outputs #:allow-other-keys)
88 (let ((out (assoc-ref outputs "out")))
89 (substitute* (find-files (string-append out "/lib/icu")
90 "\\.inc$")
91 (("INSTALL_CMD=.*/bin/install") "INSTALL_CMD=install"))
92 #t))))))
35b9e423 93 (synopsis "International Components for Unicode")
4c9e7975
AE
94 (description
95 "ICU is a set of C/C++ and Java libraries providing Unicode and
35b9e423 96globalisation support for software applications. This package contains the
4c9e7975
AE
97C/C++ part.")
98 (license x11)
99 (home-page "http://site.icu-project.org/")))
a408e757 100
8169cc73
MB
101(define-public icu4c-67
102 (package
103 (inherit icu4c)
104 (version "67.1")
105 (source (origin
106 (method url-fetch)
107 (uri (string-append
108 "https://github.com/unicode-org/icu/releases/download/release-"
109 (string-map (lambda (x) (if (char=? x #\.) #\- x)) version)
110 "/icu4c-"
111 (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version)
112 "-src.tgz"))
113 (sha256
114 (base32
115 "1p6mhvxl0xr2n0g6xdps3mwzwlv6mjsz3xlpm793p9aiybb0ra4l"))))))
e28ca84b
MB
116
117(define-public icu4c-68
118 (package
119 (inherit icu4c)
18a342be 120 (version "68.2")
e28ca84b
MB
121 (source (origin
122 (method url-fetch)
123 (uri (string-append
124 "https://github.com/unicode-org/icu/releases/download/release-"
125 (string-map (lambda (x) (if (char=? x #\.) #\- x)) version)
126 "/icu4c-"
127 (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version)
128 "-src.tgz"))
129 (sha256
130 (base32
18a342be 131 "09fng7a80xj8d5r1cgbgq8r47dsw5jsr6si9p2cj2ylhwgg974f7"))))))
8169cc73 132
63eb30c1
MO
133(define-public icu4c-build-root
134 (package
135 (inherit icu4c)
136 (name "icu4c-build-root")
137 (arguments
138 (substitute-keyword-arguments (package-arguments icu4c)
139 ((#:tests? _ '())
140 #f)
141 ((#:out-of-source? _ '())
142 #t)
143 ((#:phases phases)
144 `(modify-phases ,phases
145 (replace 'install
146 (lambda* (#:key outputs #:allow-other-keys)
147 (let ((out (assoc-ref outputs "out")))
148 (copy-recursively "../build" out)
149 #t)))))))
150 (native-inputs '())))
151
1d4234d4
RW
152(define-public java-icu4j
153 (package
154 (name "java-icu4j")
ee1dc9b3 155 (version "66.1")
1d4234d4
RW
156 (source (origin
157 (method url-fetch)
ee1dc9b3
BH
158 (uri (string-append
159 "https://github.com/unicode-org/icu/releases/download/release-"
160 (string-map (lambda (x) (if (char=? x #\.) #\- x)) version)
161 "/icu4j-"
162 (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version)
163 ".tgz"))
1d4234d4 164 (sha256
ee1dc9b3 165 (base32 "1ahdyz9209lwl7knb2l3gmnkkby221p0vpgx70fj4j02rdzgvw0d"))))
1d4234d4
RW
166 (build-system ant-build-system)
167 (arguments
ee1dc9b3
BH
168 `(#:make-flags
169 (list (string-append "-Djunit.core.jar="
170 (car (find-files
171 (assoc-ref %build-inputs "java-junit")
172 ".*.jar$")))
173 (string-append "-Djunit.junitparams.jar="
174 (car (find-files
175 (assoc-ref %build-inputs "java-junitparams")
176 ".*.jar$")))
177 (string-append "-Djunit.hamcrest.jar="
178 (car (find-files
179 (assoc-ref %build-inputs "java-hamcrest-core")
180 ".*.jar$"))))
181 #:phases
182 (modify-phases %standard-phases
183 (add-before 'configure 'chdir
184 (lambda _
185 (chdir "..")
186 #t))
187 (add-before 'build 'remove-ivy
188 (lambda _
189 ;; This target wants to download ivy and use it to download
190 ;; junit.
191 (substitute* "build.xml"
192 (("depends=\"test-init-junit-dependency\"") ""))
193 #t))
194 (replace 'install
195 (lambda* (#:key outputs #:allow-other-keys)
196 (let ((share (string-append (assoc-ref outputs "out")
197 "/share/java/")))
198 (mkdir-p share)
199 (install-file "icu4j.jar" share)
200 #t))))))
201 (native-inputs
202 `(("java-junit" ,java-junit)
203 ("java-junitparams" ,java-junitparams)
204 ("java-hamcrest-core" ,java-hamcrest-core)))
1d4234d4
RW
205 (home-page "http://site.icu-project.org/")
206 (synopsis "International Components for Unicode")
207 (description
208 "ICU is a set of C/C++ and Java libraries providing Unicode and
209globalisation support for software applications. This package contains the
210Java part.")
211 (license x11)))