gnu: ruby-pandoc-ruby: Use pandoc instead of ghc-pandoc.
[jackhill/guix/guix.git] / gnu / packages / regex.scm
CommitLineData
dc253bf0 1;;; GNU Guix --- Functional package management for GNU
ac8a6428
MB
2;;; Copyright © 2014 John Darrington
3;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
16fbbf6a 4;;; Copyright © 2016, 2020 Marius Bakke <mbakke@fastmail.com>
0c58139c 5;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
dc253bf0
MB
6;;;
7;;; This file is part of GNU Guix.
8;;;
9;;; GNU Guix is free software; you can redistribute it and/or modify it
10;;; under the terms of the GNU General Public License as published by
11;;; the Free Software Foundation; either version 3 of the License, or (at
12;;; your option) any later version.
13;;;
14;;; GNU Guix is distributed in the hope that it will be useful, but
15;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;;; GNU General Public License for more details.
18;;;
19;;; You should have received a copy of the GNU General Public License
20;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22(define-module (gnu packages regex)
23 #:use-module ((guix licenses) #:prefix license:)
24 #:use-module (guix packages)
25 #:use-module (guix download)
56302fc1 26 #:use-module (guix git-download)
612af7ff
ST
27 #:use-module (guix build-system gnu)
28 #:use-module (guix utils))
dc253bf0
MB
29
30(define-public re2
31 (package
32 (name "re2")
8e619343 33 (version "2020-07-06")
e3bb89a9 34 (home-page "https://github.com/google/re2")
dc253bf0 35 (source (origin
56302fc1
MB
36 (method git-fetch)
37 (uri (git-reference (url home-page) (commit version)))
38 (file-name (git-file-name name version))
dc253bf0
MB
39 (sha256
40 (base32
8e619343 41 "12a9r9y7ry3hq0qf4znl9j7pn9mb5k6xp1f8nrk1sagfj1a504mq"))))
dc253bf0
MB
42 (build-system gnu-build-system)
43 (arguments
7a4a64e9
ST
44 `(#:modules ((guix build gnu-build-system)
45 (guix build utils)
46 (srfi srfi-1))
47 #:test-target "test"
dc253bf0 48 ;; There is no configure step, but the Makefile respects a prefix.
612af7ff
ST
49 ;; As ./configure does not know anything about the target CXX
50 ;; we need to specify TARGET-g++ explicitly.
51 #:make-flags (list (string-append "prefix=" %output)
52 (string-append
53 "CXX=" ,(string-append
54 (if (%current-target-system)
55 (string-append
56 (%current-target-system) "-")
57 "")
58 "g++")))
dc253bf0
MB
59 #:phases
60 (modify-phases %standard-phases
61 (delete 'configure)
62 (add-after 'install 'delete-static-library
63 (lambda* (#:key outputs #:allow-other-keys)
64 ;; No make target for shared-only; delete the static version.
65 (delete-file (string-append (assoc-ref outputs "out")
4a9c4a55
MB
66 "/lib/libre2.a"))
67 #t)))))
dc253bf0
MB
68 (synopsis "Fast, safe, thread-friendly regular expression engine")
69 (description "RE2 is a fast, safe, thread-friendly alternative to
70backtracking regular expression engines like those used in PCRE, Perl and
71Python. It is a C++ library.")
72 (license license:bsd-3)))
ac8a6428
MB
73
74(define-public tre
75 (package
76 (name "tre")
77 (version "0.8.0")
78 (source (origin
79 (method url-fetch)
80 (uri (string-append "http://laurikari.net/tre/"
81 name "-" version ".tar.bz2"))
82 (sha256
83 (base32
84 "0n36cgqys59r2gmb7jzbqiwsy790v8nbxk82d2n2saz0rp145ild"))))
85 (build-system gnu-build-system)
86 (arguments
dc1d3cde
KK
87 `(#:phases
88 (modify-phases %standard-phases
89 (add-before 'check 'install-locales
90 (lambda _
91 ;; The tests require the availability of the
92 ;; 'en_US.ISO-8859-1' locale.
93 (setenv "LOCPATH" (getcwd))
ed590089
RW
94 (invoke "localedef" "--no-archive"
95 "--prefix" (getcwd) "-i" "en_US"
96 "-f" "ISO-8859-1" "./en_US.ISO-8859-1"))))))
ac8a6428
MB
97 (synopsis "Approximate regex matching library and agrep utility")
98 (description "Superset of the POSIX regex API, enabling approximate
99matching. Also ships a version of the agrep utility which behaves similar to
100grep but features inexact matching.")
101 (home-page "http://laurikari.net/tre")
102 (license license:bsd-2)))