Please find attached a new port of LuaFFI: This is a library for calling C functions and manipulating C types from Lua. It is designed to be interface compatible with the FFI library in LuaJIT (see http://luajit.org/ext_ffi.html). It can parse C function declarations and struct definitions that have been directly copied out of C header files and into lua source as a string.
The main reason I've ported this (along with some help from edd@) is because neovim is meant to be run with LuaJIT (which includes the FFI module as standard) whereas we run it with normal Lua (which doesn't). A growing number of neovim plugins try to import the FFI plugin and crash in unexpected ways when it's not present. Having LuaFFI installed is sufficient for all the plugins I've tried so far. My suggestion is that, if this port is acceptable (see below), it would be sensible to add it as a RUN_DEPENDS for editors/neovim -- it's a small enough dependency that I think it's worth it to give plugins the illusion that we're using LuaJIT. A quick word about the port itself. There is no official release of LuaFFI: the seemingly de facto standard is on one of Facebook's github accounts. Furthermore this version of LuaFFI wants to be built with luarocks, which we don't have a port for (and which I'm told is some work to port). I've therefore "built it manually" in the ports Makefile. Because the code is so small, this ickiness seems just about tolerable to me. Laurie
luaffi.tgz
Description: application/tar-gz