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 <thijs@thijsschreijer.nl> wrote:
>> -----Original Message-----
>> From: lua-l-bounces@lists.lua.org [mailto:lua-l-bounces@lists.lua.org] 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).

http://www.luarocks.org/en/Rockspec_format

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
latter.

http://www.luarocks.org/en/Platform_overrides

-- Hisham
http://hisham.hm/