gnu: pcre: Use HTTPS for home pages.
[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 ;;; Copyright © 2017 Ludovic Courtès <ludo@gnu.org>
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)
25 #:use-module ((guix licenses) #:prefix license:)
26 #:use-module (gnu packages compression)
27 #:use-module (gnu packages readline)
28 #:use-module (gnu packages)
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")
36 (version "8.40")
37 (replacement pcre-8.41)
38 (source (origin
39 (method url-fetch)
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")))
46 (patches (search-patches "pcre-CVE-2017-7186.patch"))
47 (sha256
48 (base32
49 "1x7lpjn7jhk0n3sdvggxrlrhab8kkfjwl7qix0ypw9nlx8lpmqh0"))))
50 (build-system gnu-build-system)
51 (outputs '("out" ;library & headers
52 "bin" ;depends on Readline (adds 20MiB to the closure)
53 "doc")) ;1.8 MiB of HTML
54 (inputs `(("bzip2" ,bzip2)
55 ("readline" ,readline)
56 ("zlib" ,zlib)))
57 (arguments
58 '(#:disallowed-references ("doc")
59 #:configure-flags '("--enable-utf"
60 "--enable-pcregrep-libz"
61 "--enable-pcregrep-libbz2"
62 "--enable-pcretest-libreadline"
63 "--enable-unicode-properties"
64 "--enable-pcre16"
65 "--enable-pcre32"
66 "--enable-jit")))
67 (synopsis "Perl Compatible Regular Expressions")
68 (description
69 "The PCRE library is a set of functions that implement regular expression
70 pattern matching using the same syntax and semantics as Perl 5. PCRE has its
71 own native API, as well as a set of wrapper functions that correspond to the
72 POSIX regular expression API.")
73 (license license:bsd-3)
74 (home-page "https://www.pcre.org/")))
75
76 (define pcre-8.41
77 (package
78 (inherit pcre)
79 (version "8.41")
80 (source (origin
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"))))))
90
91 (define-public pcre2
92 (package
93 (name "pcre2")
94 (version "10.23")
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
102 "0vn5g0mkkp99mmzpissa06hpyj6pk9s4mlwbjqrjvw3ihy8rpiyz"))
103 (patches (search-patches "pcre2-CVE-2017-7186.patch"
104 "pcre2-CVE-2017-8786.patch"))))
105 (build-system gnu-build-system)
106 (inputs `(("bzip2" ,bzip2)
107 ("readline" ,readline)
108 ("zlib" ,zlib)))
109 (arguments
110 `(#:configure-flags '("--enable-unicode"
111 "--enable-pcre2grep-libz"
112 "--enable-pcre2grep-libbz2"
113 "--enable-pcre2test-libreadline"
114 "--enable-pcre2-16"
115 "--enable-pcre2-32"
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)))))
124 (synopsis "Perl Compatible Regular Expressions")
125 (description
126 "The PCRE library is a set of functions that implement regular expression
127 pattern matching using the same syntax and semantics as Perl 5. PCRE has its
128 own native API, as well as a set of wrapper functions that correspond to the
129 POSIX regular expression API.")
130 (license license:bsd-3)
131 (home-page "https://www.pcre.org/")))