| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 |
|
| 27 | (define-module (gnu packages regex)
|
| 28 | #:use-module ((guix licenses) #:prefix license:)
|
| 29 | #:use-module (guix packages)
|
| 30 | #:use-module (guix download)
|
| 31 | #:use-module (guix git-download)
|
| 32 | #:use-module (guix gexp)
|
| 33 | #:use-module (guix build-system gnu)
|
| 34 | #:use-module (guix build-system cmake)
|
| 35 | #:use-module (guix utils)
|
| 36 | #:use-module (gnu packages autotools)
|
| 37 | #:use-module (gnu packages check)
|
| 38 | #:use-module (gnu packages cpp)
|
| 39 | #:use-module (gnu packages gettext)
|
| 40 | #:use-module (gnu packages python)
|
| 41 | #:use-module (gnu packages ruby))
|
| 42 |
|
| 43 | (define-public onigmo
|
| 44 | (package
|
| 45 | (name "onigmo")
|
| 46 | (version "6.2.0")
|
| 47 | (source
|
| 48 | (origin
|
| 49 | (method git-fetch)
|
| 50 | (uri (git-reference
|
| 51 | (url "https://github.com/k-takata/Onigmo")
|
| 52 | (commit (string-append "Onigmo-" version))))
|
| 53 | (file-name (git-file-name name version))
|
| 54 | (sha256
|
| 55 | (base32 "0m6z61w8b4y8yk63sj9q8jm8a2v4ncrx258k96bn71nmji7rjnq3"))))
|
| 56 | (build-system gnu-build-system)
|
| 57 | (arguments
|
| 58 | (list
|
| 59 | #:test-target "pytest"))
|
| 60 | (native-inputs (list autoconf automake libtool ruby python))
|
| 61 | (home-page "https://github.com/k-takata/Onigmo")
|
| 62 | (synopsis "Regular expression library forked from Oniguruma")
|
| 63 | (description
|
| 64 | "Onigmo is a regular expression library forked from Oniguruma. It
|
| 65 | focuses on supporting new expressions.")
|
| 66 | (license license:bsd-2)))
|
| 67 |
|
| 68 | (define-public oniguruma
|
| 69 | (package
|
| 70 | (name "oniguruma")
|
| 71 | (version "6.9.10")
|
| 72 | (source
|
| 73 | (origin
|
| 74 | (method git-fetch)
|
| 75 | (uri (git-reference
|
| 76 | (url "https://github.com/kkos/oniguruma")
|
| 77 | (commit (string-append "v" version))))
|
| 78 | (file-name
|
| 79 | (git-file-name name version))
|
| 80 | (sha256
|
| 81 | (base32 "0lp5ix2ky40ijzp1nsrxrlglvqrmik402n48f7v8siqd3isdbxzs"))))
|
| 82 | (build-system gnu-build-system)
|
| 83 | (arguments
|
| 84 | (list
|
| 85 | #:configure-flags #~(list "--disable-static")))
|
| 86 | (native-inputs
|
| 87 | (list autoconf
|
| 88 | automake
|
| 89 | libtool))
|
| 90 | (home-page "https://github.com/kkos/oniguruma")
|
| 91 | (synopsis "Regular expression library")
|
| 92 | (description
|
| 93 | "Oniguruma is a regular expressions library. The special characteristic
|
| 94 | of this library is that different character encoding for every regular
|
| 95 | expression object can be specified.")
|
| 96 | (license license:bsd-2)))
|
| 97 |
|
| 98 | (define-public re2
|
| 99 | (package
|
| 100 | (name "re2")
|
| 101 | (version "2022-12-01")
|
| 102 | (home-page "https://github.com/google/re2")
|
| 103 | (source (origin
|
| 104 | (method git-fetch)
|
| 105 | (uri (git-reference (url home-page) (commit version)))
|
| 106 | (file-name (git-file-name name version))
|
| 107 | (sha256
|
| 108 | (base32
|
| 109 | "0g627a5ppyarhf2ph4gyzj89pwbkwfjfajgljzkmjafjmdyxfqs6"))))
|
| 110 | (build-system gnu-build-system)
|
| 111 | (arguments
|
| 112 | (list #:test-target "test"
|
| 113 | |
| 114 | #:make-flags #~(list (string-append "prefix=" #$output)
|
| 115 | (string-append "CXX=" #$(cxx-for-target)))
|
| 116 | #:phases
|
| 117 | #~(modify-phases %standard-phases
|
| 118 | (delete 'configure)
|
| 119 | (add-after 'install 'delete-static-library
|
| 120 | (lambda _
|
| 121 | |
| 122 | (delete-file (string-append #$output "/lib/libre2.a")))))))
|
| 123 | (synopsis "Fast, safe, thread-friendly regular expression engine")
|
| 124 | (description "RE2 is a fast, safe, thread-friendly alternative to
|
| 125 | backtracking regular expression engines like those used in PCRE, Perl and
|
| 126 | Python. It is a C++ library.")
|
| 127 | (license license:bsd-3)))
|
| 128 |
|
| 129 | (define-public re2-next
|
| 130 | (package
|
| 131 | (inherit re2)
|
| 132 | (name "re2")
|
| 133 | (version "2024-07-02")
|
| 134 | (source (origin
|
| 135 | (method git-fetch)
|
| 136 | (uri (git-reference
|
| 137 | (url "https://github.com/google/re2")
|
| 138 | (commit version)))
|
| 139 | (file-name (git-file-name name version))
|
| 140 | (sha256
|
| 141 | (base32
|
| 142 | "11q0kz8b3y5ysn58fr62yhib520f9l3grbn8gxr8x5s9k700vq11"))))
|
| 143 | (build-system cmake-build-system)
|
| 144 | (arguments (list #:tests? (not (%current-target-system))
|
| 145 | #:configure-flags #~(list "-DBUILD_SHARED_LIBS=ON"
|
| 146 | |
| 147 | #$@(if (not (%current-target-system))
|
| 148 | #~("-DRE2_BUILD_TESTING=ON")
|
| 149 | #~()))))
|
| 150 | (native-inputs (list googlebenchmark googletest))
|
| 151 | (propagated-inputs (list abseil-cpp))))
|
| 152 |
|
| 153 | (define-public tre
|
| 154 | (package
|
| 155 | (name "tre")
|
| 156 | (version "0.9.0")
|
| 157 | (source (origin
|
| 158 | (method git-fetch)
|
| 159 | (uri (git-reference
|
| 160 | (url "https://github.com/laurikari/tre")
|
| 161 | (commit (string-append "v" version))))
|
| 162 | (file-name (git-file-name name version))
|
| 163 | (sha256
|
| 164 | (base32
|
| 165 | "1zy91a0jfc5galvd7xrvkn17i3wfiwnv9ikys4qiyjgy7fmk5vz4"))))
|
| 166 | (build-system gnu-build-system)
|
| 167 | (arguments
|
| 168 | `(#:phases
|
| 169 | (modify-phases %standard-phases
|
| 170 | (replace 'bootstrap
|
| 171 | (lambda _
|
| 172 | (invoke "autoreconf" "-vif")))
|
| 173 | (add-before 'check 'install-locales
|
| 174 | (lambda _
|
| 175 | |
| 176 | |
| 177 | (setenv "LOCPATH" (getcwd))
|
| 178 | (invoke "localedef" "--no-archive"
|
| 179 | "--prefix" (getcwd) "-i" "en_US"
|
| 180 | "-f" "ISO-8859-1" "./en_US.ISO-8859-1"))))))
|
| 181 | (native-inputs
|
| 182 | (list autoconf
|
| 183 | automake
|
| 184 | gettext-minimal |
| 185 | libtool))
|
| 186 | (synopsis "Approximate regex matching library and agrep utility")
|
| 187 | (description "Superset of the POSIX regex API, enabling approximate
|
| 188 | matching. Also ships a version of the agrep utility which behaves similar to
|
| 189 | grep but features inexact matching.")
|
| 190 | (home-page "https://laurikari.net/tre")
|
| 191 | (license license:bsd-2)))
|