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> |
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 | 96 | globalisation support for software applications. This package contains the |
4c9e7975 AE |
97 | C/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")))))) | |
116 | ||
63eb30c1 MO |
117 | (define-public icu4c-build-root |
118 | (package | |
119 | (inherit icu4c) | |
120 | (name "icu4c-build-root") | |
121 | (arguments | |
122 | (substitute-keyword-arguments (package-arguments icu4c) | |
123 | ((#:tests? _ '()) | |
124 | #f) | |
125 | ((#:out-of-source? _ '()) | |
126 | #t) | |
127 | ((#:phases phases) | |
128 | `(modify-phases ,phases | |
129 | (replace 'install | |
130 | (lambda* (#:key outputs #:allow-other-keys) | |
131 | (let ((out (assoc-ref outputs "out"))) | |
132 | (copy-recursively "../build" out) | |
133 | #t))))))) | |
134 | (native-inputs '()))) | |
135 | ||
1d4234d4 RW |
136 | (define-public java-icu4j |
137 | (package | |
138 | (name "java-icu4j") | |
ee1dc9b3 | 139 | (version "66.1") |
1d4234d4 RW |
140 | (source (origin |
141 | (method url-fetch) | |
ee1dc9b3 BH |
142 | (uri (string-append |
143 | "https://github.com/unicode-org/icu/releases/download/release-" | |
144 | (string-map (lambda (x) (if (char=? x #\.) #\- x)) version) | |
145 | "/icu4j-" | |
146 | (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version) | |
147 | ".tgz")) | |
1d4234d4 | 148 | (sha256 |
ee1dc9b3 | 149 | (base32 "1ahdyz9209lwl7knb2l3gmnkkby221p0vpgx70fj4j02rdzgvw0d")))) |
1d4234d4 RW |
150 | (build-system ant-build-system) |
151 | (arguments | |
ee1dc9b3 BH |
152 | `(#:make-flags |
153 | (list (string-append "-Djunit.core.jar=" | |
154 | (car (find-files | |
155 | (assoc-ref %build-inputs "java-junit") | |
156 | ".*.jar$"))) | |
157 | (string-append "-Djunit.junitparams.jar=" | |
158 | (car (find-files | |
159 | (assoc-ref %build-inputs "java-junitparams") | |
160 | ".*.jar$"))) | |
161 | (string-append "-Djunit.hamcrest.jar=" | |
162 | (car (find-files | |
163 | (assoc-ref %build-inputs "java-hamcrest-core") | |
164 | ".*.jar$")))) | |
165 | #:phases | |
166 | (modify-phases %standard-phases | |
167 | (add-before 'configure 'chdir | |
168 | (lambda _ | |
169 | (chdir "..") | |
170 | #t)) | |
171 | (add-before 'build 'remove-ivy | |
172 | (lambda _ | |
173 | ;; This target wants to download ivy and use it to download | |
174 | ;; junit. | |
175 | (substitute* "build.xml" | |
176 | (("depends=\"test-init-junit-dependency\"") "")) | |
177 | #t)) | |
178 | (replace 'install | |
179 | (lambda* (#:key outputs #:allow-other-keys) | |
180 | (let ((share (string-append (assoc-ref outputs "out") | |
181 | "/share/java/"))) | |
182 | (mkdir-p share) | |
183 | (install-file "icu4j.jar" share) | |
184 | #t)))))) | |
185 | (native-inputs | |
186 | `(("java-junit" ,java-junit) | |
187 | ("java-junitparams" ,java-junitparams) | |
188 | ("java-hamcrest-core" ,java-hamcrest-core))) | |
1d4234d4 RW |
189 | (home-page "http://site.icu-project.org/") |
190 | (synopsis "International Components for Unicode") | |
191 | (description | |
192 | "ICU is a set of C/C++ and Java libraries providing Unicode and | |
193 | globalisation support for software applications. This package contains the | |
194 | Java part.") | |
195 | (license x11))) |