freebsd-ports/devel/lua-alien/Makefile
Philip M. Gollucci 760241cd8f - remove symlink even if regression-test target fails
DATADIR/tests/alien
	DATADIR/tests/alien.lua
- Split regression-test into smaller chunks

PR:             ports/151539
Submitted by:   swell.k@gmail.com (maintainer)
2010-10-19 00:15:33 +00:00

72 lines
2 KiB
Makefile

# New ports collection makefile for: lua-alien
# Date created: 24 Aug 2010
# Whom: Anonymous
#
# $FreeBSD$
#
PORTNAME= alien
PORTVERSION= 0.5.0
CATEGORIES= devel
MASTER_SITES= http://alien.luaforge.net/
PKGNAMEPREFIX= ${LUA_PKGNAMEPREFIX}
MAINTAINER= swell.k@gmail.com
COMMENT= Lua -> C FFI
LIB_DEPENDS= ffi.5:${PORTSDIR}/devel/libffi
LICENSE= MIT
USE_LUA= 5.1
CFLAGS+= -I${LOCALBASE}/include -I${LUA_INCDIR} \
-DBSD -fPIC #-fno-stack-protector
LDFLAGS+= -L${LOCALBASE}/lib -L${LUA_LIBDIR} -llua -shared
MAKE_ENV+= LIB_OPTION="${LDFLAGS}" LIB_EXT=".so" LUA="${LUA_CMD}"
TESTS_EXCLUDE= tests/alien tests/alien.lua
# add lua prefix to directories
.for p in data: docs:doc/ examples:examples/
${p:C/:.*//:U}DIR_REL= share/${p:C/.*://}${LUA_PKGNAMEPREFIX}${PORTNAME}
${p:C/:.*//:U}DIR= ${PREFIX}/${${p:C/:.*//:U}DIR_REL}
.endfor
post-extract: .SILENT
${RM} -rf ${WRKSRC}/libffi
${FIND} ${WRKSRC} -type f -name .git-darcs-dir -delete
post-patch: .SILENT
${REINPLACE_CMD} '1s|.*|#! ${LUA_CMD}|' ${WRKSRC}/src/constants
${REINPLACE_CMD} -i '' \
-e 's|/usr/lib|${PREFIX}/lib|' \
-e '/luarocks/d' \
${WRKSRC}/samples/*.lua ${WRKSRC}/tests/*.lua
do-install:
${MKDIR} ${LUA_MODLIBDIR}/${PORTNAME}
.for f in core.so struct.so
${INSTALL_PROGRAM} ${WRKSRC}/src/alien/${f} \
${LUA_MODLIBDIR}/${PORTNAME}
.endfor
${INSTALL_DATA} ${WRKSRC}/src/alien.lua ${LUA_MODSHAREDIR}
.if !defined(NOPORTDATA)
${MKDIR} ${DATADIR}
${INSTALL_SCRIPT} ${WRKSRC}/src/constants ${DATADIR}
${TAR} cf - -C${WRKSRC} ${TESTS_EXCLUDE:S,^,--exclude ,} tests \
| ${TAR} xof - -C${DATADIR}
.endif
.if !defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR}
${TAR} cf - -C${WRKSRC}/doc . | ${TAR} xof - -C${DOCSDIR}
.endif
.if !defined(NOPORTEXAMPLES)
${MKDIR} ${EXAMPLESDIR}
${TAR} cf - -C${WRKSRC}/samples . | ${TAR} xof - -C${EXAMPLESDIR}
.endif
regression-test: build
${LN} -fs ${TESTS_EXCLUDE:S,tests/,../src/,} ${WRKSRC}/tests
cd ${WRKSRC}/tests && ${LUA_CMD} test_alien.lua
${RM} -f ${TESTS_EXCLUDE:S,^,${WRKSRC}/,}
.include <bsd.port.mk>