lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On 29 April 2013 16:15, Thijs Schreijer <> wrote:
>> -----Original Message-----
>> From: [] On
>> Behalf Of Thijs Schreijer
>> Sent: donderdag 25 april 2013 21:29
>> To: 'Lua mailing list'
>> Subject: how to distribute binding to a library
>> List,
>> I've been working on a binding for the pupnp library. I'm in the process
>> of making it distributable. I have 2 core pieces; the pupnp library itself
>> and my binding code. What is considered best practice for these types of
>> bindings? Should it be statically linked, or dynamically?
>> How to deal with the dependencies when distributing? should I include the
>> full source code of pupnp, if not, how to make sure it builds using
>> LuaRocks for example?
>> Any help is appreciated
>> Thijs
>> PS. I have to support Windows to...
> I now added the following to the rockspec;
>           incdirs = {
>             "/usr/local/include/upnp",
>           },
> So far it worked on an Ubuntu VM and on a Raspberry Pi, but still feels a bit 'hard-coded'. Can I expect it to work on other distro's and mac's as well? Any advice?

Yes, you shouldn't spell out the full directory like that. You should
use the 'external_dependencies' table and then use the generated
variables such as "$(UPNP_DIR)" (see the LuaRocks documentation and
other rockspecs for examples, and feel free to ask whatever's still
not clear in the LuaRocks mailing list).

You can also use the 'platforms' table in a rockspec to make entries
different on Unix and Windows, in case you want to use the
system-installed library on the former and a bundled copy on the

-- Hisham