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