Commit | Line | Data |
---|---|---|
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 | ||
7999d317 MB |
36 | ;; These patches are taken from ICUs 'maint-64' branch and will be included in |
37 | ;; 64.3. The latter patch is needed because many packages use "invalid" | |
38 | ;; locales which misbehave with ICU 64.2. See discussion at | |
39 | ;; <https://lists.gnu.org/archive/html/guix-devel/2019-07/msg00343.html>. | |
40 | (define %icu4c-patches | |
41 | (list (origin | |
42 | (method url-fetch) | |
43 | (uri (string-append "https://github.com/unicode-org/icu/commit/" | |
44 | "7788f04eb9be0d7ecade6af46cf7b9825447763d.patch")) | |
45 | (file-name "icu4c-datetime-regression.patch") | |
46 | (sha256 | |
47 | (base32 | |
48 | "0gs2sbdfpzwwdjqcqr0c16fw3g7wy3gb1gbgvzs9k1ciw0bhpv4w"))) | |
49 | (origin | |
50 | (method url-fetch) | |
51 | (uri (string-append "https://github.com/unicode-org/icu/commit/" | |
52 | "cfb20862909ff105d4f2c43923c97561bc5a5815.patch")) | |
53 | (file-name "icu4c-locale-mapping.patch") | |
54 | (sha256 | |
55 | (base32 | |
56 | "0s5psb60aisj6icziblvlp9dqcz56n3887i8ib0yidbjnnrw5b97"))))) | |
57 | ||
4c9e7975 AE |
58 | (define-public icu4c |
59 | (package | |
60 | (name "icu4c") | |
27ed6960 | 61 | (version "64.2") |
4c9e7975 AE |
62 | (source (origin |
63 | (method url-fetch) | |
d5df6fc7 | 64 | (uri (string-append |
5499de02 | 65 | "http://download.icu-project.org/files/icu4c/" |
d5df6fc7 AW |
66 | version |
67 | "/icu4c-" | |
68 | (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version) | |
69 | "-src.tgz")) | |
7999d317 MB |
70 | (patches %icu4c-patches) |
71 | (patch-flags '("-p2")) | |
1319cfe9 | 72 | (sha256 |
27ed6960 | 73 | (base32 "0v0xsf14xwlj125y9fd8lrhsaych4d8liv8gr746zng6g225szb2")))) |
4c9e7975 | 74 | (build-system gnu-build-system) |
63eb30c1 MO |
75 | ;; When cross-compiling, this package needs a source directory of a |
76 | ;; native-build of itself. | |
27ed6960 | 77 | (native-inputs |
63eb30c1 MO |
78 | `(("python" ,python-minimal) |
79 | ,@(if (%current-target-system) | |
80 | `(("icu4c-build-root" ,icu4c-build-root)) | |
81 | '()))) | |
a2270ce2 | 82 | (inputs |
0d93648b | 83 | `(("perl" ,perl))) |
4c9e7975 | 84 | (arguments |
0d93648b | 85 | `(#:configure-flags |
63eb30c1 MO |
86 | (list |
87 | "--enable-rpath" | |
88 | ,@(if (%current-target-system) | |
89 | '((string-append "--with-cross-build=" | |
90 | (assoc-ref %build-inputs "icu4c-build-root"))) | |
91 | '())) | |
a2270ce2 | 92 | #:phases |
c296d5d1 EF |
93 | (modify-phases %standard-phases |
94 | (add-after 'unpack 'chdir-to-source | |
fbd2b8da | 95 | (lambda _ (chdir "source") #t)) |
f73fe13c MB |
96 | (add-after 'chdir-to-source 'update-LDFLAGS |
97 | (lambda _ | |
98 | ;; Do not create a "data-only" libicudata.so because it causes | |
99 | ;; problems on some architectures (notably armhf and MIPS). | |
100 | (substitute* "config/mh-linux" | |
101 | (("LDFLAGSICUDT=-nodefaultlibs -nostdlib") | |
102 | "LDFLAGSICUDT=")) | |
103 | #t)) | |
fbd2b8da MB |
104 | (add-after 'install 'avoid-coreutils-reference |
105 | ;; Don't keep a reference to the build tools. | |
106 | (lambda* (#:key outputs #:allow-other-keys) | |
107 | (let ((out (assoc-ref outputs "out"))) | |
108 | (substitute* (find-files (string-append out "/lib/icu") | |
109 | "\\.inc$") | |
110 | (("INSTALL_CMD=.*/bin/install") "INSTALL_CMD=install")) | |
111 | #t)))))) | |
35b9e423 | 112 | (synopsis "International Components for Unicode") |
4c9e7975 AE |
113 | (description |
114 | "ICU is a set of C/C++ and Java libraries providing Unicode and | |
35b9e423 | 115 | globalisation support for software applications. This package contains the |
4c9e7975 AE |
116 | C/C++ part.") |
117 | (license x11) | |
118 | (home-page "http://site.icu-project.org/"))) | |
a408e757 | 119 | |
63eb30c1 MO |
120 | (define-public icu4c-build-root |
121 | (package | |
122 | (inherit icu4c) | |
123 | (name "icu4c-build-root") | |
124 | (arguments | |
125 | (substitute-keyword-arguments (package-arguments icu4c) | |
126 | ((#:tests? _ '()) | |
127 | #f) | |
128 | ((#:out-of-source? _ '()) | |
129 | #t) | |
130 | ((#:phases phases) | |
131 | `(modify-phases ,phases | |
132 | (replace 'install | |
133 | (lambda* (#:key outputs #:allow-other-keys) | |
134 | (let ((out (assoc-ref outputs "out"))) | |
135 | (copy-recursively "../build" out) | |
136 | #t))))))) | |
137 | (native-inputs '()))) | |
138 | ||
1d4234d4 RW |
139 | (define-public java-icu4j |
140 | (package | |
141 | (name "java-icu4j") | |
142 | (version "59.1") | |
143 | (source (origin | |
144 | (method url-fetch) | |
145 | (uri (string-append "http://download.icu-project.org/files/icu4j/" | |
146 | version "/icu4j-" | |
147 | (string-map (lambda (x) | |
148 | (if (char=? x #\.) #\_ x)) | |
149 | version) | |
150 | "-src.jar")) | |
151 | (sha256 | |
152 | (base32 | |
153 | "0bgxsvgi0qcwj60pvcxrf7a3fbk7aksyxnfwpbzavyfrfzixqh0c")))) | |
154 | (build-system ant-build-system) | |
155 | (arguments | |
156 | `(#:tests? #f ; no tests included | |
157 | #:jar-name "icu4j.jar")) | |
158 | (home-page "http://site.icu-project.org/") | |
159 | (synopsis "International Components for Unicode") | |
160 | (description | |
161 | "ICU is a set of C/C++ and Java libraries providing Unicode and | |
162 | globalisation support for software applications. This package contains the | |
163 | Java part.") | |
164 | (license x11))) |