summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-lua/srlua/files')
-rw-r--r--dev-lua/srlua/files/Makefile4
-rw-r--r--dev-lua/srlua/files/glue14
-rw-r--r--dev-lua/srlua/files/patches/5.3/lua51-compatibility.patch14
3 files changed, 12 insertions, 20 deletions
diff --git a/dev-lua/srlua/files/Makefile b/dev-lua/srlua/files/Makefile
new file mode 100644
index 0000000..0b9fefb
--- /dev/null
+++ b/dev-lua/srlua/files/Makefile
@@ -0,0 +1,4 @@
+all:
+ $(CC) $(CFLAGS) -o glue srglue.c
+ $(CC) $(CFLAGS) -o srlua srlua.c -Wl,-E $(STATIC) -ldl $(LUA_LINK_LIB)
+
diff --git a/dev-lua/srlua/files/glue b/dev-lua/srlua/files/glue
index b459ade..4768bbc 100644
--- a/dev-lua/srlua/files/glue
+++ b/dev-lua/srlua/files/glue
@@ -20,7 +20,7 @@ end
local function getabis(abi)
local ret={}
local abistr
- local abi=abi or ""
+ local abi=abi or "*"
local arch
if abi=="default" then
@@ -32,12 +32,12 @@ local function getabis(abi)
end
end
- abistr=(io.popen("cd "..libexec.." 2>/dev/null; echo srlua."..abi.."*"):read() or "")
+ abistr=(io.popen(("echo %s/%s/srlua*"):format(libexec,abi)):read() or "")
if abistr:match("%*") then abistr="" end -- failed matching -> nothing found
if #abistr>8 then
- for abi in abistr:gmatch("srlua.(%S*)") do
+ for abi in abistr:gmatch(libexec.."/(%S*)/srlua") do
table.insert(ret,abi)
end
end
@@ -51,7 +51,7 @@ local function help(err,msg)
p""
end
p"Description:"
- p"This is a wrapper on original `glue` program from `srlua` package"
+ p"This is a wrapper on original `srglue` program from `srlua` package"
p"The only difference is that you should pass 'ABI' string instead of path to `srlua`"
p""
p"Usage:"
@@ -92,7 +92,7 @@ local function argparse(argv)
if #abi==0 then
help(true,"There is no such ABI that you specified.")
elseif #abi>1 then
- help(true,"Multiple ABIs matched your ABI selection. Please, be more specific.")
+ help(true,("Multiple ABIs (%d) matched your ABI selection. Please, be more specific."):format(#abi))
--local interpreter, multilib = k:match("(%S*)%.(%w-)$")
else
abi=abi[1]
@@ -106,7 +106,9 @@ local function argparse(argv)
chmod="chmod" -- TODO: setfacl support
chmod_mod="755"
- os.exit(os.execute(libexec.."/glue "..libexec.."/srlua."..abi.." "..script.." "..out.." && "..chmod.." "..chmod_mod.." "..out))
+ local abidir=libexec.."/"..abi
+
+ os.exit(os.execute(("%s/glue %s/srlua %s %s && %s %s %s"):format(abidir,abidir,script,out,chmod,chmod_mod,out)))
end
if #arg>3 or #arg==0 then
diff --git a/dev-lua/srlua/files/patches/5.3/lua51-compatibility.patch b/dev-lua/srlua/files/patches/5.3/lua51-compatibility.patch
deleted file mode 100644
index dda7663..0000000
--- a/dev-lua/srlua/files/patches/5.3/lua51-compatibility.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/srlua.c 2017-04-09 16:28:56.780761259 +0700
-+++ b/srlua.c 2017-04-09 16:34:40.159417660 +0700
-@@ -28,6 +28,10 @@
- #define getprogname()
- #endif
-
-+#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
-+#define lua_load(L,reader,dt,chunkname,mode) lua_load(L,reader,dt,chunkname)
-+#endif
-+
- typedef struct
- {
- FILE *f;
-