This repository has been archived by the owner on Nov 20, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
* upstream/master: (33 commits) Makefile: fix things so rockspecs aren't distributed (a hard problem) but do have the right MD5 sums NEWS: add for 2.7.1 Makefile: make it harder to make mistakes Makefile: exclude luarocks directory from distribution zip Makefile: bump version to 2.7.1 Allow to signal no replacement in gsub with a nil or false replacement. rockspecs.lua: fix some inconsistent whitespace rockspecs.lua: mention that we're Lua 5.2 compatible algo.h: fix to make it work on Lua 5.1; oops .gitignore: add luarocks directory Add luarocks-config.lua, needed for testing rockspecs Makefile: fix testing of rockspecs, and remove now-redundant warning to upload to github Makefile: make release depend on dist and check Makefile: fix a typo Makefile: test rockspecs after uploading the distribution before announcing it. common.c: remove last use of non-Lua state malloc Makefile: add a convenience install target for testing common.c: use Lua state allocator for TBuffers Makefile: simplify running tests, and error if LUA is not set rockspecs.lua: fix some typos in the GNU rockspec ...
- Loading branch information
Showing
33 changed files
with
386 additions
and
540 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ | |
ChangeLog | ||
*.zip | ||
release-notes | ||
/*.rockspec | ||
/luarocks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,45 @@ | ||
# Makefile for lrexlib | ||
|
||
# See src/*/Makefile and src/defaults.mak for user-definable settings | ||
|
||
include src/defaults.mak | ||
# See src/*/Makefile for user-definable settings | ||
|
||
REGNAMES = gnu pcre posix oniguruma tre | ||
PROJECT = lrexlib | ||
VERSION = $(V).$(MINORV) | ||
VERSION = 2.7.1 | ||
PROJECT_VERSIONED = $(PROJECT)-$(VERSION) | ||
DISTFILE = $(PROJECT_VERSIONED).zip | ||
|
||
all: | ||
@for i in $(REGNAMES); do \ | ||
make -C src/$$i; \ | ||
install: dist | ||
@for i in *.rockspec; do \ | ||
luarocks make $$i; \ | ||
done | ||
@make -C doc | ||
|
||
check: all | ||
check: | ||
@if test -z "$(LUA)"; then echo "Set LUA to run tests"; exit 1; fi | ||
@for i in $(REGNAMES); do \ | ||
make -C src/$$i check; \ | ||
LUA_PATH="test/?.lua;$(LUA_PATH)" $(LUA) test/runtest.lua -dsrc/$$i $$i; \ | ||
done | ||
|
||
clean: | ||
@for i in $(REGNAMES); do \ | ||
make -C src/$$i clean; \ | ||
done | ||
@make -C doc clean | ||
docs: | ||
@make -C doc | ||
|
||
dist: all | ||
rockspecs: dist | ||
rm -f *.rockspec | ||
lua mkrockspecs.lua $(VERSION) `md5sum $(DISTFILE)` | ||
|
||
dist: docs | ||
git2cl > ChangeLog | ||
cd .. && rm -f $(DISTFILE) && zip $(DISTFILE) -r $(PROJECT) -x "lrexlib/.git/*" "*.gitignore" "*.o" "*.a" "*.so" "*.so.*" "*.zip" "*SciTE.properties" "*scite.properties" && mv $(DISTFILE) $(PROJECT) && cd $(PROJECT) && unzip $(DISTFILE) && mv $(PROJECT) $(PROJECT_VERSIONED) && rm -f $(DISTFILE) && zip $(DISTFILE) -r $(PROJECT_VERSIONED) && rm -rf $(PROJECT_VERSIONED) | ||
cd .. && rm -f $(DISTFILE) && zip $(DISTFILE) -r $(PROJECT) -x "lrexlib/.git/*" "*.gitignore" "*.o" "*.a" "*.so" "*.so.*" "*.zip" "*SciTE.properties" "*scite.properties" "*.rockspec" "lrexlib/luarocks/*" && mv $(DISTFILE) $(PROJECT) && cd $(PROJECT) && unzip $(DISTFILE) && mv $(PROJECT) $(PROJECT_VERSIONED) && rm -f $(DISTFILE) && zip $(DISTFILE) -r $(PROJECT_VERSIONED) && rm -rf $(PROJECT_VERSIONED) | ||
|
||
WOGER_ARGS = package=$(PROJECT) package_name=$(PROJECT) version=$(VERSION) description="Lua binding for regex libraries" notes=release-notes dist_type="zip" github_user=rrthomas | ||
|
||
release: | ||
release: rockspecs check | ||
agrep -d 'Release' $(VERSION) NEWS | tail -n +3 | head -n -2 > release-notes && \ | ||
git diff --exit-code && \ | ||
git tag -a -m "Release tag" rel-`echo $(VERSION) | sed -e 's/\./-/g'` && \ | ||
git push && git push --tags && \ | ||
woger lua,github package=$(PROJECT) package_name=$(PROJECT) version=$(VERSION) description="Lua binding for regex libraries" notes=release-notes dist_type="zip" github_user=rrthomas | ||
@echo "Don't forget to upload release to github!" | ||
woger github $(WOGER_ARGS) && \ | ||
for i in *.rockspec; do \ | ||
LUAROCKS_CONFIG=luarocks-config.lua luarocks --tree=luarocks build $$i; \ | ||
done && \ | ||
woger lua $(WOGER_ARGS) | ||
rm -f release-notes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
rocks_trees = { | ||
"./luarocks" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
-- Generate the rockspecs | ||
|
||
require "std" | ||
|
||
if select ("#", ...) < 2 then | ||
io.stderr:write "Usage: mkrockspecs VERSION MD5SUM\n" | ||
os.exit () | ||
end | ||
|
||
version = select (1, ...) | ||
md5sum = select (2, ...) | ||
|
||
function format (x, indent) | ||
indent = indent or "" | ||
if type (x) == "table" then | ||
local s = "{\n" | ||
for i, v in pairs (x) do | ||
if type (i) ~= "number" then | ||
s = s..indent..i.." = "..format (v, indent.." ")..",\n" | ||
end | ||
end | ||
for i, v in ipairs (x) do | ||
s = s..indent..format (v, indent.." ")..",\n" | ||
end | ||
return s..indent:sub(1, -3).."}" | ||
elseif type (x) == "string" then | ||
return string.format ("%q", x) | ||
else | ||
return tostring (x) | ||
end | ||
end | ||
|
||
for f, spec in pairs (loadfile ("rockspecs.lua") ()) do | ||
if f ~= "default" then | ||
local specfile = "lrexlib-"..f:lower ().."-"..version.."-1.rockspec" | ||
h = io.open (specfile, "w") | ||
assert (h) | ||
flavour = f -- a global, visible in loadfile | ||
local specs = loadfile ("rockspecs.lua") () -- reload to get current flavour interpolated | ||
local spec = table.merge (specs.default, specs[f]) | ||
local s = "" | ||
for i, v in pairs (spec) do | ||
s = s..i.." = "..format (v, " ").."\n" | ||
end | ||
h:write (s) | ||
h:close () | ||
os.execute ("luarocks lint " .. specfile) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
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 and 5.2, 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 = { | ||
defines = {"VERSION=\""..version.."\""}, | ||
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 = { | ||
defines = {"VERSION=\""..version.."\""}, | ||
sources = {"src/common.c", "src/posix/lposix.c"} | ||
} | ||
} | ||
} | ||
}, | ||
|
||
oniguruma = { | ||
external_dependencies = { | ||
ONIG = { | ||
header = "oniguruma.h", | ||
library = "onig" | ||
} | ||
}, | ||
build = { | ||
type = "builtin", | ||
modules = { | ||
rex_onig = { | ||
defines = {"VERSION=\""..version.."\""}, | ||
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 = { | ||
defines = {"VERSION=\""..version.."\""}, | ||
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_gnu = { | ||
defines = {"VERSION=\""..version.."\""}, | ||
sources = {"src/common.c", "src/gnu/lgnu.c"} | ||
} | ||
} | ||
} | ||
}, | ||
} -- close wrapper table |
Oops, something went wrong.