aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsunpoet <sunpoet@FreeBSD.org>2018-08-16 03:34:18 +0800
committersunpoet <sunpoet@FreeBSD.org>2018-08-16 03:34:18 +0800
commit39d3801a1a2b89f7e5615b010311fd448123b7ca (patch)
treefb7cb81e1650a0304cbadb18a8f5a056b7123e1d
parent63674b0f419aa69ff61b21a8037f6d1a92b2d0e9 (diff)
downloadfreebsd-ports-gnome-39d3801a1a2b89f7e5615b010311fd448123b7ca.tar.gz
freebsd-ports-gnome-39d3801a1a2b89f7e5615b010311fd448123b7ca.tar.zst
freebsd-ports-gnome-39d3801a1a2b89f7e5615b010311fd448123b7ca.zip
Fix CFLAGS and test
- Bump PORTREVISION for package change PR: 230205 Submitted by: Andrew Gierth <andrew@tao11.riddles.org.uk>
-rw-r--r--devel/lua-bitop/Makefile16
-rw-r--r--devel/lua-bitop/files/extra-patch-bittest.lua13
2 files changed, 25 insertions, 4 deletions
diff --git a/devel/lua-bitop/Makefile b/devel/lua-bitop/Makefile
index f7c2ed257b2e..547e82a7d932 100644
--- a/devel/lua-bitop/Makefile
+++ b/devel/lua-bitop/Makefile
@@ -3,26 +3,34 @@
PORTNAME= bitop
PORTVERSION= 1.0.2
+PORTREVISION= 1
CATEGORIES= devel
MASTER_SITES= http://bitop.luajit.org/download/ \
LOCAL/sunpoet
-DISTNAME= LuaBitOp-${PORTVERSION}
PKGNAMEPREFIX= ${LUA_PKGNAMEPREFIX}
+DISTNAME= LuaBitOp-${PORTVERSION}
MAINTAINER= sunpoet@FreeBSD.org
COMMENT= Bitwise operations on numbers
LICENSE= MIT
-CFLAGS+= -DLUA_NUMBER_LONG_LONG -I${LUA_INCDIR}
+CFLAGS+= -I${LUA_INCDIR}
MAKE_ARGS= CC=${CC} LUA=${LUA_CMD}
TEST_TARGET= test
USES?= gmake lua
-PLIST_FILES= %%LUA_MODLIBDIR%%/bit.so
+PLIST_FILES= ${LUA_MODLIBDIR}/bit.so
+
+.include <bsd.port.pre.mk>
+
+.if ${LUA_VER_STR} >= 53
+CFLAGS+= -DLUA_NUMBER_DOUBLE
+EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-bittest.lua
+.endif
do-install:
${MKDIR} ${STAGEDIR}${LUA_MODLIBDIR}/
${INSTALL_LIB} ${WRKSRC}/bit.so ${STAGEDIR}${LUA_MODLIBDIR}/
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/devel/lua-bitop/files/extra-patch-bittest.lua b/devel/lua-bitop/files/extra-patch-bittest.lua
new file mode 100644
index 000000000000..2014f2eb9016
--- /dev/null
+++ b/devel/lua-bitop/files/extra-patch-bittest.lua
@@ -0,0 +1,13 @@
+--- bittest.lua.orig 2012-05-08 19:15:00 UTC
++++ bittest.lua
+@@ -8,6 +8,10 @@ local vb = {
+ 0x7fffffff, 0x80000000, 0xffffffff
+ }
+
++local function tostring(n)
++ return type(n) == "string" and n or string.format("%.11g", n)
++end
++
+ local function cksum(name, s, r)
+ local z = 0
+ for i=1,#s do z = (z + string.byte(s, i)*i) % 2147483629 end