aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-pc/lpc-lua5.2-compat.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/lua-pc/lpc-lua5.2-compat.patch')
-rw-r--r--main/lua-pc/lpc-lua5.2-compat.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/main/lua-pc/lpc-lua5.2-compat.patch b/main/lua-pc/lpc-lua5.2-compat.patch
new file mode 100644
index 0000000000..17a9aaab4b
--- /dev/null
+++ b/main/lua-pc/lpc-lua5.2-compat.patch
@@ -0,0 +1,41 @@
+diff -ru lpc-1.0.0.orig/Makefile lpc-1.0.0/Makefile
+--- lpc-1.0.0.orig/Makefile 2012-08-21 17:39:10.000000000 -0300
++++ lpc-1.0.0/Makefile 2014-05-10 13:52:18.833865486 -0300
+@@ -1,16 +1,20 @@
+-LUA_PREFIX = /usr/local/
+-PREFIX = /usr/local/
++LUA_PKGCONF ?= lua
++
+ MODULE = lpc
+ VERSION = 1.0.0
+
+-INSTALL_PREFIX = $(PREFIX)/lib/lua/5.1/
++ifneq ($(shell pkg-config $(LUA_PKGCONF) || echo not-installed),)
++$(error $(LUA_PKGCONF).pc not found)
++endif
++
++INSTALL_PREFIX = $(PREFIX)$(shell pkg-config $(LUA_PKGCONF) --variable=INSTALL_CMOD)
+
+ CC = gcc
+ TARGET = lpc.so
+ OBJS = lpc.o
+ LIBS =
+-CFLAGS = -I $(LUA_PREFIX)/include -fPIC
+-LDFLAGS = -shared -fPIC
++CFLAGS = $(shell pkg-config $(LUA_PKGCONF) --cflags) -fPIC
++LDFLAGS = $(shell pkg-config $(LUA_PKGCONF) --libs) -shared -fPIC
+
+ default: $(TARGET)
+
+diff -ru lpc-1.0.0.orig/lpc.c lpc-1.0.0/lpc.c
+--- lpc-1.0.0.orig/lpc.c 2012-08-21 17:39:10.000000000 -0300
++++ lpc-1.0.0/lpc.c 2014-05-10 13:51:01.740949801 -0300
+@@ -192,7 +192,7 @@
+ lua_settable (L, -3);
+ }
+
+-static const struct luaL_reg lpclib[] =
++static const struct luaL_Reg lpclib[] =
+ {
+ {"run", lpc_run},
+ {"wait", lpc_wait},