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

Collapse All | Expand All

(-)devel/lua-alien/Makefile (-57 / +39 lines)
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>
(-)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 / +4 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.so
3
%%PORTDATA%%%%DATADIR%%/constants
3
%%PORTDOCS%%%%DOCSDIR%%/alien.html
4
%%PORTDATA%%%%DATADIR%%/tests/alientest.c
5
%%PORTDATA%%%%DATADIR%%/tests/libalientest.so
6
%%PORTDATA%%%%DATADIR%%/tests/test_alien.lua
7
%%PORTDOCS%%%%DOCSDIR%%/alien.md
4
%%PORTDOCS%%%%DOCSDIR%%/alien.md
8
%%PORTDOCS%%%%DOCSDIR%%/index.html
9
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/gtk.lua
5
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/gtk.lua
10
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/libc.lua
6
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/libc.lua
11
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/string_array.lua
7
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/string_array.lua
12
%%LUA_MODSHAREDIR%%/alien.lua
8
%%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%%
9
%%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%%
10
%%PORTDOCS%%@dirrm %%DOCSDIR%%

Return to bug 187972