pcre.scm 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
  3. ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
  4. ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
  5. ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
  6. ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
  7. ;;; Copyright © 2017 Ludovic Courtès <ludo@gnu.org>
  8. ;;;
  9. ;;; This file is part of GNU Guix.
  10. ;;;
  11. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  12. ;;; under the terms of the GNU General Public License as published by
  13. ;;; the Free Software Foundation; either version 3 of the License, or (at
  14. ;;; your option) any later version.
  15. ;;;
  16. ;;; GNU Guix is distributed in the hope that it will be useful, but
  17. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  18. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. ;;; GNU General Public License for more details.
  20. ;;;
  21. ;;; You should have received a copy of the GNU General Public License
  22. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  23. (define-module (gnu packages pcre)
  24. #:use-module ((guix licenses) #:prefix license:)
  25. #:use-module (gnu packages compression)
  26. #:use-module (gnu packages readline)
  27. #:use-module (gnu packages)
  28. #:use-module (guix packages)
  29. #:use-module (guix download)
  30. #:use-module (guix build-system gnu))
  31. (define-public pcre
  32. (package
  33. (name "pcre")
  34. (version "8.40")
  35. (replacement pcre-8.41)
  36. (source (origin
  37. (method url-fetch)
  38. (uri (list
  39. (string-append "ftp://ftp.csx.cam.ac.uk"
  40. "/pub/software/programming/pcre/"
  41. "pcre-" version ".tar.bz2")
  42. (string-append "mirror://sourceforge/pcre/pcre/"
  43. version "/pcre-" version ".tar.bz2")))
  44. (patches (search-patches "pcre-CVE-2017-7186.patch"))
  45. (sha256
  46. (base32
  47. "1x7lpjn7jhk0n3sdvggxrlrhab8kkfjwl7qix0ypw9nlx8lpmqh0"))))
  48. (build-system gnu-build-system)
  49. (outputs '("out" ;library & headers
  50. "bin" ;depends on Readline (adds 20MiB to the closure)
  51. "doc")) ;1.8 MiB of HTML
  52. (inputs `(("bzip2" ,bzip2)
  53. ("readline" ,readline)
  54. ("zlib" ,zlib)))
  55. (arguments
  56. '(#:disallowed-references ("doc")
  57. #:configure-flags '("--enable-utf"
  58. "--enable-pcregrep-libz"
  59. "--enable-pcregrep-libbz2"
  60. "--enable-pcretest-libreadline"
  61. "--enable-unicode-properties"
  62. "--enable-pcre16"
  63. "--enable-pcre32"
  64. "--enable-jit")))
  65. (synopsis "Perl Compatible Regular Expressions")
  66. (description
  67. "The PCRE library is a set of functions that implement regular expression
  68. pattern matching using the same syntax and semantics as Perl 5. PCRE has its
  69. own native API, as well as a set of wrapper functions that correspond to the
  70. POSIX regular expression API.")
  71. (license license:bsd-3)
  72. (home-page "http://www.pcre.org/")))
  73. (define pcre-8.41
  74. (package
  75. (inherit pcre)
  76. (version "8.41")
  77. (source (origin
  78. (method url-fetch)
  79. (uri (list (string-append "mirror://sourceforge/pcre/pcre/"
  80. version "/pcre-" version ".tar.bz2")
  81. (string-append "ftp://ftp.csx.cam.ac.uk"
  82. "/pub/software/programming/pcre/"
  83. "pcre-" version ".tar.bz2")))
  84. (sha256
  85. (base32
  86. "0c5m469p5pd7jip621ipq6hbgh7128lzh7xndllfgh77ban7wb76"))))))
  87. (define-public pcre2
  88. (package
  89. (name "pcre2")
  90. (version "10.23")
  91. (source (origin
  92. (method url-fetch)
  93. (uri (string-append "mirror://sourceforge/pcre/pcre2/"
  94. version "/pcre2-" version ".tar.bz2"))
  95. (sha256
  96. (base32
  97. "0vn5g0mkkp99mmzpissa06hpyj6pk9s4mlwbjqrjvw3ihy8rpiyz"))
  98. (patches (search-patches "pcre2-CVE-2017-7186.patch"
  99. "pcre2-CVE-2017-8786.patch"))))
  100. (build-system gnu-build-system)
  101. (inputs `(("bzip2" ,bzip2)
  102. ("readline" ,readline)
  103. ("zlib" ,zlib)))
  104. (arguments
  105. `(#:configure-flags '("--enable-unicode"
  106. "--enable-pcre2grep-libz"
  107. "--enable-pcre2grep-libbz2"
  108. "--enable-pcre2test-libreadline"
  109. "--enable-pcre2-16"
  110. "--enable-pcre2-32"
  111. "--enable-jit")
  112. #:phases
  113. (modify-phases %standard-phases
  114. (add-after 'unpack 'patch-paths
  115. (lambda _
  116. (substitute* "RunGrepTest"
  117. (("/bin/echo") (which "echo")))
  118. #t)))))
  119. (synopsis "Perl Compatible Regular Expressions")
  120. (description
  121. "The PCRE library is a set of functions that implement regular expression
  122. pattern matching using the same syntax and semantics as Perl 5. PCRE has its
  123. own native API, as well as a set of wrapper functions that correspond to the
  124. POSIX regular expression API.")
  125. (license license:bsd-3)
  126. (home-page "http://www.pcre.org/")))