projects/guix·blob python-team · refs

191 lines · 7.3 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2014 John Darrington
3;;; Copyright © 2015 Mark H Weaver <[email protected]>
4;;; Copyright © 2016 Jelle Licht <[email protected]>
5;;; Copyright © 2016, 2018, 2019, 2020, 2022 Marius Bakke <[email protected]>
6;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <[email protected]>
7;;; Copyright © 2020 Brett Gilio <[email protected]>
8;;; Copyright © 2024 Zheng Junjie <[email protected]>
9;;; Copyright © 2025 Ashish SHUKLA <[email protected]>
10;;; Copyright © 2026 gemmaro <[email protected]>
11;;;
12;;; This file is part of GNU Guix.
13;;;
14;;; GNU Guix is free software; you can redistribute it and/or modify it
15;;; under the terms of the GNU General Public License as published by
16;;; the Free Software Foundation; either version 3 of the License, or (at
17;;; your option) any later version.
18;;;
19;;; GNU Guix is distributed in the hope that it will be useful, but
20;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22;;; GNU General Public License for more details.
23;;;
24;;; You should have received a copy of the GNU General Public License
25;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
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
65focuses 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
94of this library is that different character encoding for every regular
95expression 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 ;; There is no configure step, but the Makefile respects a prefix.
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 ;; No make target for shared-only; delete the static version.
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
125backtracking regular expression engines like those used in PCRE, Perl and
126Python. 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 ;; "-DRE2_USE_ICU=ON"
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 ;; The tests require the availability of the
176 ;; 'en_US.ISO-8859-1' locale.
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 ;for autopoint
185 libtool))
186 (synopsis "Approximate regex matching library and agrep utility")
187 (description "Superset of the POSIX regex API, enabling approximate
188matching. Also ships a version of the agrep utility which behaves similar to
189grep but features inexact matching.")
190 (home-page "https://laurikari.net/tre")
191 (license license:bsd-2)))