summaryrefslogtreecommitdiff
path: root/rockspecs.lua
diff options
context:
space:
mode:
Diffstat (limited to 'rockspecs.lua')
-rw-r--r--rockspecs.lua125
1 files changed, 125 insertions, 0 deletions
diff --git a/rockspecs.lua b/rockspecs.lua
new file mode 100644
index 0000000..8d5c06a
--- /dev/null
+++ b/rockspecs.lua
@@ -0,0 +1,125 @@
+local flavours = {"PCRE", "POSIX", "oniguruma", "TRE", "GNU"}
+
+-- Rockspec data
+
+-- Variables to be interpolated:
+--
+-- flavour: regex library
+-- version
+-- md5sum: checksum of distribution tarball
+
+-- When Lua 5.1 support is dropped, use an env argument with loadfile
+-- instead of wrapping in a table
+return {
+
+default = {
+ package="Lrexlib-"..flavour,
+ version=version.."-1",
+ source = {
+ url = "https://github.com/downloads/rrthomas/lrexlib/lrexlib-"..version..".zip",
+ md5 = md5sum
+ },
+ description = {
+ summary = "Regular expression library binding ("..flavour.." flavour).",
+ detailed = [[
+ Lrexlib is a regular expression library for Lua 5.1, which
+ provides bindings for several regular expression libraries.
+ This rock provides the ]]..flavour..[[ bindings.
+ ]],
+ homepage = "http://github.com/rrthomas/lrexlib",
+ license = "MIT/X11"
+ },
+ dependencies = {
+ "lua >= 5.1"
+ },
+},
+
+PCRE = {
+ external_dependencies = {
+ PCRE = {
+ header = "pcre.h",
+ library = "pcre"
+ }
+ },
+ build = {
+ type = "builtin",
+ modules = {
+ rex_pcre = {
+ sources = {"src/common.c", "src/pcre/lpcre.c", "src/pcre/lpcre_f.c"},
+ libraries = {"pcre"},
+ incdirs = {"$(PCRE_INCDIR)"},
+ libdirs = {"$(PCRE_LIBDIR)"}
+ }
+ }
+ }
+},
+
+POSIX = {
+ external_dependencies = {
+ POSIX = {
+ header = "regex.h",
+ }
+ },
+ build = {
+ type = "builtin",
+ modules = {
+ rex_posix = {"src/common.c", "src/posix/lposix.c"}
+ }
+ }
+},
+
+oniguruma = {
+ external_dependencies = {
+ ONIG = {
+ header = "oniguruma.h",
+ library = "onig"
+ }
+ },
+ build = {
+ type = "builtin",
+ modules = {
+ rex_onig = {
+ sources = {"src/common.c", "src/oniguruma/lonig.c", "src/oniguruma/lonig_f.c"},
+ libraries = {"onig"},
+ incdirs = {"$(ONIG_INCDIR)"},
+ libdirs = {"$(ONIG_LIBDIR)"}
+ }
+ }
+ }
+},
+
+TRE = {
+ external_dependencies = {
+ TRE = {
+ header = "tre/tre.h",
+ library = "tre"
+ }
+ },
+ build = {
+ type = "builtin",
+ modules = {
+ rex_tre = {
+ sources = {"src/common.c", "src/tre/ltre.c" --[[, "src/tre/tre_w.c"]]},
+ libraries = {"tre"},
+ incdirs = {"$(TRE_INCDIR)"},
+ libdirs = {"$(TRE_LIBDIR)"}
+ }
+ }
+ }
+},
+
+GNU = {
+ external_dependencies = {
+ GNU = {
+ header = "regex.h",
+ }
+ },
+ build = {
+ type = "builtin",
+ modules = {
+ rex_posix = {"src/common.c", "src/gnu/lgnu.c"}
+ }
+ }
+},
+
+} -- close wrapper table