Add PCRE2 to rockspecs and README

This commit is contained in:
Reuben Thomas
2017-06-20 22:36:10 +01:00
parent da06ccb6f0
commit 9ac52e5a29
2 changed files with 27 additions and 4 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ Lrexlib is installed with LuaRocks_, using the command::
luarocks install lrexlib-FLAVOUR
where **FLAVOUR** is one of PCRE, POSIX, oniguruma, TRE, GNU
where **FLAVOUR** is one of PCRE, PCRE2, POSIX, oniguruma, TRE, GNU
.. _LuaRocks: http://www.luarocks.org
+26 -3
View File
@@ -5,9 +5,11 @@
-- flavour: regex library
-- version
local flavours = {"PCRE", "POSIX", "oniguruma", "TRE", "GNU"}
local flavours = {"PCRE", "PCRE2", "POSIX", "oniguruma", "TRE", "GNU"}
local version_dashed = version:gsub ("%.", "-")
local defines = {"VERSION=\""..version.."\"", "LUA_COMPAT_5_2"}
-- FIXME: PCRE2 define should be only in PCRE2 rockspec
local defines = {"VERSION=\""..version.."\"", "LUA_COMPAT_5_2",
"PCRE2_CODE_UNIT_WIDTH=8"}
-- FIXME: When Lua 5.1 support is dropped, use an env argument with
-- loadfile instead of wrapping in a table
@@ -23,7 +25,7 @@ default = {
description = {
summary = "Regular expression library binding ("..flavour.." flavour).",
detailed = [[
Lrexlib is a regular expression library for Lua 5.1 and 5.2, which
Lrexlib is a regular expression library for Lua 5.1-5.3, which
provides bindings for several regular expression libraries.
This rock provides the ]]..flavour..[[ bindings.]],
homepage = "http://github.com/rrthomas/lrexlib",
@@ -55,6 +57,27 @@ PCRE = {
}
},
PCRE2 = {
external_dependencies = {
PCRE2 = {
header = "pcre2.h",
library = "pcre2-8"
}
},
build = {
type = "builtin",
modules = {
rex_pcre2 = {
defines = defines,
sources = {"src/common.c", "src/pcre2/lpcre2.c", "src/pcre2/lpcre2_f.c"},
libraries = {"pcre2-8"},
incdirs = {"$(PCRE2_INCDIR)"},
libdirs = {"$(PCRE2_LIBDIR)"}
}
}
}
},
POSIX = {
external_dependencies = {
POSIX = {