gnu: gfortran: Add version 9.x.
[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 (version "64.2")
60 (source (origin
61 (method url-fetch)
62 (uri (string-append
63 "http://download.icu-project.org/files/icu4c/"
64 version
65 "/icu4c-"
66 (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version)
67 "-src.tgz"))
68 (patches %icu4c-patches)
69 (patch-flags '("-p2"))
70 (sha256
71 (base32 "0v0xsf14xwlj125y9fd8lrhsaych4d8liv8gr746zng6g225szb2"))))
72 (build-system gnu-build-system)
73 (native-inputs
74 `(("python" ,python-minimal)))
75 (inputs
76 `(("perl" ,perl)))
77 (arguments
78 `(#:configure-flags
79 '("--enable-rpath")
80 #:phases
81 (modify-phases %standard-phases
82 (add-after 'unpack 'chdir-to-source
83 (lambda _ (chdir "source") #t))
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))
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))))))
100 (synopsis "International Components for Unicode")
101 (description
102 "ICU is a set of C/C++ and Java libraries providing Unicode and
103 globalisation support for software applications. This package contains the
104 C/C++ part.")
105 (license x11)
106 (home-page "http://site.icu-project.org/")))
107
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
131 globalisation support for software applications. This package contains the
132 Java part.")
133 (license x11)))