gnu: LibUV: Update to 1.35.0.
[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>
63eb30c1 8;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
4c9e7975
AE
9;;;
10;;; This file is part of GNU Guix.
11;;;
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.
16;;;
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.
21;;;
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/>.
24
1ffa7090 25(define-module (gnu packages icu4c)
59a43334 26 #:use-module (gnu packages)
1ffa7090 27 #:use-module (gnu packages perl)
27ed6960 28 #:use-module (gnu packages python)
4c9e7975
AE
29 #:use-module (guix licenses)
30 #:use-module (guix packages)
63eb30c1 31 #:use-module (guix utils)
4c9e7975 32 #:use-module (guix download)
1d4234d4 33 #:use-module (guix build-system ant)
4c9e7975
AE
34 #:use-module (guix build-system gnu))
35
36(define-public icu4c
37 (package
38 (name "icu4c")
e8acfd1a 39 (version "65.1")
4c9e7975
AE
40 (source (origin
41 (method url-fetch)
d5df6fc7 42 (uri (string-append
e8acfd1a
MB
43 "https://github.com/unicode-org/icu/releases/download/release-"
44 (string-map (lambda (x) (if (char=? x #\.) #\- x)) version)
d5df6fc7
AW
45 "/icu4c-"
46 (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version)
47 "-src.tgz"))
1319cfe9 48 (sha256
e8acfd1a 49 (base32 "0j6r6qqnhfr5iqkx53k63ifkm93kv1kkb7h2mlgd1mnnndk79qsk"))))
4c9e7975 50 (build-system gnu-build-system)
63eb30c1
MO
51 ;; When cross-compiling, this package needs a source directory of a
52 ;; native-build of itself.
27ed6960 53 (native-inputs
63eb30c1
MO
54 `(("python" ,python-minimal)
55 ,@(if (%current-target-system)
56 `(("icu4c-build-root" ,icu4c-build-root))
57 '())))
a2270ce2 58 (inputs
0d93648b 59 `(("perl" ,perl)))
4c9e7975 60 (arguments
0d93648b 61 `(#:configure-flags
63eb30c1
MO
62 (list
63 "--enable-rpath"
64 ,@(if (%current-target-system)
65 '((string-append "--with-cross-build="
66 (assoc-ref %build-inputs "icu4c-build-root")))
67 '()))
a2270ce2 68 #:phases
c296d5d1
EF
69 (modify-phases %standard-phases
70 (add-after 'unpack 'chdir-to-source
fbd2b8da 71 (lambda _ (chdir "source") #t))
f73fe13c
MB
72 (add-after 'chdir-to-source 'update-LDFLAGS
73 (lambda _
74 ;; Do not create a "data-only" libicudata.so because it causes
75 ;; problems on some architectures (notably armhf and MIPS).
76 (substitute* "config/mh-linux"
77 (("LDFLAGSICUDT=-nodefaultlibs -nostdlib")
78 "LDFLAGSICUDT="))
79 #t))
fbd2b8da
MB
80 (add-after 'install 'avoid-coreutils-reference
81 ;; Don't keep a reference to the build tools.
82 (lambda* (#:key outputs #:allow-other-keys)
83 (let ((out (assoc-ref outputs "out")))
84 (substitute* (find-files (string-append out "/lib/icu")
85 "\\.inc$")
86 (("INSTALL_CMD=.*/bin/install") "INSTALL_CMD=install"))
87 #t))))))
35b9e423 88 (synopsis "International Components for Unicode")
4c9e7975
AE
89 (description
90 "ICU is a set of C/C++ and Java libraries providing Unicode and
35b9e423 91globalisation support for software applications. This package contains the
4c9e7975
AE
92C/C++ part.")
93 (license x11)
94 (home-page "http://site.icu-project.org/")))
a408e757 95
63eb30c1
MO
96(define-public icu4c-build-root
97 (package
98 (inherit icu4c)
99 (name "icu4c-build-root")
100 (arguments
101 (substitute-keyword-arguments (package-arguments icu4c)
102 ((#:tests? _ '())
103 #f)
104 ((#:out-of-source? _ '())
105 #t)
106 ((#:phases phases)
107 `(modify-phases ,phases
108 (replace 'install
109 (lambda* (#:key outputs #:allow-other-keys)
110 (let ((out (assoc-ref outputs "out")))
111 (copy-recursively "../build" out)
112 #t)))))))
113 (native-inputs '())))
114
1d4234d4
RW
115(define-public java-icu4j
116 (package
117 (name "java-icu4j")
118 (version "59.1")
119 (source (origin
120 (method url-fetch)
121 (uri (string-append "http://download.icu-project.org/files/icu4j/"
122 version "/icu4j-"
123 (string-map (lambda (x)
124 (if (char=? x #\.) #\_ x))
125 version)
126 "-src.jar"))
127 (sha256
128 (base32
129 "0bgxsvgi0qcwj60pvcxrf7a3fbk7aksyxnfwpbzavyfrfzixqh0c"))))
130 (build-system ant-build-system)
131 (arguments
132 `(#:tests? #f ; no tests included
133 #:jar-name "icu4j.jar"))
134 (home-page "http://site.icu-project.org/")
135 (synopsis "International Components for Unicode")
136 (description
137 "ICU is a set of C/C++ and Java libraries providing Unicode and
138globalisation support for software applications. This package contains the
139Java part.")
140 (license x11)))