gnu: python-pandas: Fix build on 32-bit.
[jackhill/guix/guix.git] / gnu / packages / pcre.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
6 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
7 ;;;
8 ;;; This file is part of GNU Guix.
9 ;;;
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
14 ;;;
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
19 ;;;
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23 (define-module (gnu packages pcre)
24 #:use-module ((guix licenses) #:prefix license:)
25 #:use-module (gnu packages compression)
26 #:use-module (gnu packages readline)
27 #:use-module (gnu packages)
28 #:use-module (guix packages)
29 #:use-module (guix download)
30 #:use-module (guix build-system gnu))
31
32 (define-public pcre
33 (package
34 (name "pcre")
35 (version "8.38")
36 (source (origin
37 (method url-fetch)
38 (uri (list
39 (string-append "ftp://ftp.csx.cam.ac.uk"
40 "/pub/software/programming/pcre/"
41 "pcre-" version ".tar.bz2")
42 (string-append "mirror://sourceforge/pcre/pcre/"
43 version "/pcre-" version ".tar.bz2")))
44 (sha256
45 (base32
46 "1pvra19ljkr5ky35y2iywjnsckrs9ch2anrf5b0dc91hw8v2vq5r"))
47 (patches (list (search-patch "pcre-CVE-2016-3191.patch")))))
48 (build-system gnu-build-system)
49 (outputs '("out" ;library & headers
50 "bin" ;depends on Readline (adds 20MiB to the closure)
51 "doc")) ;1.8 MiB of HTML
52 (inputs `(("bzip2" ,bzip2)
53 ("readline" ,readline)
54 ("zlib" ,zlib)))
55 (arguments
56 '(#:disallowed-references ("doc")
57 #:configure-flags '("--enable-utf"
58 "--enable-pcregrep-libz"
59 "--enable-pcregrep-libbz2"
60 "--enable-pcretest-libreadline"
61 "--enable-unicode-properties"
62 "--enable-pcre16"
63 "--enable-pcre32"
64 "--enable-jit")))
65 (synopsis "Perl Compatible Regular Expressions")
66 (description
67 "The PCRE library is a set of functions that implement regular expression
68 pattern matching using the same syntax and semantics as Perl 5. PCRE has its
69 own native API, as well as a set of wrapper functions that correspond to the
70 POSIX regular expression API.")
71 (license license:bsd-3)
72 (home-page "http://www.pcre.org/")))
73
74 (define-public pcre2
75 (package
76 (name "pcre2")
77 (version "10.23")
78 (source (origin
79 (method url-fetch)
80 (uri (string-append "mirror://sourceforge/pcre/pcre2/"
81 version "/pcre2-" version ".tar.bz2"))
82
83 (sha256
84 (base32
85 "0vn5g0mkkp99mmzpissa06hpyj6pk9s4mlwbjqrjvw3ihy8rpiyz"))))
86 (build-system gnu-build-system)
87 (inputs `(("bzip2" ,bzip2)
88 ("readline" ,readline)
89 ("zlib" ,zlib)))
90 (arguments
91 `(#:configure-flags '("--enable-unicode"
92 "--enable-pcregrep-libz"
93 "--enable-pcregrep-libbz2"
94 "--enable-pcretest-libreadline"
95 "--enable-unicode-properties"
96 "--enable-pcre2-16"
97 "--enable-pcre2-32"
98 "--enable-jit")
99 #:phases
100 (modify-phases %standard-phases
101 (add-after 'unpack 'patch-paths
102 (lambda _
103 (substitute* "RunGrepTest"
104 (("/bin/echo") (which "echo")))
105 #t)))))
106 (synopsis "Perl Compatible Regular Expressions")
107 (description
108 "The PCRE library is a set of functions that implement regular expression
109 pattern matching using the same syntax and semantics as Perl 5. PCRE has its
110 own native API, as well as a set of wrapper functions that correspond to the
111 POSIX regular expression API.")
112 (license license:bsd-3)
113 (home-page "http://www.pcre.org/")))