gnu: Some cleanup based on lint checkers.
[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 ;;;
4 ;;; This file is part of GNU Guix.
5 ;;;
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
10 ;;;
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19 (define-module (gnu packages icu4c)
20 #:use-module (gnu packages)
21 #:use-module (gnu packages elf)
22 #:use-module (gnu packages perl)
23 #:use-module (guix licenses)
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix build-system gnu))
27
28 (define-public icu4c
29 (package
30 (name "icu4c")
31 (version "53.1")
32 (source (origin
33 (method url-fetch)
34 (uri (string-append "http://download.icu-project.org/files/icu4c/"
35 version
36 "/icu4c-"
37 (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version)
38 "-src.tgz"))
39 (sha256
40 (base32 "0a4sg9w054640zncb13lhrcjqn7yg1qilwd1mczc4w60maslz9vg"))
41 (patches (list (search-patch "icu4c-test-date-format.patch")))))
42 (build-system gnu-build-system)
43 (inputs
44 `(("patchelf" ,patchelf)
45 ("perl" ,perl)))
46 (arguments
47 `(#:modules ((guix build gnu-build-system)
48 (guix build utils)
49 (guix build rpath)
50 (srfi srfi-26))
51 #:imported-modules ((guix build gnu-build-system)
52 (guix build utils)
53 (guix build rpath))
54 #:phases
55 (alist-cons-after
56 'unpack 'chdir-to-source
57 (lambda _ (chdir "source"))
58 (alist-cons-before
59 'configure 'patch-configure
60 (lambda _
61 ;; patch out two occurrences of /bin/sh from configure script
62 ;; that might have disappeared in a release later than 52.1
63 (substitute* "configure"
64 (("`/bin/sh")
65 (string-append "`" (which "bash")))))
66 (alist-cons-after
67 'strip 'add-lib-to-runpath
68 (lambda* (#:key outputs #:allow-other-keys)
69 (let* ((out (assoc-ref outputs "out"))
70 (lib (string-append out "/lib")))
71 ;; Add LIB to the RUNPATH of all the libraries and binaries.
72 (with-directory-excursion out
73 (for-each (cut augment-rpath <> lib)
74 (append (find-files "lib" ".*")
75 (find-files "bin" ".*")
76 (find-files "sbin" ".*"))))))
77 %standard-phases)))))
78 (synopsis "International Components for Unicode")
79 (description
80 "ICU is a set of C/C++ and Java libraries providing Unicode and
81 globalisation support for software applications. This package contains the
82 C/C++ part.")
83 (license x11)
84 (home-page "http://site.icu-project.org/")))