gnu: emacs-helm: Update to 3.8.7.
[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>
c5aaf1d0 4;;; Copyright © 2016, 2020, 2022 Marius Bakke <marius@gnu.org>
0c58139c 5;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
ef1bc776 6;;; Copyright © 2020 Brett Gilio <brettg@gnu.org>
dc253bf0
MB
7;;;
8;;; This file is part of GNU Guix.
9;;;
10;;; GNU Guix is free software; you can redistribute it and/or modify it
11;;; under the terms of the GNU General Public License as published by
12;;; the Free Software Foundation; either version 3 of the License, or (at
13;;; your option) any later version.
14;;;
15;;; GNU Guix is distributed in the hope that it will be useful, but
16;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;;; GNU General Public License for more details.
19;;;
20;;; You should have received a copy of the GNU General Public License
21;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23(define-module (gnu packages regex)
24 #:use-module ((guix licenses) #:prefix license:)
25 #:use-module (guix packages)
26 #:use-module (guix download)
56302fc1 27 #:use-module (guix git-download)
c5aaf1d0 28 #:use-module (guix gexp)
612af7ff
ST
29 #:use-module (guix build-system gnu)
30 #:use-module (guix utils))
dc253bf0
MB
31
32(define-public re2
33 (package
34 (name "re2")
e2c88683 35 (version "2022-02-01")
e3bb89a9 36 (home-page "https://github.com/google/re2")
dc253bf0 37 (source (origin
56302fc1
MB
38 (method git-fetch)
39 (uri (git-reference (url home-page) (commit version)))
40 (file-name (git-file-name name version))
dc253bf0
MB
41 (sha256
42 (base32
e2c88683 43 "1gzdqy5a0ln9rwd8kmwbgis6qin63hapicwb35xkbnj3y84jj6yx"))))
dc253bf0
MB
44 (build-system gnu-build-system)
45 (arguments
c5aaf1d0
MB
46 (list #:test-target "test"
47 ;; There is no configure step, but the Makefile respects a prefix.
48 #:make-flags #~(list (string-append "prefix=" #$output)
49 (string-append "CXX=" #$(cxx-for-target)))
50 #:phases
51 #~(modify-phases %standard-phases
52 (delete 'configure)
53 (add-after 'install 'delete-static-library
54 (lambda _
55 ;; No make target for shared-only; delete the static version.
56 (delete-file (string-append #$output "/lib/libre2.a")))))))
dc253bf0
MB
57 (synopsis "Fast, safe, thread-friendly regular expression engine")
58 (description "RE2 is a fast, safe, thread-friendly alternative to
59backtracking regular expression engines like those used in PCRE, Perl and
60Python. It is a C++ library.")
61 (license license:bsd-3)))
ac8a6428
MB
62
63(define-public tre
64 (package
65 (name "tre")
66 (version "0.8.0")
67 (source (origin
68 (method url-fetch)
69 (uri (string-append "http://laurikari.net/tre/"
70 name "-" version ".tar.bz2"))
71 (sha256
72 (base32
73 "0n36cgqys59r2gmb7jzbqiwsy790v8nbxk82d2n2saz0rp145ild"))))
74 (build-system gnu-build-system)
75 (arguments
dc1d3cde
KK
76 `(#:phases
77 (modify-phases %standard-phases
78 (add-before 'check 'install-locales
79 (lambda _
80 ;; The tests require the availability of the
81 ;; 'en_US.ISO-8859-1' locale.
82 (setenv "LOCPATH" (getcwd))
ed590089
RW
83 (invoke "localedef" "--no-archive"
84 "--prefix" (getcwd) "-i" "en_US"
85 "-f" "ISO-8859-1" "./en_US.ISO-8859-1"))))))
ac8a6428
MB
86 (synopsis "Approximate regex matching library and agrep utility")
87 (description "Superset of the POSIX regex API, enabling approximate
88matching. Also ships a version of the agrep utility which behaves similar to
89grep but features inexact matching.")
90 (home-page "http://laurikari.net/tre")
91 (license license:bsd-2)))