projects/guix·blob python-team · refs

144 lines · 6.2 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Andreas Enge <[email protected]>
3;;; Copyright © 2014, 2015 Mark H Weaver <[email protected]>
4;;; Copyright © 2015 Ricardo Wurmus <[email protected]>
5;;; Copyright © 2016 Leo Famulari <[email protected]>
6;;; Copyright © 2017, 2022 Marius Bakke <[email protected]>
7;;; Copyright © 2017 Ludovic Courtès <[email protected]>
8;;; Copyright © 2017, 2021, 2022 Efraim Flashner <[email protected]>
9;;; Copyright © 2018 Tobias Geerinckx-Rice <[email protected]>
10;;; Copyright © 2021 Jean-Baptiste Volatier <[email protected]>
11;;; Copyright © 2021 Simon Tournier <[email protected]>
12;;;
13;;; This file is part of GNU Guix.
14;;;
15;;; GNU Guix is free software; you can redistribute it and/or modify it
16;;; under the terms of the GNU General Public License as published by
17;;; the Free Software Foundation; either version 3 of the License, or (at
18;;; your option) any later version.
19;;;
20;;; GNU Guix is distributed in the hope that it will be useful, but
21;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23;;; GNU General Public License for more details.
24;;;
25;;; You should have received a copy of the GNU General Public License
26;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27
28(define-module (gnu packages pcre)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (gnu packages compression)
31 #:use-module (gnu packages readline)
32 #:use-module (gnu packages)
33 #:use-module (guix utils)
34 #:use-module (guix packages)
35 #:use-module (guix download)
36 #:use-module (guix gexp)
37 #:use-module (guix utils)
38 #:use-module (guix build-system gnu))
39
40(define-public pcre
41 (package
42 (name "pcre")
43 (version "8.45")
44 (source (origin
45 (method url-fetch)
46 (uri (string-append "mirror://sourceforge/pcre/pcre/"
47 version "/pcre-" version ".tar.bz2"))
48 (sha256
49 (base32
50 "1f7zichy6iimmkfrqdl575sdlm795cyc75szgg1vc2xvsbf6zbjd"))))
51 (build-system gnu-build-system)
52 (outputs '("out" ;library & headers
53 "bin" ;depends on Readline (adds 20MiB to the closure)
54 "doc" ;1.8 MiB of HTML
55 "static")) ;1.8 MiB static libraries
56 (inputs (list bzip2 readline zlib))
57 (arguments
58 (list
59 #:disallowed-references '("doc")
60 #:configure-flags #~'("--enable-utf"
61 "--enable-pcregrep-libz"
62 "--enable-pcregrep-libbz2"
63 "--enable-pcretest-libreadline"
64 "--enable-unicode-properties"
65 "--enable-pcre16"
66 "--enable-pcre32"
67 ;; riscv64-linux is an unsupported architecture.
68 #$@(if (target-riscv64?)
69 #~()
70 #~("--enable-jit")))
71 #:phases
72 #~(modify-phases %standard-phases
73 (add-after 'install 'move-static-libs
74 (lambda _
75 (let ((source (string-append #$output "/lib"))
76 (static (string-append #$output:static "/lib")))
77 (mkdir-p static)
78 (for-each (lambda (lib)
79 (link lib (string-append static "/"
80 (basename lib)))
81 (delete-file lib))
82 (find-files source "\\.a$"))))))))
83 (synopsis "Perl Compatible Regular Expressions")
84 (description
85 "The PCRE library is a set of functions that implement regular expression
86pattern matching using the same syntax and semantics as Perl 5. PCRE has its
87own native API, as well as a set of wrapper functions that correspond to the
88POSIX regular expression API.")
89 (license license:bsd-3)
90 (home-page "https://www.pcre.org/")))
91
92(define-public pcre2
93 (package
94 (name "pcre2")
95 (version "10.47")
96 (source (origin
97 (method url-fetch)
98 (uri (string-append "https://github.com/PCRE2Project/pcre2"
99 "/releases/download/pcre2-" version
100 "/pcre2-" version ".tar.bz2"))
101 (sha256
102 (base32
103 "1ivvip83z84wip07zsq6bn2mg84xpapgvs76i4px8l0j8scqrzj7"))))
104 (build-system gnu-build-system)
105 (outputs '("out" "static"))
106 (inputs (list bzip2 readline zlib))
107 (arguments
108 (list #:configure-flags
109 #~'("--enable-unicode"
110 "--enable-pcre2grep-libz"
111 "--enable-pcre2grep-libbz2"
112 "--enable-pcre2test-libreadline"
113 "--enable-pcre2-16"
114 "--enable-pcre2-32"
115 ;; riscv64-linux and loongarch64-linux is an unsupported
116 ;; architecture.
117 #$@(if (or (target-riscv64?)
118 (target-loongarch64?))
119 #~()
120 #~("--enable-jit")))
121 #:phases
122 #~(modify-phases %standard-phases
123 (add-after 'unpack 'patch-paths
124 (lambda _
125 (substitute* "RunGrepTest"
126 (("/bin/echo") (which "echo")))))
127 (add-after 'install 'move-static-libs
128 (lambda _
129 (let ((source (string-append #$output "/lib"))
130 (static (string-append #$output:static "/lib")))
131 (mkdir-p static)
132 (for-each (lambda (lib)
133 (link lib (string-append static "/"
134 (basename lib)))
135 (delete-file lib))
136 (find-files source "\\.a$"))))))))
137 (synopsis "Perl Compatible Regular Expressions")
138 (description
139 "The PCRE library is a set of functions that implement regular expression
140pattern matching using the same syntax and semantics as Perl 5. PCRE has its
141own native API, as well as a set of wrapper functions that correspond to the
142POSIX regular expression API.")
143 (license license:bsd-3)
144 (home-page "https://www.pcre.org/")))