| 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 |
|
| 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" |
| 53 | "bin" |
| 54 | "doc" |
| 55 | "static")) |
| 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 | |
| 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
|
| 86 | pattern matching using the same syntax and semantics as Perl 5. PCRE has its
|
| 87 | own native API, as well as a set of wrapper functions that correspond to the
|
| 88 | POSIX 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 | |
| 116 | |
| 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
|
| 140 | pattern matching using the same syntax and semantics as Perl 5. PCRE has its
|
| 141 | own native API, as well as a set of wrapper functions that correspond to the
|
| 142 | POSIX regular expression API.")
|
| 143 | (license license:bsd-3)
|
| 144 | (home-page "https://www.pcre.org/")))
|