sm-commit AT lists.ibiblio.org
Subject: Source Mage code commit list
List archive
[SM-Commit] GIT changes to master grimoire by Vlad Glagolev (8850e13144debf54fabcef54b7fd90ddd373c880)
- From: Vlad Glagolev <scm AT sourcemage.org>
- To: sm-commit AT lists.ibiblio.org
- Subject: [SM-Commit] GIT changes to master grimoire by Vlad Glagolev (8850e13144debf54fabcef54b7fd90ddd373c880)
- Date: Sun, 3 Aug 2014 15:52:46 -0500
GIT changes to master grimoire by Vlad Glagolev <stealth AT sourcemage.org>:
http/lighttpd/DEPENDS | 2 -
http/lighttpd/HISTORY | 5 +++
http/lighttpd/PRE_BUILD | 2 +
http/lighttpd/lua52.patch | 75
++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 83 insertions(+), 1 deletion(-)
New commits:
commit 8850e13144debf54fabcef54b7fd90ddd373c880
Author: Vlad Glagolev <stealth AT sourcemage.org>
Commit: Vlad Glagolev <stealth AT sourcemage.org>
lighttpd: added Lua 5.2 support
diff --git a/http/lighttpd/DEPENDS b/http/lighttpd/DEPENDS
index 89e7abd..96e7281 100755
--- a/http/lighttpd/DEPENDS
+++ b/http/lighttpd/DEPENDS
@@ -22,7 +22,7 @@ optional_depends gdbm \
optional_depends FAM \
'--with-fam' '--without-fam' \
'to reduce number of stat() calls' &&
-optional_depends lua51 \
+optional_depends LUA \
'--with-lua' '--without-lua' \
'lua engine for mod_cml' &&
optional_depends libmemcache \
diff --git a/http/lighttpd/HISTORY b/http/lighttpd/HISTORY
index fba5fd5..4a960a1 100644
--- a/http/lighttpd/HISTORY
+++ b/http/lighttpd/HISTORY
@@ -1,3 +1,8 @@
+2014-08-03 Vlad Glagolev <stealth AT sourcemage.org>
+ * PRE_BUILD: apply patch
+ * DEPENDS: lua51 -> LUA
+ * lua52.patch: added, to support both lua 5.1 and 5.2
+
2014-07-01 Vlad Glagolev <stealth AT sourcemage.org>
* DEPENDS: added libev optional dependency
diff --git a/http/lighttpd/PRE_BUILD b/http/lighttpd/PRE_BUILD
index 264cfb4..829cec6 100755
--- a/http/lighttpd/PRE_BUILD
+++ b/http/lighttpd/PRE_BUILD
@@ -1,6 +1,8 @@
default_pre_build &&
cd "$SOURCE_DIRECTORY" &&
+patch -p0 < "$SPELL_DIRECTORY/lua52.patch" &&
+
if [[ $LIGHTTPD_EXTAUTH == y ]]; then
patch -p0 < "$SPELL_DIRECTORY/external_auth_program-1.4.25.patch"
fi &&
diff --git a/http/lighttpd/lua52.patch b/http/lighttpd/lua52.patch
new file mode 100644
index 0000000..7d4913e
--- /dev/null
+++ b/http/lighttpd/lua52.patch
@@ -0,0 +1,75 @@
+--- src/mod_cml_lua.c.orig 2012-10-22 06:17:17.418886286 -0700
++++ src/mod_cml_lua.c 2012-10-22 06:25:50.289753316 -0700
+@@ -28,6 +28,10 @@
+ #include <lualib.h>
+ #include <lauxlib.h>
+
++#if LUA_VERSION_NUM >= 502
++#define LUA_GLOBALSINDEX LUA_REGISTRYINDEX
++#endif
++
+ typedef struct {
+ stream st;
+ int done;
+@@ -285,7 +285,11 @@
+ lua_settable(L, LUA_GLOBALSINDEX);
+
+ /* load lua program */
++#if LUA_VERSION_NUM >= 502
++ if (lua_load(L, load_file, &rm, fn->ptr, NULL) || lua_pcall(L,0,1,0))
{
++#else
+ if (lua_load(L, load_file, &rm, fn->ptr) || lua_pcall(L,0,1,0)) {
++#endif
+ log_error_write(srv, __FILE__, __LINE__, "s",
+ lua_tostring(L,-1));
+
+--- src/mod_magnet.c.orig 2014-03-06 18:08:00.000000000 +0400
++++ src/mod_magnet.c 2014-08-04 00:28:43.515720829 +0400
+@@ -24,6 +24,10 @@
+ #define MAGNET_CONFIG_PHYSICAL_PATH "magnet.attract-physical-path-to"
+ #define MAGNET_RESTART_REQUEST 99
+
++#if LUA_VERSION_NUM >= 502
++#define LUA_GLOBALSINDEX LUA_REGISTRYINDEX
++#endif
++
+ /* plugin config for all request/connections */
+
+ static jmp_buf exceptionjmp;
+@@ -691,7 +695,11 @@
+ * get the environment of the function
+ */
+
++#if LUA_VERSION_NUM >= 502
++ lua_getupvalue(L, -1, 1); /* -1 is the function, _ENV is the first
upvalue of a chunk */
++#else
+ lua_getfenv(L, -1); /* -1 is the function */
++#endif
+
+ /* lighty.header */
+
+@@ -741,7 +749,11 @@
+ */
+
+ force_assert(lua_isfunction(L, -1));
++#if LUA_VERSION_NUM >= 502
++ lua_getupvalue(L, -1, 1); /* -1 is the function, _ENV is the first
upvalue of a chunk */
++#else
+ lua_getfenv(L, -1); /* -1 is the function */
++#endif
+
+ lua_getfield(L, -1, "lighty"); /* lighty.* from the env */
+ force_assert(lua_istable(L, -1));
+@@ -990,8 +1002,11 @@
+ lua_setfield(L, -2, "__index"); /* { __index = _G } (sp -=
1) */
+ lua_setmetatable(L, -2); /* setmetatable({}, {__index = _G}) (sp -=
1) */
+
+-
++#if LUA_VERSION_NUM >= 502
++ lua_setupvalue(L, -2, 1); /* on the stack should be a modified env
(sp -= 1), _ENV is the first upvalue of a chunk */
++#else
+ lua_setfenv(L, -2); /* on the stack should be a modified env (sp -=
1) */
++#endif
+
+ errfunc = push_traceback(L, 0);
+ if (lua_pcall(L, 0, 1, errfunc)) {
- [SM-Commit] GIT changes to master grimoire by Vlad Glagolev (8850e13144debf54fabcef54b7fd90ddd373c880), Vlad Glagolev, 08/03/2014
Archive powered by MHonArc 2.6.24.