1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2015, 2016 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
6 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
7 ;;; Copyright © 2019, 2020 Marius Bakke <mbakke@fastmail.com>
8 ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
9 ;;; Copyright © 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
10 ;;; Copyright © 2020 Julien Lepiller <julien@lepiller.eu>
12 ;;; This file is part of GNU Guix.
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.
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.
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/>.
27 (define-module (gnu packages icu4c)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages java)
30 #:use-module (gnu packages perl)
31 #:use-module (gnu packages python)
32 #:use-module (guix licenses)
33 #:use-module (guix packages)
34 #:use-module (guix utils)
35 #:use-module (guix download)
36 #:use-module (guix build-system ant)
37 #:use-module (guix build-system gnu))
46 "https://github.com/unicode-org/icu/releases/download/release-"
47 (string-map (lambda (x) (if (char=? x #\.) #\- x)) version)
49 (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version)
51 (patch-flags '("-p2"))
52 (patches (search-patches "icu4c-CVE-2020-10531.patch"))
54 (base32 "0bharwzc9nzkbrcf405z2nb3h7q0711z450arz0mjmdrk8hg58sj"))))
55 (build-system gnu-build-system)
56 ;; When cross-compiling, this package needs a source directory of a
57 ;; native-build of itself.
59 `(("python" ,python-minimal)
60 ,@(if (%current-target-system)
61 `(("icu4c-build-root" ,icu4c-build-root))
69 ,@(if (%current-target-system)
70 '((string-append "--with-cross-build="
71 (assoc-ref %build-inputs "icu4c-build-root")))
74 (modify-phases %standard-phases
75 (add-after 'unpack 'chdir-to-source
76 (lambda _ (chdir "source") #t))
77 (add-after 'chdir-to-source 'update-LDFLAGS
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")
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")
91 (("INSTALL_CMD=.*/bin/install") "INSTALL_CMD=install"))
93 (synopsis "International Components for Unicode")
95 "ICU is a set of C/C++ and Java libraries providing Unicode and
96 globalisation support for software applications. This package contains the
99 (home-page "http://site.icu-project.org/")))
101 (define-public icu4c-67
108 "https://github.com/unicode-org/icu/releases/download/release-"
109 (string-map (lambda (x) (if (char=? x #\.) #\- x)) version)
111 (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version)
115 "1p6mhvxl0xr2n0g6xdps3mwzwlv6mjsz3xlpm793p9aiybb0ra4l"))))))
117 (define-public icu4c-68
124 "https://github.com/unicode-org/icu/releases/download/release-"
125 (string-map (lambda (x) (if (char=? x #\.) #\- x)) version)
127 (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version)
131 "09fng7a80xj8d5r1cgbgq8r47dsw5jsr6si9p2cj2ylhwgg974f7"))))))
133 (define-public icu4c-build-root
136 (name "icu4c-build-root")
138 (substitute-keyword-arguments (package-arguments icu4c)
141 ((#:out-of-source? _ '())
144 `(modify-phases ,phases
146 (lambda* (#:key outputs #:allow-other-keys)
147 (let ((out (assoc-ref outputs "out")))
148 (copy-recursively "../build" out)
150 (native-inputs '())))
152 (define-public java-icu4j
159 "https://github.com/unicode-org/icu/releases/download/release-"
160 (string-map (lambda (x) (if (char=? x #\.) #\- x)) version)
162 (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version)
165 (base32 "1ahdyz9209lwl7knb2l3gmnkkby221p0vpgx70fj4j02rdzgvw0d"))))
166 (build-system ant-build-system)
169 (list (string-append "-Djunit.core.jar="
171 (assoc-ref %build-inputs "java-junit")
173 (string-append "-Djunit.junitparams.jar="
175 (assoc-ref %build-inputs "java-junitparams")
177 (string-append "-Djunit.hamcrest.jar="
179 (assoc-ref %build-inputs "java-hamcrest-core")
182 (modify-phases %standard-phases
183 (add-before 'configure 'chdir
187 (add-before 'build 'remove-ivy
189 ;; This target wants to download ivy and use it to download
191 (substitute* "build.xml"
192 (("depends=\"test-init-junit-dependency\"") ""))
195 (lambda* (#:key outputs #:allow-other-keys)
196 (let ((share (string-append (assoc-ref outputs "out")
199 (install-file "icu4j.jar" share)
202 `(("java-junit" ,java-junit)
203 ("java-junitparams" ,java-junitparams)
204 ("java-hamcrest-core" ,java-hamcrest-core)))
205 (home-page "http://site.icu-project.org/")
206 (synopsis "International Components for Unicode")
208 "ICU is a set of C/C++ and Java libraries providing Unicode and
209 globalisation support for software applications. This package contains the