Fix CFLAGS and test

- Bump PORTREVISION for package change

PR:		230205
Submitted by:	Andrew Gierth <andrew@tao11.riddles.org.uk>
This commit is contained in:
Sunpoet Po-Chuan Hsieh 2018-08-15 19:34:18 +00:00
parent 3370556c8e
commit 415616893a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=477276
2 changed files with 25 additions and 4 deletions

View File

@ -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>

View File

@ -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