aboutsummaryrefslogtreecommitdiff
path: root/devel/lua-alien
diff options
context:
space:
mode:
authorPhilip Paeps <philip@FreeBSD.org>2010-08-26 10:49:27 +0000
committerPhilip Paeps <philip@FreeBSD.org>2010-08-26 10:49:27 +0000
commit2b0a293c478d7d55a8cef24c11b517595b0c8b76 (patch)
tree054c2463960a6590b84cae87dcdde9692e0d61a1 /devel/lua-alien
parente2bcfe739e1e2c10c0c96b24b100c80c5d339ccf (diff)
downloadports-2b0a293c478d7d55a8cef24c11b517595b0c8b76.tar.gz
ports-2b0a293c478d7d55a8cef24c11b517595b0c8b76.zip
Notes
Diffstat (limited to 'devel/lua-alien')
-rw-r--r--devel/lua-alien/Makefile65
-rw-r--r--devel/lua-alien/distinfo3
-rw-r--r--devel/lua-alien/files/patch-Makefile31
-rw-r--r--devel/lua-alien/pkg-descr4
-rw-r--r--devel/lua-alien/pkg-plist17
5 files changed, 120 insertions, 0 deletions
diff --git a/devel/lua-alien/Makefile b/devel/lua-alien/Makefile
new file mode 100644
index 000000000000..5ecddb82c8e2
--- /dev/null
+++ b/devel/lua-alien/Makefile
@@ -0,0 +1,65 @@
+# 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}"
+
+# add lua prefix in pkgname
+.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 | ${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
+
+.include <bsd.port.mk>
diff --git a/devel/lua-alien/distinfo b/devel/lua-alien/distinfo
new file mode 100644
index 000000000000..23f5742a38cf
--- /dev/null
+++ b/devel/lua-alien/distinfo
@@ -0,0 +1,3 @@
+MD5 (alien-0.5.0.tar.gz) = d6b265798f6d610d4651d054f601d468
+SHA256 (alien-0.5.0.tar.gz) = a8ab957f1ced1242f4264a3d8b6ef4617a045900ea60b9e57a6abb0a6bd043c3
+SIZE (alien-0.5.0.tar.gz) = 766042
diff --git a/devel/lua-alien/files/patch-Makefile b/devel/lua-alien/files/patch-Makefile
new file mode 100644
index 000000000000..03b28cb8525b
--- /dev/null
+++ b/devel/lua-alien/files/patch-Makefile
@@ -0,0 +1,31 @@
+--- Makefile~
++++ Makefile
+@@ -1,22 +1,14 @@
+
+ all: src/alien/core.so src/alien/struct.so tests/libalientest$(LIB_EXT)
+
+-src/alien/core.o: src/alien/core.c libffi/include/ffi.h
+- $(CC) -c $(CFLAGS) -Ilibffi/include -o src/alien/core.o src/alien/core.c
++src/alien/core.o: src/alien/core.c
++ $(CC) -c $(CFLAGS) -o src/alien/core.o src/alien/core.c
+
+-libffi/include/ffi.h:
+- cat executables | xargs chmod +x
+- cd libffi && ./configure --disable-shared CC=gcc
+-
+-libffi/Makefile:
+- cat executables | xargs chmod +x
+- cd libffi && ./configure --disable-shared CC=gcc
++src/alien/struct.o: src/alien/struct.c
++ $(CC) -c $(CFLAGS) -o src/alien/struct.o src/alien/struct.c
+
+-libffi/.libs/libffi.a: libffi/Makefile
+- cd libffi && make CC=gcc
+-
+-src/alien/core.so: src/alien/core.o libffi/.libs/libffi.a
+- export MACOSX_DEPLOYMENT_TARGET=10.3; $(CC) $(LIB_OPTION) -o src/alien/core.so src/alien/core.o -lgcc -Llibffi/.libs -lffi
++src/alien/core.so: src/alien/core.o
++ export MACOSX_DEPLOYMENT_TARGET=10.3; $(CC) $(LIB_OPTION) -o src/alien/core.so src/alien/core.o -lgcc -lffi
+
+ src/alien/struct.so: src/alien/struct.o
+ export MACOSX_DEPLOYMENT_TARGET=10.3; $(CC) $(LIB_OPTION) -o src/alien/struct.so src/alien/struct.o
diff --git a/devel/lua-alien/pkg-descr b/devel/lua-alien/pkg-descr
new file mode 100644
index 000000000000..0418ab90cab4
--- /dev/null
+++ b/devel/lua-alien/pkg-descr
@@ -0,0 +1,4 @@
+Alien lets a Lua application call load dynamic libraries and call C
+functions in a portable way, using libffi.
+
+WWW: http://alien.luaforge.net/
diff --git a/devel/lua-alien/pkg-plist b/devel/lua-alien/pkg-plist
new file mode 100644
index 000000000000..975253a0266e
--- /dev/null
+++ b/devel/lua-alien/pkg-plist
@@ -0,0 +1,17 @@
+%%LUA_MODLIBDIR%%/alien/core.so
+%%LUA_MODLIBDIR%%/alien/struct.so
+%%PORTDATA%%%%DATADIR%%/constants
+%%PORTDATA%%%%DATADIR%%/tests/alientest.c
+%%PORTDATA%%%%DATADIR%%/tests/libalientest.so
+%%PORTDATA%%%%DATADIR%%/tests/test_alien.lua
+%%PORTDOCS%%%%DOCSDIR%%/alien.md
+%%PORTDOCS%%%%DOCSDIR%%/index.html
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/gtk.lua
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/libc.lua
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/string_array.lua
+%%LUA_MODSHAREDIR%%/alien.lua
+@dirrm %%LUA_MODLIBDIR%%/alien
+%%PORTDATA%%@dirrm %%DATADIR%%/tests
+%%PORTDATA%%@dirrm %%DATADIR%%
+%%PORTDOCS%%@dirrm %%DOCSDIR%%
+%%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%%