Lines 2-14
Link Here
|
2 |
# $FreeBSD: head/devel/lua-alien/Makefile 351614 2014-04-20 09:21:20Z bapt $ |
2 |
# $FreeBSD: head/devel/lua-alien/Makefile 351614 2014-04-20 09:21:20Z bapt $ |
3 |
|
3 |
|
4 |
PORTNAME= alien |
4 |
PORTNAME= alien |
5 |
PORTVERSION= 0.5.1 |
5 |
PORTVERSION= 0.7.0 |
6 |
PORTREVISION= 1 |
|
|
7 |
CATEGORIES= devel |
6 |
CATEGORIES= devel |
8 |
MASTER_SITES= http://nodeload.github.com/mascarenhas/alien/tarball/ |
7 |
MASTER_SITES= GHC |
9 |
PKGNAMEPREFIX= ${LUA_PKGNAMEPREFIX} |
8 |
PKGNAMEPREFIX= ${LUA_PKGNAMEPREFIX} |
10 |
DISTFILES= ${DISTVERSION} |
|
|
11 |
DIST_SUBDIR= lua-${PORTNAME} |
12 |
|
9 |
|
13 |
MAINTAINER= ports@FreeBSD.org |
10 |
MAINTAINER= ports@FreeBSD.org |
14 |
COMMENT= Lua -> C FFI |
11 |
COMMENT= Lua -> C FFI |
Lines 17-76
Link Here
|
17 |
|
14 |
|
18 |
LIB_DEPENDS= libffi.so:${PORTSDIR}/devel/libffi |
15 |
LIB_DEPENDS= libffi.so:${PORTSDIR}/devel/libffi |
19 |
|
16 |
|
20 |
USES= lua |
17 |
WRKSRC= ${WRKDIR}/${DISTNAME} |
21 |
|
18 |
|
22 |
WRKSRC= ${WRKDIR}/${GITHUB_USER}-${PORTNAME}-${GITHUB_SRC_SUFX} |
19 |
USE_GITHUB= yes |
23 |
CFLAGS+= -I${LOCALBASE}/include -I${LUA_INCDIR} \ |
20 |
GH_ACCOUNT= mascarenhas |
24 |
-DBSD -fPIC |
21 |
|
25 |
LDFLAGS+= -L${LOCALBASE}/lib -L${LUA_LIBDIR} -llua-${LUA_VER} -shared |
22 |
USES= libtool shebangfix zip |
26 |
MAKE_ENV+= LIB_OPTION="${LDFLAGS}" LIB_EXT=".so" LUA="${LUA_CMD}" |
23 |
SHEBANG_FILES= src/constants |
27 |
TESTS_EXCLUDE= tests/alien tests/alien.lua |
24 |
SHEBANG_LANG= lua |
28 |
|
25 |
lua_OLD_CMD= /usr/bin/env lua |
29 |
GITHUB_USER= mascarenhas |
26 |
lua_CMD= ${LUA_CMD} |
30 |
GITHUB_SRC_SUFX=e667d5d |
27 |
USE_LUA= 5.1 |
31 |
|
28 |
GNU_CONFIGURE= yes |
32 |
.if ${CFLAGS:M-fstack-prot*} |
29 |
CONFIGURE_ARGS= --disable-silent-rules \ |
33 |
MAKE_ENV+= __MAKE_CONF= # inherit CFLAGS only once |
30 |
--libdir=${LUA_MODLIBDIR} \ |
34 |
CFLAGS+= -fno-stack-protector |
31 |
--datadir=${LUA_MODSHAREDIR} \ |
35 |
.endif |
32 |
--with-lua-suffix="-${LUA_VER}" |
36 |
|
33 |
INSTALL_TARGET= install-strip |
37 |
# add lua prefix to directories |
34 |
|
38 |
.for p in data: docs:doc/ examples:examples/ |
35 |
CPPFLAGS+= -I${LUA_INCDIR} -I${LOCALBASE}/include -DBSD |
39 |
${p:C/:.*//:U}DIR_REL= share/${p:C/.*://}${LUA_PKGNAMEPREFIX}${PORTNAME} |
36 |
LDFLAGS+= -L${LUA_LIBDIR} -L${LOCALBASE}/lib |
40 |
${p:C/:.*//:U}DIR= ${PREFIX}/${${p:C/:.*//:U}DIR_REL} |
37 |
|
41 |
.endfor |
38 |
DOCSDIR= ${PREFIX}/share/doc/lua-${PORTNAME} |
42 |
|
39 |
EXAMPLESDIR= ${PREFIX}/share/examples/lua-${PORTNAME} |
43 |
OPTIONS_DEFINE= DOCS EXAMPLES |
40 |
|
44 |
|
41 |
post-patch: |
45 |
post-extract: .SILENT |
42 |
@${REINPLACE_CMD} -e \ |
46 |
${RM} -rf ${WRKSRC}/libffi |
43 |
'/^install-data-am:/s|install-dist_docDATA.*|| ; \ |
47 |
${FIND} ${WRKSRC} -type f -name .git-darcs-dir -delete |
44 |
/^[[:cntrl:]]/s|install-dist_samplesDATA$$||' \ |
48 |
|
45 |
${WRKSRC}/Makefile.in |
49 |
post-patch: .SILENT |
46 |
@${REINPLACE_CMD} -e \ |
50 |
${REINPLACE_CMD} '1s|.*|#! ${LUA_CMD}|' ${WRKSRC}/src/constants |
47 |
's|/usr/lib|${LOCALBASE}/lib| ; \ |
51 |
${REINPLACE_CMD} -i '' \ |
48 |
/luarocks/d' ${WRKSRC}/samples/*.lua |
52 |
-e 's|/usr/lib|${PREFIX}/lib|' \ |
49 |
|
53 |
-e '/luarocks/d' \ |
50 |
post-install: |
54 |
${WRKSRC}/samples/*.lua ${WRKSRC}/tests/*.lua |
|
|
55 |
|
56 |
do-install: |
57 |
@${MKDIR} ${STAGEDIR}${LUA_MODLIBDIR}/${PORTNAME} |
58 |
(cd ${WRKSRC}/src/alien && ${INSTALL_LIB} core.so struct.so \ |
59 |
${STAGEDIR}${LUA_MODLIBDIR}/${PORTNAME}) |
60 |
@${MKDIR} ${STAGEDIR}${LUA_MODSHAREDIR} |
61 |
${INSTALL_DATA} ${WRKSRC}/src/alien.lua ${STAGEDIR}${LUA_MODSHAREDIR} |
62 |
@${MKDIR} ${STAGEDIR}${DATADIR} |
63 |
${INSTALL_SCRIPT} ${WRKSRC}/src/constants ${STAGEDIR}${DATADIR} |
64 |
${TAR} cf - -C${WRKSRC} ${TESTS_EXCLUDE:S,^,--exclude ,} tests \ |
65 |
| ${TAR} xof - -C${STAGEDIR}${DATADIR} |
66 |
@${MKDIR} ${STAGEDIR}${DOCSDIR} |
51 |
@${MKDIR} ${STAGEDIR}${DOCSDIR} |
67 |
(cd ${WRKSRC}/doc && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}) |
52 |
(cd ${WRKSRC}/doc && ${INSTALL_DATA} alien.* \ |
|
|
53 |
${STAGEDIR}${DOCSDIR}) |
68 |
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR} |
54 |
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR} |
69 |
(cd ${WRKSRC}/samples && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR}) |
55 |
(cd ${WRKSRC}/samples && ${INSTALL_DATA} *.lua \ |
70 |
|
56 |
${STAGEDIR}${EXAMPLESDIR}) |
71 |
regression-test: build |
|
|
72 |
${LN} -fs ${TESTS_EXCLUDE:S,tests/,../src/,} ${WRKSRC}/tests |
73 |
cd ${WRKSRC}/tests && ${LUA_CMD} test_alien.lua |
74 |
${RM} -f ${TESTS_EXCLUDE:S,^,${WRKSRC}/,} |
75 |
|
57 |
|
76 |
.include <bsd.port.mk> |
58 |
.include <bsd.port.mk> |