gnu: cyrus-sasl: Fix cross-compilation.
[jackhill/guix/guix.git] / gnu / packages / icu4c.scm
CommitLineData
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>
ff68ddb0 7;;; Copyright © 2019 Marius Bakke <mbakke@fastmail.com>
4c9e7975
AE
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
1ffa7090 24(define-module (gnu packages icu4c)
59a43334 25 #:use-module (gnu packages)
1ffa7090 26 #:use-module (gnu packages perl)
27ed6960 27 #:use-module (gnu packages python)
4c9e7975
AE
28 #:use-module (guix licenses)
29 #:use-module (guix packages)
30 #:use-module (guix download)
1d4234d4 31 #:use-module (guix build-system ant)
4c9e7975
AE
32 #:use-module (guix build-system gnu))
33
7999d317
MB
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
4c9e7975
AE
56(define-public icu4c
57 (package
58 (name "icu4c")
27ed6960 59 (version "64.2")
4c9e7975
AE
60 (source (origin
61 (method url-fetch)
d5df6fc7 62 (uri (string-append
5499de02 63 "http://download.icu-project.org/files/icu4c/"
d5df6fc7
AW
64 version
65 "/icu4c-"
66 (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version)
67 "-src.tgz"))
7999d317
MB
68 (patches %icu4c-patches)
69 (patch-flags '("-p2"))
1319cfe9 70 (sha256
27ed6960 71 (base32 "0v0xsf14xwlj125y9fd8lrhsaych4d8liv8gr746zng6g225szb2"))))
4c9e7975 72 (build-system gnu-build-system)
27ed6960 73 (native-inputs
a4c38f81 74 `(("python" ,python-minimal)))
a2270ce2 75 (inputs
0d93648b 76 `(("perl" ,perl)))
4c9e7975 77 (arguments
0d93648b 78 `(#:configure-flags
f73fe13c 79 '("--enable-rpath")
a2270ce2 80 #:phases
c296d5d1
EF
81 (modify-phases %standard-phases
82 (add-after 'unpack 'chdir-to-source
fbd2b8da 83 (lambda _ (chdir "source") #t))
f73fe13c
MB
84 (add-after 'chdir-to-source 'update-LDFLAGS
85 (lambda _
86 ;; Do not create a "data-only" libicudata.so because it causes
87 ;; problems on some architectures (notably armhf and MIPS).
88 (substitute* "config/mh-linux"
89 (("LDFLAGSICUDT=-nodefaultlibs -nostdlib")
90 "LDFLAGSICUDT="))
91 #t))
fbd2b8da
MB
92 (add-after 'install 'avoid-coreutils-reference
93 ;; Don't keep a reference to the build tools.
94 (lambda* (#:key outputs #:allow-other-keys)
95 (let ((out (assoc-ref outputs "out")))
96 (substitute* (find-files (string-append out "/lib/icu")
97 "\\.inc$")
98 (("INSTALL_CMD=.*/bin/install") "INSTALL_CMD=install"))
99 #t))))))
35b9e423 100 (synopsis "International Components for Unicode")
4c9e7975
AE
101 (description
102 "ICU is a set of C/C++ and Java libraries providing Unicode and
35b9e423 103globalisation support for software applications. This package contains the
4c9e7975
AE
104C/C++ part.")
105 (license x11)
106 (home-page "http://site.icu-project.org/")))
a408e757 107
1d4234d4
RW
108(define-public java-icu4j
109 (package
110 (name "java-icu4j")
111 (version "59.1")
112 (source (origin
113 (method url-fetch)
114 (uri (string-append "http://download.icu-project.org/files/icu4j/"
115 version "/icu4j-"
116 (string-map (lambda (x)
117 (if (char=? x #\.) #\_ x))
118 version)
119 "-src.jar"))
120 (sha256
121 (base32
122 "0bgxsvgi0qcwj60pvcxrf7a3fbk7aksyxnfwpbzavyfrfzixqh0c"))))
123 (build-system ant-build-system)
124 (arguments
125 `(#:tests? #f ; no tests included
126 #:jar-name "icu4j.jar"))
127 (home-page "http://site.icu-project.org/")
128 (synopsis "International Components for Unicode")
129 (description
130 "ICU is a set of C/C++ and Java libraries providing Unicode and
131globalisation support for software applications. This package contains the
132Java part.")
133 (license x11)))