2019-12-31 14:36:56 +08:00
|
|
|
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
2018-10-08 04:52:23 +08:00
|
|
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
2016-05-12 12:22:25 +08:00
|
|
|
#
|
2018-10-08 04:52:23 +08:00
|
|
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
|
|
|
2015-12-23 07:53:43 +08:00
|
|
|
from spack import *
|
|
|
|
|
2016-08-10 16:50:00 +08:00
|
|
|
|
2017-01-19 02:34:09 +08:00
|
|
|
class Pcre2(AutotoolsPackage):
|
2015-12-23 07:53:43 +08:00
|
|
|
"""The PCRE2 package contains Perl Compatible Regular Expression
|
|
|
|
libraries. These are useful for implementing regular expression
|
|
|
|
pattern matching using the same syntax and semantics as Perl 5."""
|
2018-05-21 04:05:47 +08:00
|
|
|
|
2020-08-31 19:05:07 +08:00
|
|
|
homepage = "http://www.pcre.org"
|
2018-05-21 04:05:47 +08:00
|
|
|
url = "https://ftp.pcre.org/pub/pcre/pcre2-10.31.tar.bz2"
|
2015-12-23 07:53:43 +08:00
|
|
|
|
2020-06-16 13:44:04 +08:00
|
|
|
version('10.35', sha256='9ccba8e02b0ce78046cdfb52e5c177f0f445e421059e43becca4359c669d4613')
|
2019-10-11 13:44:41 +08:00
|
|
|
version('10.31', sha256='e07d538704aa65e477b6a392b32ff9fc5edf75ab9a40ddfc876186c4ff4d68ac')
|
|
|
|
version('10.20', sha256='332e287101c9e9567d1ed55391b338b32f1f72c5b5ee7cc81ef2274a53ad487a')
|
2019-03-13 09:04:11 +08:00
|
|
|
|
|
|
|
variant('multibyte', default=True,
|
|
|
|
description='Enable support for 16 and 32 bit characters.')
|
2020-06-16 13:44:04 +08:00
|
|
|
variant('jit', default=False,
|
|
|
|
description='enable Just-In-Time compiling support')
|
2019-03-13 09:04:11 +08:00
|
|
|
|
|
|
|
def configure_args(self):
|
|
|
|
args = []
|
|
|
|
|
|
|
|
if '+multibyte' in self.spec:
|
|
|
|
args.append('--enable-pcre2-16')
|
|
|
|
args.append('--enable-pcre2-32')
|
|
|
|
|
2020-06-16 13:44:04 +08:00
|
|
|
if '+jit' in self.spec:
|
|
|
|
args.append('--enable-jit')
|
|
|
|
|
2019-03-13 09:04:11 +08:00
|
|
|
return args
|
2019-10-06 10:13:39 +08:00
|
|
|
|
|
|
|
@property
|
|
|
|
def libs(self):
|
2020-09-09 16:11:29 +08:00
|
|
|
if '+multibyte' in self.spec:
|
|
|
|
name = 'libpcre2-32'
|
|
|
|
else:
|
|
|
|
name = 'libpcre2-8'
|
|
|
|
|
|
|
|
return find_libraries(name, root=self.prefix, recursive=True)
|