gnu: mes: Update to 0.11.
[jackhill/guix/guix.git] / gnu / packages / pcre.scm
CommitLineData
10d1822b
AE
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
fd19fa55 3;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
7ea3099b 4;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
ccda7c83 5;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
9bb766e7 6;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
a97f0ee1 7;;; Copyright © 2017 Ludovic Courtès <ludo@gnu.org>
10d1822b
AE
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 pcre)
b5b73a82 25 #:use-module ((guix licenses) #:prefix license:)
10d1822b
AE
26 #:use-module (gnu packages compression)
27 #:use-module (gnu packages readline)
d46dd72c 28 #:use-module (gnu packages)
10d1822b
AE
29 #:use-module (guix packages)
30 #:use-module (guix download)
31 #:use-module (guix build-system gnu))
32
33(define-public pcre
34 (package
35 (name "pcre")
026ee1a5 36 (version "8.40")
426b0b89 37 (replacement pcre-8.41)
10d1822b
AE
38 (source (origin
39 (method url-fetch)
dae36ca5
MW
40 (uri (list
41 (string-append "ftp://ftp.csx.cam.ac.uk"
42 "/pub/software/programming/pcre/"
43 "pcre-" version ".tar.bz2")
44 (string-append "mirror://sourceforge/pcre/pcre/"
45 version "/pcre-" version ".tar.bz2")))
d1a91408 46 (patches (search-patches "pcre-CVE-2017-7186.patch"))
10d1822b
AE
47 (sha256
48 (base32
026ee1a5 49 "1x7lpjn7jhk0n3sdvggxrlrhab8kkfjwl7qix0ypw9nlx8lpmqh0"))))
10d1822b 50 (build-system gnu-build-system)
6d49ca3b
LC
51 (outputs '("out" ;library & headers
52 "bin" ;depends on Readline (adds 20MiB to the closure)
53 "doc")) ;1.8 MiB of HTML
10d1822b
AE
54 (inputs `(("bzip2" ,bzip2)
55 ("readline" ,readline)
56 ("zlib" ,zlib)))
57 (arguments
d786d2f8
LC
58 '(#:disallowed-references ("doc")
59 #:configure-flags '("--enable-utf"
10d1822b
AE
60 "--enable-pcregrep-libz"
61 "--enable-pcregrep-libbz2"
90dcf9c8 62 "--enable-pcretest-libreadline"
16f71908
MW
63 "--enable-unicode-properties"
64 "--enable-pcre16"
65 "--enable-pcre32"
90dcf9c8 66 "--enable-jit")))
35b9e423 67 (synopsis "Perl Compatible Regular Expressions")
10d1822b
AE
68 (description
69 "The PCRE library is a set of functions that implement regular expression
35b9e423 70pattern matching using the same syntax and semantics as Perl 5. PCRE has its
10d1822b
AE
71own native API, as well as a set of wrapper functions that correspond to the
72POSIX regular expression API.")
73 (license license:bsd-3)
74 (home-page "http://www.pcre.org/")))
7ea3099b 75
426b0b89 76(define pcre-8.41
a97f0ee1
LC
77 (package
78 (inherit pcre)
426b0b89 79 (version "8.41")
a97f0ee1 80 (source (origin
426b0b89
LF
81 (method url-fetch)
82 (uri (list (string-append "mirror://sourceforge/pcre/pcre/"
83 version "/pcre-" version ".tar.bz2")
84 (string-append "ftp://ftp.csx.cam.ac.uk"
85 "/pub/software/programming/pcre/"
86 "pcre-" version ".tar.bz2")))
87 (sha256
88 (base32
89 "0c5m469p5pd7jip621ipq6hbgh7128lzh7xndllfgh77ban7wb76"))))))
a97f0ee1 90
7ea3099b
RW
91(define-public pcre2
92 (package
93 (name "pcre2")
9bb766e7 94 (version "10.23")
7ea3099b
RW
95 (source (origin
96 (method url-fetch)
97 (uri (string-append "mirror://sourceforge/pcre/pcre2/"
98 version "/pcre2-" version ".tar.bz2"))
99
100 (sha256
101 (base32
18d0cec2 102 "0vn5g0mkkp99mmzpissa06hpyj6pk9s4mlwbjqrjvw3ihy8rpiyz"))
37f46a4b
LF
103 (patches (search-patches "pcre2-CVE-2017-7186.patch"
104 "pcre2-CVE-2017-8786.patch"))))
7ea3099b
RW
105 (build-system gnu-build-system)
106 (inputs `(("bzip2" ,bzip2)
107 ("readline" ,readline)
108 ("zlib" ,zlib)))
109 (arguments
110 `(#:configure-flags '("--enable-unicode"
af6e2385
LF
111 "--enable-pcre2grep-libz"
112 "--enable-pcre2grep-libbz2"
113 "--enable-pcre2test-libreadline"
7ea3099b
RW
114 "--enable-pcre2-16"
115 "--enable-pcre2-32"
9bb766e7
MB
116 "--enable-jit")
117 #:phases
118 (modify-phases %standard-phases
119 (add-after 'unpack 'patch-paths
120 (lambda _
121 (substitute* "RunGrepTest"
122 (("/bin/echo") (which "echo")))
123 #t)))))
7ea3099b
RW
124 (synopsis "Perl Compatible Regular Expressions")
125 (description
126 "The PCRE library is a set of functions that implement regular expression
127pattern matching using the same syntax and semantics as Perl 5. PCRE has its
128own native API, as well as a set of wrapper functions that correspond to the
129POSIX regular expression API.")
130 (license license:bsd-3)
131 (home-page "http://www.pcre.org/")))