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 Marius Bakke <mbakke@fastmail.com>
9 ;;; This file is part of GNU Guix.
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24 (define-module (gnu packages icu4c)
25 #:use-module (gnu packages)
26 #:use-module (gnu packages perl)
27 #:use-module (gnu packages python)
28 #:use-module (guix licenses)
29 #:use-module (guix packages)
30 #:use-module (guix download)
31 #:use-module (guix build-system ant)
32 #:use-module (guix build-system gnu))
34 ;; These patches are taken from ICUs 'maint-64' branch and will be included in
35 ;; 64.3. The latter patch is needed because many packages use "invalid"
36 ;; locales which misbehave with ICU 64.2. See discussion at
37 ;; <https://lists.gnu.org/archive/html/guix-devel/2019-07/msg00343.html>.
38 (define %icu4c-patches
41 (uri (string-append "https://github.com/unicode-org/icu/commit/"
42 "7788f04eb9be0d7ecade6af46cf7b9825447763d.patch"))
43 (file-name "icu4c-datetime-regression.patch")
46 "0gs2sbdfpzwwdjqcqr0c16fw3g7wy3gb1gbgvzs9k1ciw0bhpv4w")))
49 (uri (string-append "https://github.com/unicode-org/icu/commit/"
50 "cfb20862909ff105d4f2c43923c97561bc5a5815.patch"))
51 (file-name "icu4c-locale-mapping.patch")
54 "0s5psb60aisj6icziblvlp9dqcz56n3887i8ib0yidbjnnrw5b97")))))
59 (replacement icu4c/fixed)
64 "http://download.icu-project.org/files/icu4c/"
67 (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version)
69 (patches %icu4c-patches)
70 (patch-flags '("-p2"))
72 (base32 "0v0xsf14xwlj125y9fd8lrhsaych4d8liv8gr746zng6g225szb2"))))
73 (build-system gnu-build-system)
75 `(("python" ,python-minimal)))
82 (modify-phases %standard-phases
83 (add-after 'unpack 'chdir-to-source
84 (lambda _ (chdir "source") #t))
85 (add-after 'chdir-to-source 'update-LDFLAGS
87 ;; Do not create a "data-only" libicudata.so because it causes
88 ;; problems on some architectures (notably armhf and MIPS).
89 (substitute* "config/mh-linux"
90 (("LDFLAGSICUDT=-nodefaultlibs -nostdlib")
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")
99 (("INSTALL_CMD=.*/bin/install") "INSTALL_CMD=install"))
101 (synopsis "International Components for Unicode")
103 "ICU is a set of C/C++ and Java libraries providing Unicode and
104 globalisation support for software applications. This package contains the
107 (home-page "http://site.icu-project.org/")))
113 (inherit (package-source icu4c))
114 (patch-flags '("-p2"))
116 (origin-patches (package-source icu4c))
118 "icu4c-CVE-2020-10531.patch")))))))
120 (define-public java-icu4j
126 (uri (string-append "http://download.icu-project.org/files/icu4j/"
128 (string-map (lambda (x)
129 (if (char=? x #\.) #\_ x))
134 "0bgxsvgi0qcwj60pvcxrf7a3fbk7aksyxnfwpbzavyfrfzixqh0c"))))
135 (build-system ant-build-system)
137 `(#:tests? #f ; no tests included
138 #:jar-name "icu4j.jar"))
139 (home-page "http://site.icu-project.org/")
140 (synopsis "International Components for Unicode")
142 "ICU is a set of C/C++ and Java libraries providing Unicode and
143 globalisation support for software applications. This package contains the