gnu: r-shape: Update to 1.4.5.
[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>
0b7f9806 8;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
8297ff0f 9;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
10d1822b
AE
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/>.
25
26(define-module (gnu packages pcre)
b5b73a82 27 #:use-module ((guix licenses) #:prefix license:)
10d1822b
AE
28 #:use-module (gnu packages compression)
29 #:use-module (gnu packages readline)
d46dd72c 30 #:use-module (gnu packages)
10d1822b
AE
31 #:use-module (guix packages)
32 #:use-module (guix download)
33 #:use-module (guix build-system gnu))
34
35(define-public pcre
36 (package
37 (name "pcre")
704f1b53 38 (version "8.44")
10d1822b
AE
39 (source (origin
40 (method url-fetch)
dae36ca5
MW
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")))
10d1822b
AE
47 (sha256
48 (base32
704f1b53 49 "0v9nk51wh55pcbnf2jr36yarz8ayajn6d7ywiq2wagivn9c8c40r"))))
10d1822b 50 (build-system gnu-build-system)
6d49ca3b
LC
51 (outputs '("out" ;library & headers
52 "bin" ;depends on Readline (adds 20MiB to the closure)
50849734
MB
53 "doc" ;1.8 MiB of HTML
54 "static")) ;1.8 MiB static libraries
10d1822b
AE
55 (inputs `(("bzip2" ,bzip2)
56 ("readline" ,readline)
57 ("zlib" ,zlib)))
58 (arguments
d786d2f8
LC
59 '(#:disallowed-references ("doc")
60 #:configure-flags '("--enable-utf"
10d1822b
AE
61 "--enable-pcregrep-libz"
62 "--enable-pcregrep-libbz2"
90dcf9c8 63 "--enable-pcretest-libreadline"
16f71908
MW
64 "--enable-unicode-properties"
65 "--enable-pcre16"
66 "--enable-pcre32"
50849734
MB
67 "--enable-jit")
68 #:phases (modify-phases %standard-phases
69 (add-after 'install 'move-static-libs
70 (lambda* (#:key outputs #:allow-other-keys)
71 (let ((source (string-append (assoc-ref outputs "out") "/lib"))
72 (static (string-append (assoc-ref outputs "static") "/lib")))
73 (mkdir-p static)
74 (for-each (lambda (lib)
75 (link lib (string-append static "/"
76 (basename lib)))
77 (delete-file lib))
78 (find-files source "\\.a$"))
79 #t))))))
35b9e423 80 (synopsis "Perl Compatible Regular Expressions")
10d1822b
AE
81 (description
82 "The PCRE library is a set of functions that implement regular expression
35b9e423 83pattern matching using the same syntax and semantics as Perl 5. PCRE has its
10d1822b
AE
84own native API, as well as a set of wrapper functions that correspond to the
85POSIX regular expression API.")
86 (license license:bsd-3)
265c31f5 87 (home-page "https://www.pcre.org/")))
7ea3099b
RW
88
89(define-public pcre2
90 (package
91 (name "pcre2")
f2ff01bb 92 (version "10.35")
7ea3099b
RW
93 (source (origin
94 (method url-fetch)
95 (uri (string-append "mirror://sourceforge/pcre/pcre2/"
96 version "/pcre2-" version ".tar.bz2"))
7ea3099b
RW
97 (sha256
98 (base32
f2ff01bb 99 "04s6kmk9qdd4rjz477h547j4bx7hfz0yalpvrm381rqc5ghaijww"))))
7ea3099b
RW
100 (build-system gnu-build-system)
101 (inputs `(("bzip2" ,bzip2)
102 ("readline" ,readline)
103 ("zlib" ,zlib)))
104 (arguments
105 `(#:configure-flags '("--enable-unicode"
af6e2385
LF
106 "--enable-pcre2grep-libz"
107 "--enable-pcre2grep-libbz2"
108 "--enable-pcre2test-libreadline"
7ea3099b
RW
109 "--enable-pcre2-16"
110 "--enable-pcre2-32"
f6943db7
MB
111 "--enable-jit"
112 "--disable-static")
9bb766e7
MB
113 #:phases
114 (modify-phases %standard-phases
115 (add-after 'unpack 'patch-paths
116 (lambda _
117 (substitute* "RunGrepTest"
118 (("/bin/echo") (which "echo")))
119 #t)))))
7ea3099b
RW
120 (synopsis "Perl Compatible Regular Expressions")
121 (description
122 "The PCRE library is a set of functions that implement regular expression
123pattern matching using the same syntax and semantics as Perl 5. PCRE has its
124own native API, as well as a set of wrapper functions that correspond to the
125POSIX regular expression API.")
126 (license license:bsd-3)
265c31f5 127 (home-page "https://www.pcre.org/")))