summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim A. Misbakh-Soloviov <git@mva.name>2017-05-10 20:01:15 +0700
committerVadim A. Misbakh-Soloviov <git@mva.name>2017-05-10 20:01:15 +0700
commite964f2cd72345c9059ea8612955e95eb7c9a5d38 (patch)
treee059048d5b87ffab2abaed68e42a4303790df456 /dev-lua
parentlunix: fix (diff)
downloadlua-e964f2cd72345c9059ea8612955e95eb7c9a5d38.tar.gz
lua-e964f2cd72345c9059ea8612955e95eb7c9a5d38.tar.bz2
lua-e964f2cd72345c9059ea8612955e95eb7c9a5d38.zip
spawn: fix
Diffstat (limited to 'dev-lua')
-rw-r--r--dev-lua/spawn/files/patches/9999/compat53-luajit21.patch111
-rw-r--r--dev-lua/spawn/spawn-9999.ebuild15
2 files changed, 123 insertions, 3 deletions
diff --git a/dev-lua/spawn/files/patches/9999/compat53-luajit21.patch b/dev-lua/spawn/files/patches/9999/compat53-luajit21.patch
new file mode 100644
index 0000000..7b35a62
--- /dev/null
+++ b/dev-lua/spawn/files/patches/9999/compat53-luajit21.patch
@@ -0,0 +1,111 @@
+--- a/vendor/compat-5.3/c-api/compat-5.3.h 2017-05-10 19:43:02.701992608 +0700
++++ b/vendor/compat-5.3/c-api/compat-5.3.h 2017-05-10 19:42:51.026426540 +0700
+@@ -95,8 +95,10 @@
+ #define lua_compare COMPAT53_CONCAT(COMPAT53_PREFIX, _compare)
+ COMPAT53_API int lua_compare (lua_State *L, int idx1, int idx2, int op);
+
++#ifndef COMPAT53_IS_LUAJIT
+ #define lua_copy COMPAT53_CONCAT(COMPAT53_PREFIX, _copy)
+ COMPAT53_API void lua_copy (lua_State *L, int from, int to);
++#endif
+
+ #define lua_getuservalue(L, i) \
+ (lua_getfenv(L, i), lua_type(L, -1))
+@@ -106,10 +108,12 @@
+ #define lua_len COMPAT53_CONCAT(COMPAT53_PREFIX, _len)
+ COMPAT53_API void lua_len (lua_State *L, int i);
+
++#ifndef COMPAT53_IS_LUAJIT
+ #define luaL_newlibtable(L, l) \
+ (lua_createtable(L, 0, sizeof(l)/sizeof(*(l))-1))
+ #define luaL_newlib(L, l) \
+ (luaL_newlibtable(L, l), luaL_register(L, NULL, l))
++#endif
+
+ #define lua_pushglobaltable(L) \
+ lua_pushvalue(L, LUA_GLOBALSINDEX)
+@@ -122,11 +126,13 @@
+
+ #define lua_rawlen(L, i) lua_objlen(L, i)
+
++#ifndef COMPAT53_IS_LUAJIT
+ #define lua_tointegerx COMPAT53_CONCAT(COMPAT53_PREFIX, _tointegerx)
+ COMPAT53_API lua_Integer lua_tointegerx (lua_State *L, int i, int *isnum);
+
+ #define lua_tonumberx COMPAT53_CONCAT(COMPAT53_PREFIX, _tonumberx)
+ COMPAT53_API lua_Number lua_tonumberx (lua_State *L, int i, int *isnum);
++#endif
+
+ #define luaL_checkversion COMPAT53_CONCAT(COMPAT53_PREFIX, L_checkversion)
+ COMPAT53_API void luaL_checkversion (lua_State *L);
+@@ -140,6 +146,7 @@
+ #define luaL_len COMPAT53_CONCAT(COMPAT53_PREFIX, L_len)
+ COMPAT53_API int luaL_len (lua_State *L, int i);
+
++#ifndef COMPAT53_IS_LUAJIT
+ #define luaL_setfuncs COMPAT53_CONCAT(COMPAT53_PREFIX, L_setfuncs)
+ COMPAT53_API void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup);
+
+@@ -148,6 +155,7 @@
+
+ #define luaL_testudata COMPAT53_CONCAT(COMPAT53_PREFIX, L_testudata)
+ COMPAT53_API void *luaL_testudata (lua_State *L, int i, const char *tname);
++#endif
+
+ #define luaL_tolstring COMPAT53_CONCAT(COMPAT53_PREFIX, L_tolstring)
+ COMPAT53_API const char *luaL_tolstring (lua_State *L, int idx, size_t *len);
+--- a/vendor/compat-5.3/c-api/compat-5.3.c 2017-05-10 19:58:14.246778970 +0700
++++ b/vendor/compat-5.3/c-api/compat-5.3.c 2017-05-10 19:58:07.354038934 +0700
+@@ -89,14 +89,14 @@
+ return 0;
+ }
+
+-
++#ifndef COMPAT53_IS_LUAJIT
+ COMPAT53_API void lua_copy (lua_State *L, int from, int to) {
+ int abs_to = lua_absindex(L, to);
+ luaL_checkstack(L, 1, "not enough stack slots");
+ lua_pushvalue(L, from);
+ lua_replace(L, abs_to);
+ }
+-
++#endif
+
+ COMPAT53_API void lua_len (lua_State *L, int i) {
+ switch (lua_type(L, i)) {
+@@ -131,7 +131,7 @@
+ lua_rawset(L, abs_i);
+ }
+
+-
++#ifndef COMPAT53_IS_LUAJIT
+ COMPAT53_API lua_Integer lua_tointegerx (lua_State *L, int i, int *isnum) {
+ lua_Integer n = lua_tointeger(L, i);
+ if (isnum != NULL) {
+@@ -148,6 +147,7 @@
+ }
+ return n;
+ }
++#endif
+
+
+ COMPAT53_API void luaL_checkversion (lua_State *L) {
+@@ -194,7 +194,7 @@
+ return res;
+ }
+
+-
++#ifndef COMPAT53_IS_LUAJIT
+ COMPAT53_API void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup) {
+ luaL_checkstack(L, nup+1, "too many upvalues");
+ for (; l->name != NULL; l++) { /* fill the table with given functions */
+@@ -231,7 +231,7 @@
+ }
+ return p;
+ }
+-
++#endif
+
+ COMPAT53_API const char *luaL_tolstring (lua_State *L, int idx, size_t *len) {
+ if (!luaL_callmeta(L, idx, "__tostring")) {
+
diff --git a/dev-lua/spawn/spawn-9999.ebuild b/dev-lua/spawn/spawn-9999.ebuild
index 7a84470..e4bacee 100644
--- a/dev-lua/spawn/spawn-9999.ebuild
+++ b/dev-lua/spawn/spawn-9999.ebuild
@@ -20,18 +20,27 @@ IUSE="examples"
EXAMPLES=(spec/.)
+DEPEND="
+ dev-lua/lunix
+"
+RDEPEND="
+ ${RDEPEND}
+"
+
+PATCHES=("${FILESDIR}/patches/${PV}")
+
all_lua_prepare() {
- mv "${PN}/init.lua" "${PN}.lua"
+ mv "${PN}/posix.c" "${S}"
lua_default
}
each_lua_compile() {
_lua_setFLAGS
- ${CC} ${CFLAGS} ${LDFLAGS} -I./vendor/compat-5.3/c-api/ -I$(lua_get_incdir) ${PN}/kill.c ${PN}/posix.c ${PN}/sigset.c ${PN}/wait.c -o ${PN}.so
+ ${CC} ${CFLAGS} ${LDFLAGS} -I./vendor/compat-5.3/c-api/ -I$(lua_get_incdir) posix.c -o ${PN}.so
}
each_lua_install() {
- dolua "${PN}.lua"
+ dolua "${PN}"
dolua "${PN}.so"
}