gnu: icu4c: Fix CVE-2017-{7867,7868}.
[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 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
6 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
13 ;;;
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
18 ;;;
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22 (define-module (gnu packages icu4c)
23 #:use-module (gnu packages)
24 #:use-module (gnu packages perl)
25 #:use-module (guix licenses)
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module (guix build-system gnu))
29
30 (define-public icu4c
31 (package
32 (name "icu4c")
33 (version "58.2")
34 (replacement icu4c/fixed)
35 (source (origin
36 (method url-fetch)
37 (uri (string-append
38 "http://download.icu-project.org/files/icu4c/"
39 version
40 "/icu4c-"
41 (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version)
42 "-src.tgz"))
43 (sha256
44 (base32 "036shcb3f8bm1lynhlsb4kpjm9s9c2vdiir01vg216rs2l8482ib"))))
45 (build-system gnu-build-system)
46 (inputs
47 `(("perl" ,perl)))
48 (arguments
49 `(#:configure-flags
50 '("--enable-rpath"
51 ,@(if (let ((s (or (%current-target-system)
52 (%current-system))))
53 (or (string-prefix? "arm" s)
54 (string-prefix? "mips" s)))
55 '("--with-data-packaging=archive")
56 '()))
57 #:phases
58 (modify-phases %standard-phases
59 (add-after 'unpack 'chdir-to-source
60 (lambda _ (chdir "source") #t)))))
61 (synopsis "International Components for Unicode")
62 (description
63 "ICU is a set of C/C++ and Java libraries providing Unicode and
64 globalisation support for software applications. This package contains the
65 C/C++ part.")
66 (license x11)
67 (home-page "http://site.icu-project.org/")))
68
69 (define icu4c/fixed
70 (package
71 (inherit icu4c)
72 (replacement #f)
73 (source (origin
74 (inherit (package-source icu4c))
75 (patches
76 (search-patches "icu4c-CVE-2017-7867-CVE-2017-7868.patch"
77 "icu4c-reset-keyword-list-iterator.patch"))))))