Bug 149983 - [new port] devel/lua-alien: Lua -> C FFI
Summary: [new port] devel/lua-alien: Lua -> C FFI
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Philip Paeps
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-26 10:30 UTC by swell.k
Modified: 2010-08-26 12:10 UTC (History)
0 users

See Also:


Attachments
a.diff (7.18 KB, patch)
2010-08-26 10:30 UTC, swell.k
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description swell.k 2010-08-26 10:30:12 UTC
Unlike alien rock[1] the port uses system libffi. And I've changed
install paths a bit to prevent possible filename collisions with games,
other FFIs or if someone ports it to a different version of lua.

The only rock that depends on alien seems to be fbclient. And I'm not
interested in firebird client so the port'll likely remain a leaf.

[1] http://luarocks.org/repositories/rocks/alien-0.5.0-1.rockspec

---
Alien lets a Lua application call load dynamic libraries and call C
functions in a portable way, using libffi.

WWW: http://alien.luaforge.net/

How-To-Repeat: Example of a propeller using nanosleep(2):
%%
require 'alien'

local timespec = alien.defstruct {
   { 'sec',  'long' },
   { 'nsec', 'long' },
}

local def = alien.default
def.nanosleep:types('int', 'pointer', 'pointer')

function nanosleep(seconds, nanoseconds)
   local t = timespec:new()
   t.sec, t.nsec = seconds, nanoseconds
   return def.nanosleep(t(), nil)
end

function propeller()
   local prop_sym = { '/', '-', '\\', '|' }
   local function prop_iter(a, i)
      i = i < #a and i + 1 or 1
      return i, a[i]
   end

   return prop_iter, prop_sym, 1
end

io.write('waiting...')
for i,v in propeller() do
   io.write(v .. '\b')
   io.flush()
   nanosleep(0, 1)
end
%%

There are a few more examples in EXAMPLESDIR and one test in DATADIR/tests.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2010-08-26 10:30:29 UTC
Responsible Changed
From-To: freebsd-ports-bugs->philip

philip@ wants this port PRs (via the GNATS Auto Assign Tool)
Comment 2 swell.k 2010-08-26 10:35:20 UTC
Anonymous <swell.k@gmail.com> writes:

> +.if !defined(NOPORTDATA)
> +	${MKDIR} ${DATADIR}
> +	${INSTALL_PROGRAM} ${WRKSRC}/src/constants ${DATADIR}

Of course it should be INSTALL_SCRIPT.

Since I have DEBUG_FLAGS in make.conf STRIP here is usually empty.
Comment 3 dfilter service freebsd_committer freebsd_triage 2010-08-26 11:49:41 UTC
philip      2010-08-26 10:49:27 UTC

  FreeBSD ports repository

  Modified files:
    devel                Makefile 
  Added files:
    devel/lua-alien      Makefile distinfo pkg-descr pkg-plist 
    devel/lua-alien/files patch-Makefile 
  Log:
  Add lua-alien 0.5.0, lua -> C FFI.
  
  PR:             ports/149983
  Submitted by:   Anonymous <swell.k-at-gmail.com>
  
  Revision  Changes    Path
  1.4025    +1 -0      ports/devel/Makefile
  1.1       +65 -0     ports/devel/lua-alien/Makefile (new)
  1.1       +3 -0      ports/devel/lua-alien/distinfo (new)
  1.1       +31 -0     ports/devel/lua-alien/files/patch-Makefile (new)
  1.1       +4 -0      ports/devel/lua-alien/pkg-descr (new)
  1.1       +17 -0     ports/devel/lua-alien/pkg-plist (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 4 dfilter service freebsd_committer freebsd_triage 2010-08-26 12:00:45 UTC
philip      2010-08-26 11:00:36 UTC

  FreeBSD ports repository

  Modified files:
    Mk                   bsd.lua.mk 
  Log:
  Add lua-alien 0.5.0, lua -> C FFI.
  
  PR:             ports/149983
  Submitted by:   Anonymous <swell.k-at-gmail.com>
  
  Revision  Changes    Path
  1.20      +5 -3      ports/Mk/bsd.lua.mk
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 5 Philip Paeps freebsd_committer freebsd_triage 2010-08-26 12:00:59 UTC
State Changed
From-To: open->closed

New port added. Thanks!