summaryrefslogtreecommitdiff
path: root/rockspecs.lua
diff options
context:
space:
mode:
authorReuben Thomas <rrt@sc3d.org>2017-06-20 22:36:10 +0100
committerReuben Thomas <rrt@sc3d.org>2017-06-20 22:36:10 +0100
commit9ac52e5a29fcacd57b9fcc024ffb0556002d25c7 (patch)
treea52dce5cb9443152d5436b2315aa7211c91d0657 /rockspecs.lua
parentda06ccb6f0c770f4fdf1af68050240c0aac218eb (diff)
downloadlrexlib-9ac52e5a29fcacd57b9fcc024ffb0556002d25c7.tar.gz
Add PCRE2 to rockspecs and README
Diffstat (limited to 'rockspecs.lua')
-rw-r--r--rockspecs.lua29
1 files changed, 26 insertions, 3 deletions
diff --git a/rockspecs.lua b/rockspecs.lua
index 487185c..c049f51 100644
--- a/rockspecs.lua
+++ b/rockspecs.lua
@@ -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 = {