installer: Open manual in the selected language on tty2.
[jackhill/guix/guix.git] / gnu / packages / icu4c.scm
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>
8 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
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.
15 ;;;
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.
20 ;;;
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/>.
23
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))
33
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
39 (list (origin
40 (method url-fetch)
41 (uri (string-append "https://github.com/unicode-org/icu/commit/"
42 "7788f04eb9be0d7ecade6af46cf7b9825447763d.patch"))
43 (file-name "icu4c-datetime-regression.patch")
44 (sha256
45 (base32
46 "0gs2sbdfpzwwdjqcqr0c16fw3g7wy3gb1gbgvzs9k1ciw0bhpv4w")))
47 (origin
48 (method url-fetch)
49 (uri (string-append "https://github.com/unicode-org/icu/commit/"
50 "cfb20862909ff105d4f2c43923c97561bc5a5815.patch"))
51 (file-name "icu4c-locale-mapping.patch")
52 (sha256
53 (base32
54 "0s5psb60aisj6icziblvlp9dqcz56n3887i8ib0yidbjnnrw5b97")))))
55
56 (define-public icu4c
57 (package
58 (name "icu4c")
59 (replacement icu4c/fixed)
60 (version "64.2")
61 (source (origin
62 (method url-fetch)
63 (uri (string-append
64 "http://download.icu-project.org/files/icu4c/"
65 version
66 "/icu4c-"
67 (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version)
68 "-src.tgz"))
69 (patches %icu4c-patches)
70 (patch-flags '("-p2"))
71 (sha256
72 (base32 "0v0xsf14xwlj125y9fd8lrhsaych4d8liv8gr746zng6g225szb2"))))
73 (build-system gnu-build-system)
74 (native-inputs
75 `(("python" ,python-minimal)))
76 (inputs
77 `(("perl" ,perl)))
78 (arguments
79 `(#:configure-flags
80 '("--enable-rpath")
81 #:phases
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
86 (lambda _
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")
91 "LDFLAGSICUDT="))
92 #t))
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")
98 "\\.inc$")
99 (("INSTALL_CMD=.*/bin/install") "INSTALL_CMD=install"))
100 #t))))))
101 (synopsis "International Components for Unicode")
102 (description
103 "ICU is a set of C/C++ and Java libraries providing Unicode and
104 globalisation support for software applications. This package contains the
105 C/C++ part.")
106 (license x11)
107 (home-page "http://site.icu-project.org/")))
108
109 (define icu4c/fixed
110 (package
111 (inherit icu4c)
112 (source (origin
113 (inherit (package-source icu4c))
114 (patch-flags '("-p2"))
115 (patches (append
116 (origin-patches (package-source icu4c))
117 (search-patches
118 "icu4c-CVE-2020-10531.patch")))))))
119
120 (define-public java-icu4j
121 (package
122 (name "java-icu4j")
123 (version "59.1")
124 (source (origin
125 (method url-fetch)
126 (uri (string-append "http://download.icu-project.org/files/icu4j/"
127 version "/icu4j-"
128 (string-map (lambda (x)
129 (if (char=? x #\.) #\_ x))
130 version)
131 "-src.jar"))
132 (sha256
133 (base32
134 "0bgxsvgi0qcwj60pvcxrf7a3fbk7aksyxnfwpbzavyfrfzixqh0c"))))
135 (build-system ant-build-system)
136 (arguments
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")
141 (description
142 "ICU is a set of C/C++ and Java libraries providing Unicode and
143 globalisation support for software applications. This package contains the
144 Java part.")
145 (license x11)))