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>
10 ;;; This file is part of GNU Guix.
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25 (define-module (gnu packages icu4c)
26 #:use-module (gnu packages)
27 #:use-module (gnu packages perl)
28 #:use-module (gnu packages python)
29 #:use-module (guix licenses)
30 #:use-module (guix packages)
31 #:use-module (guix utils)
32 #:use-module (guix download)
33 #:use-module (guix build-system ant)
34 #:use-module (guix build-system gnu))
43 "https://github.com/unicode-org/icu/releases/download/release-"
44 (string-map (lambda (x) (if (char=? x #\.) #\- x)) version)
46 (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version)
48 (patch-flags '("-p2"))
49 (patches (search-patches "icu4c-CVE-2020-10531.patch"))
51 (base32 "0bharwzc9nzkbrcf405z2nb3h7q0711z450arz0mjmdrk8hg58sj"))))
52 (build-system gnu-build-system)
53 ;; When cross-compiling, this package needs a source directory of a
54 ;; native-build of itself.
56 `(("python" ,python-minimal)
57 ,@(if (%current-target-system)
58 `(("icu4c-build-root" ,icu4c-build-root))
66 ,@(if (%current-target-system)
67 '((string-append "--with-cross-build="
68 (assoc-ref %build-inputs "icu4c-build-root")))
71 (modify-phases %standard-phases
72 (add-after 'unpack 'chdir-to-source
73 (lambda _ (chdir "source") #t))
74 (add-after 'chdir-to-source 'update-LDFLAGS
76 ;; Do not create a "data-only" libicudata.so because it causes
77 ;; problems on some architectures (notably armhf and MIPS).
78 (substitute* "config/mh-linux"
79 (("LDFLAGSICUDT=-nodefaultlibs -nostdlib")
82 (add-after 'install 'avoid-coreutils-reference
83 ;; Don't keep a reference to the build tools.
84 (lambda* (#:key outputs #:allow-other-keys)
85 (let ((out (assoc-ref outputs "out")))
86 (substitute* (find-files (string-append out "/lib/icu")
88 (("INSTALL_CMD=.*/bin/install") "INSTALL_CMD=install"))
90 (synopsis "International Components for Unicode")
92 "ICU is a set of C/C++ and Java libraries providing Unicode and
93 globalisation support for software applications. This package contains the
96 (home-page "http://site.icu-project.org/")))
98 (define-public icu4c-build-root
101 (name "icu4c-build-root")
103 (substitute-keyword-arguments (package-arguments icu4c)
106 ((#:out-of-source? _ '())
109 `(modify-phases ,phases
111 (lambda* (#:key outputs #:allow-other-keys)
112 (let ((out (assoc-ref outputs "out")))
113 (copy-recursively "../build" out)
115 (native-inputs '())))
117 (define-public java-icu4j
123 (uri (string-append "http://download.icu-project.org/files/icu4j/"
125 (string-map (lambda (x)
126 (if (char=? x #\.) #\_ x))
131 "0bgxsvgi0qcwj60pvcxrf7a3fbk7aksyxnfwpbzavyfrfzixqh0c"))))
132 (build-system ant-build-system)
134 `(#:tests? #f ; no tests included
135 #:jar-name "icu4j.jar"))
136 (home-page "http://site.icu-project.org/")
137 (synopsis "International Components for Unicode")
139 "ICU is a set of C/C++ and Java libraries providing Unicode and
140 globalisation support for software applications. This package contains the