View | Details | Raw Unified | Return to bug 187972 | Differences between
and this patch

Collapse All | Expand All

(-)devel/lua-alien/Makefile (-55 / +37 lines)
Lines 2-13 Link Here
2
# $FreeBSD: head/devel/lua-alien/Makefile 349823 2014-04-01 08:10:51Z pawel $
2
# $FreeBSD: head/devel/lua-alien/Makefile 349823 2014-04-01 08:10:51Z pawel $
3
3
4
PORTNAME=	alien
4
PORTNAME=	alien
5
PORTVERSION=	0.5.1
5
PORTVERSION=	0.7.0
6
CATEGORIES=	devel
6
CATEGORIES=	devel
7
MASTER_SITES=	http://nodeload.github.com/mascarenhas/alien/tarball/
7
MASTER_SITES=	GHC
8
PKGNAMEPREFIX=	${LUA_PKGNAMEPREFIX}
8
PKGNAMEPREFIX=	${LUA_PKGNAMEPREFIX}
9
DISTFILES=	${DISTVERSION}
10
DIST_SUBDIR=	lua-${PORTNAME}
11
9
12
MAINTAINER=	ports@FreeBSD.org
10
MAINTAINER=	ports@FreeBSD.org
13
COMMENT=	Lua -> C FFI
11
COMMENT=	Lua -> C FFI
Lines 16-75 Link Here
16
14
17
LIB_DEPENDS=	libffi.so:${PORTSDIR}/devel/libffi
15
LIB_DEPENDS=	libffi.so:${PORTSDIR}/devel/libffi
18
16
17
WRKSRC=		${WRKDIR}/${DISTNAME}
18
19
USE_GITHUB=	yes
20
GH_ACCOUNT=	mascarenhas
21
22
USES=		shebangfix zip
23
SHEBANG_FILES=	src/constants
24
SHEBANG_LANG=	lua
25
lua_OLD_CMD=	/usr/bin/env lua
26
lua_CMD=	${LUA_CMD}
19
USE_LUA=	5.1
27
USE_LUA=	5.1
28
GNU_CONFIGURE=	yes
29
CONFIGURE_ARGS=	--disable-silent-rules \
30
		--libdir=${LUA_MODLIBDIR} \
31
		--datadir=${LUA_MODSHAREDIR} \
32
		--with-lua-suffix="-${LUA_VER}"
33
34
CPPFLAGS+=	-I${LUA_INCDIR} -I${LOCALBASE}/include -DBSD
35
LDFLAGS+=	-L${LUA_LIBDIR} -L${LOCALBASE}/lib
36
37
DOCSDIR=	${PREFIX}/share/doc/lua-${PORTNAME}
38
EXAMPLESDIR=	${PREFIX}/share/examples/lua-${PORTNAME}
39
40
post-patch:
41
	@${REINPLACE_CMD} -e \
42
		'/^install-data-am:/s|install-dist_docDATA.*|| ; \
43
		 /^[[:cntrl:]]/s|install-dist_samplesDATA$$||' \
44
		${WRKSRC}/Makefile.in
45
	@${REINPLACE_CMD} -e \
46
		's|/usr/lib|${LOCALBASE}/lib| ; \
47
		 /luarocks/d' ${WRKSRC}/samples/*.lua
20
48
21
WRKSRC=		${WRKDIR}/${GITHUB_USER}-${PORTNAME}-${GITHUB_SRC_SUFX}
49
post-install:
22
CFLAGS+=	-I${LOCALBASE}/include -I${LUA_INCDIR} \
23
		-DBSD -fPIC
24
LDFLAGS+=	-L${LOCALBASE}/lib -L${LUA_LIBDIR} -llua -shared
25
MAKE_ENV+=	LIB_OPTION="${LDFLAGS}" LIB_EXT=".so" LUA="${LUA_CMD}"
26
TESTS_EXCLUDE=	tests/alien tests/alien.lua
27
28
GITHUB_USER=	mascarenhas
29
GITHUB_SRC_SUFX=e667d5d
30
31
.if ${CFLAGS:M-fstack-prot*}
32
MAKE_ENV+=	__MAKE_CONF= # inherit CFLAGS only once
33
CFLAGS+=	-fno-stack-protector
34
.endif
35
36
# add lua prefix to directories
37
.for p in data: docs:doc/ examples:examples/
38
${p:C/:.*//:U}DIR_REL=	share/${p:C/.*://}${LUA_PKGNAMEPREFIX}${PORTNAME}
39
${p:C/:.*//:U}DIR=	${PREFIX}/${${p:C/:.*//:U}DIR_REL}
40
.endfor
41
42
OPTIONS_DEFINE=	DOCS EXAMPLES
43
44
post-extract:	.SILENT
45
	${RM} -rf ${WRKSRC}/libffi
46
	${FIND} ${WRKSRC} -type f -name .git-darcs-dir -delete
47
48
post-patch:	.SILENT
49
	${REINPLACE_CMD} '1s|.*|#! ${LUA_CMD}|' ${WRKSRC}/src/constants
50
	${REINPLACE_CMD} -i '' \
51
		-e 's|/usr/lib|${PREFIX}/lib|' \
52
		-e '/luarocks/d' \
53
		${WRKSRC}/samples/*.lua ${WRKSRC}/tests/*.lua
54
55
do-install:
56
	@${MKDIR} ${STAGEDIR}${LUA_MODLIBDIR}/${PORTNAME}
57
	(cd ${WRKSRC}/src/alien && ${INSTALL_PROGRAM} core.so struct.so \
58
		${STAGEDIR}${LUA_MODLIBDIR}/${PORTNAME})
59
	@${MKDIR} ${STAGEDIR}${LUA_MODSHAREDIR}
60
	${INSTALL_DATA} ${WRKSRC}/src/alien.lua ${STAGEDIR}${LUA_MODSHAREDIR}
61
	@${MKDIR} ${STAGEDIR}${DATADIR}
62
	${INSTALL_SCRIPT} ${WRKSRC}/src/constants ${STAGEDIR}${DATADIR}
63
	${TAR} cf - -C${WRKSRC} ${TESTS_EXCLUDE:S,^,--exclude ,} tests \
64
		| ${TAR} xof - -C${STAGEDIR}${DATADIR}
65
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
50
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
66
	(cd ${WRKSRC}/doc && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR})
51
	(cd ${WRKSRC}/doc && ${INSTALL_DATA} alien.* \
52
		${STAGEDIR}${DOCSDIR})
67
	@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
53
	@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
68
	(cd ${WRKSRC}/samples && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR})
54
	(cd ${WRKSRC}/samples && ${INSTALL_DATA} *.lua \
69
55
		${STAGEDIR}${EXAMPLESDIR})
70
regression-test:	build
71
	${LN} -fs ${TESTS_EXCLUDE:S,tests/,../src/,} ${WRKSRC}/tests
72
	cd ${WRKSRC}/tests && ${LUA_CMD} test_alien.lua
73
	${RM} -f ${TESTS_EXCLUDE:S,^,${WRKSRC}/,}
74
56
75
.include <bsd.port.mk>
57
.include <bsd.port.mk>
(-)devel/lua-alien/distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (lua-alien/0.5.1) = 5dadc6067f2495da2b78d0ba1fb27d8e33117c138dc76ae4cb500c9b9cd1a26b
1
SHA256 (alien-0.7.0.zip) = ca77a40858a0fb9ac3998f28fda0825ac4af2f4eed0f5d34d74f943867d4adfe
2
SIZE (lua-alien/0.5.1) = 775968
2
SIZE (alien-0.7.0.zip) = 369994
(-)devel/lua-alien/files/patch-Makefile (-31 lines)
Lines 1-31 Link Here
1
--- Makefile~
2
+++ Makefile
3
@@ -1,22 +1,14 @@
4
 
5
 all: src/alien/core.so src/alien/struct.so tests/libalientest$(LIB_EXT)
6
 
7
-src/alien/core.o: src/alien/core.c libffi/include/ffi.h
8
-	$(CC) -c $(CFLAGS) -Ilibffi/include -o src/alien/core.o src/alien/core.c
9
+src/alien/core.o: src/alien/core.c
10
+	$(CC) -c $(CFLAGS) -o src/alien/core.o src/alien/core.c
11
 
12
-libffi/include/ffi.h:
13
-	cat executables | xargs chmod +x
14
-	cd libffi && ./configure --disable-shared CC=gcc
15
-
16
-libffi/Makefile:
17
-	cat executables | xargs chmod +x
18
-	cd libffi && ./configure --disable-shared CC=gcc
19
+src/alien/struct.o: src/alien/struct.c
20
+	$(CC) -c $(CFLAGS) -o src/alien/struct.o src/alien/struct.c
21
 
22
-libffi/.libs/libffi.a: libffi/Makefile
23
-	cd libffi && make CC=gcc
24
-
25
-src/alien/core.so: src/alien/core.o libffi/.libs/libffi.a
26
-	export MACOSX_DEPLOYMENT_TARGET=10.3; $(CC) $(LIB_OPTION) -o src/alien/core.so src/alien/core.o -lgcc -Llibffi/.libs -lffi
27
+src/alien/core.so: src/alien/core.o
28
+	export MACOSX_DEPLOYMENT_TARGET=10.3; $(CC) $(LIB_OPTION) -o src/alien/core.so src/alien/core.o -lgcc -lffi
29
 
30
 src/alien/struct.so: src/alien/struct.o 
31
 	export MACOSX_DEPLOYMENT_TARGET=10.3; $(CC) $(LIB_OPTION) -o src/alien/struct.so src/alien/struct.o
(-)devel/lua-alien/files/patch-src-alien-core.c (-11 lines)
Lines 1-11 Link Here
1
--- src/alien/core.c~
2
+++ src/alien/core.c
3
@@ -301,7 +301,7 @@ static void *alien_loadfunc (lua_State *
4
 #define FFI_STDCALL FFI_DEFAULT_ABI
5
 #endif
6
 
7
-#ifdef DARWIN
8
+#if defined(DARWIN) || !defined(FFI_SYSV)
9
 #define FFI_SYSV FFI_DEFAULT_ABI
10
 #endif
11
 
(-)devel/lua-alien/files/patch-src__alien.c (+11 lines)
Line 0 Link Here
1
--- src/alien.c.orig
2
+++ src/alien.c
3
@@ -332,7 +332,7 @@
4
 #define FFI_STDCALL FFI_DEFAULT_ABI
5
 #endif
6
 
7
-#ifdef __APPLE__
8
+#if defined(__APPLE__) || defined(BSD)
9
 #define FFI_SYSV FFI_DEFAULT_ABI
10
 #endif
11
 
(-)devel/lua-alien/pkg-plist (-11 / +5 lines)
Lines 1-17 Link Here
1
%%LUA_MODLIBDIR%%/alien/core.so
1
bin/constants
2
%%LUA_MODLIBDIR%%/alien/struct.so
2
%%LUA_MODLIBDIR%%/alien_c.la
3
%%PORTDATA%%%%DATADIR%%/constants
3
%%LUA_MODLIBDIR%%/alien_c.so
4
%%PORTDATA%%%%DATADIR%%/tests/alientest.c
4
%%PORTDOCS%%%%DOCSDIR%%/alien.html
5
%%PORTDATA%%%%DATADIR%%/tests/libalientest.so
6
%%PORTDATA%%%%DATADIR%%/tests/test_alien.lua
7
%%PORTDOCS%%%%DOCSDIR%%/alien.md
5
%%PORTDOCS%%%%DOCSDIR%%/alien.md
8
%%PORTDOCS%%%%DOCSDIR%%/index.html
9
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/gtk.lua
6
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/gtk.lua
10
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/libc.lua
7
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/libc.lua
11
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/string_array.lua
8
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/string_array.lua
12
%%LUA_MODSHAREDIR%%/alien.lua
9
%%LUA_MODSHAREDIR%%/alien.lua
13
@dirrm %%LUA_MODLIBDIR%%/alien
14
%%PORTDATA%%@dirrm %%DATADIR%%/tests
15
%%PORTDATA%%@dirrm %%DATADIR%%
16
%%PORTDOCS%%@dirrm %%DOCSDIR%%
17
%%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%%
10
%%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%%
11
%%PORTDOCS%%@dirrm %%DOCSDIR%%

Return to bug 187972