aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--databases/tokyotyrant/Makefile17
-rw-r--r--databases/tokyotyrant/files/patch-scrext.c16
2 files changed, 23 insertions, 10 deletions
diff --git a/databases/tokyotyrant/Makefile b/databases/tokyotyrant/Makefile
index 78ab05b6a1f5..5340d604f7e7 100644
--- a/databases/tokyotyrant/Makefile
+++ b/databases/tokyotyrant/Makefile
@@ -3,6 +3,7 @@
PORTNAME= tokyotyrant
PORTVERSION= 1.1.41
+PORTREVISION= 1
CATEGORIES= databases
MASTER_SITES= http://fallabs.com/${PORTNAME}/
@@ -22,21 +23,17 @@ OPTIONS_DEFINE= LUA
LDFLAGS+= -L${LOCALBASE}/lib
CFLAGS+= -I${LOCALBASE}/include
-.include <bsd.port.options.mk>
-
-.if ${PORT_OPTIONS:MLUA}
-CONFIGURE_ARGS+= --enable-lua
-LDFLAGS+= -L${LUA_LIBDIR}
-CFLAGS+= -I${LUA_INCDIR}
-USE_LUA= yes
-.else
-CONFIGURE_ARGS+= --disable-lua
-.endif
+LUA_CONFIGURE_ENABLE= lua
+LUA_LDFLAGS+= -L${LUA_LIBDIR}
+LUA_CFLAGS+= -I${LUA_INCDIR}
+LUA_CPPFLAGS+= -I${LUA_INCDIR}
+LUA_USES= lua
# Since gnomehack only works for "(libdir)" case, we need to patch it
# manually.
post-patch:
${REINPLACE_CMD} -e 's|@libdir@/pkgconfig|@prefix@/libdata/pkgconfig|g' \
${WRKSRC}/Makefile.in
+ ${REINPLACE_CMD} -e 's|llua|llua-${LUA_VER}|g' ${WRKSRC}/configure
.include <bsd.port.mk>
diff --git a/databases/tokyotyrant/files/patch-scrext.c b/databases/tokyotyrant/files/patch-scrext.c
new file mode 100644
index 000000000000..1a0d19c3df8e
--- /dev/null
+++ b/databases/tokyotyrant/files/patch-scrext.c
@@ -0,0 +1,16 @@
+--- ./scrext.c.orig 2010-08-05 08:24:33.000000000 +0200
++++ ./scrext.c 2014-04-21 21:45:57.464501296 +0200
+@@ -153,6 +153,13 @@
+ #include "lualib.h"
+ #include "lauxlib.h"
+
++#ifdef LUA_VERSION_NUM
++# if (LUA_VERSION_NUM >= 502)
++#undef lua_objlen
++#define lua_objlen lua_rawlen
++# endif
++#endif
++
+ #define SERVVAR "_serv_" // global variable name for server resources
+ #define ITERVAR "_iter_" // global variable name for iterator
+ #define MRMAPVAR "_mrmap_" // global variable name for mapreduce mapper