gnu: Add emacs-helm-flycheck.
[guix.git] / gnu / packages / pcre.scm
blob5719b7bb454ba726ddc6fba20dc187959836329c
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 ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
10 ;;;
11 ;;; This file is part of GNU Guix.
12 ;;;
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
17 ;;;
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 ;;; GNU General Public License for more details.
22 ;;;
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
26 (define-module (gnu packages pcre)
27   #:use-module ((guix licenses) #:prefix license:)
28   #:use-module (gnu packages compression)
29   #:use-module (gnu packages readline)
30   #:use-module (gnu packages)
31   #:use-module (guix packages)
32   #:use-module (guix download)
33   #:use-module (guix build-system gnu))
35 (define-public pcre
36   (package
37    (name "pcre")
38    (version "8.41")
39    (source (origin
40             (method url-fetch)
41             (uri (list
42                   (string-append "ftp://ftp.csx.cam.ac.uk"
43                                  "/pub/software/programming/pcre/"
44                                  "pcre-" version ".tar.bz2")
45                   (string-append "mirror://sourceforge/pcre/pcre/"
46                                  version "/pcre-" version ".tar.bz2")))
47             (sha256
48              (base32
49               "0c5m469p5pd7jip621ipq6hbgh7128lzh7xndllfgh77ban7wb76"))))
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/")))
76 (define-public pcre2
77   (package
78     (name "pcre2")
79     (version "10.31")
80     (source (origin
81               (method url-fetch)
82               (uri (string-append "mirror://sourceforge/pcre/pcre2/"
83                                   version "/pcre2-" version ".tar.bz2"))
85               (sha256
86                (base32
87                 "1b389pzw91k1hzydsh4smdsxyppwz4pv74m3nrvy8rda0j3m6zg0"))))
88    (build-system gnu-build-system)
89    (inputs `(("bzip2" ,bzip2)
90              ("readline" ,readline)
91              ("zlib" ,zlib)))
92    (arguments
93     `(#:configure-flags '("--enable-unicode"
94                           "--enable-pcre2grep-libz"
95                           "--enable-pcre2grep-libbz2"
96                           "--enable-pcre2test-libreadline"
97                           "--enable-pcre2-16"
98                           "--enable-pcre2-32"
99                           "--enable-jit")
100       #:phases
101       (modify-phases %standard-phases
102         (add-after 'unpack 'patch-paths
103           (lambda _
104             (substitute* "RunGrepTest"
105               (("/bin/echo") (which "echo")))
106             #t)))))
107    (synopsis "Perl Compatible Regular Expressions")
108    (description
109     "The PCRE library is a set of functions that implement regular expression
110 pattern matching using the same syntax and semantics as Perl 5.  PCRE has its
111 own native API, as well as a set of wrapper functions that correspond to the
112 POSIX regular expression API.")
113    (license license:bsd-3)
114    (home-page "https://www.pcre.org/")))