summaryrefslogtreecommitdiffstats
path: root/main/lua-pc/lpc-lua5.2-compat.patch
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2014-05-10 14:07:26 +0300
committerTimo Teräs <timo.teras@iki.fi>2014-05-10 14:07:26 +0300
commit664ab287e76baeccff5ab7c556a477f08a42fec4 (patch)
tree451e8efe5177a7cfced6b512584d965d102fb84e /main/lua-pc/lpc-lua5.2-compat.patch
parent6fbca72d680bb7ce7bccb41c86becf1762b042c1 (diff)
downloadaports-664ab287e76baeccff5ab7c556a477f08a42fec4.tar.bz2
aports-664ab287e76baeccff5ab7c556a477f08a42fec4.tar.xz
main/lua-pc: build for lua5.1 and lua5.2
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 000000000..17a9aaab4
--- /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},