Discussion:
rockspecs for my libraries and tools for Lua
Luiz Henrique de Figueiredo
2018-09-28 12:52:10 UTC
Permalink
I've recently updated my libraries and tools for Lua to make them
self-contained and build out of the box in Linux and macOS. See
http://lua-users.org/lists/lua-l/2018-07/msg00671.html and other
messages with the same subject.

The packages have a version number in preparation for making them
available at LuaRocks. See http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/

I need help making rockspecs for my packages that will work everywhere
because I don't have many platforms to test them on.

Attached is limath-100-1.rockspec, for the math library at
http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/index.html#limath

Is this rockspec right? Can it be simplified? Does it need anything
else? Will this template work for all my packages? Will it work for
both LuaRocks 2 and 3? Does it need to?

Thank you for your help.
--lhf
Oliver Schmidt
2018-09-28 16:52:19 UTC
Permalink
Hi,
Post by Luiz Henrique de Figueiredo
Attached is limath-100-1.rockspec, for the math library at
http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/index.html#limath
attached is a simple rockspec that can build "limath" with luarocks's builtin
build type.

As demonstration I set up a github repository with travis and appveyor builds
that are showing that this rockspecs builds fine and the tests are running OK
for Linux, Mac OS, Windows MSVC & Windows MINGW using luarocks 2.4.4 and 3.0.2,
for Lua versions 5.1, 5.2, 5.3, luajit 2.0 & 2.1, see
https://github.com/osch/lua-limath-test
Post by Luiz Henrique de Figueiredo
Will it work for both LuaRocks 2 and 3? Does it need to?
IMHO it's better also to support LuaRocks 2 since it is still used in many Linux
distros, therefore I removed description.labels and rockspec_format = "3.0" to
remain backwards compatible.

Best regards,
Oliver
Luiz Henrique de Figueiredo
2018-09-28 17:00:12 UTC
Permalink
attached is a simple rockspec that can build "limath" with luarocks's builtin build type.
Thanks. My Makefiles already have a "build" target, hence the build
entry in the template I've posted. This was suggested by Hisham, but
I'm not sure I did it right.
I removed description.labels and rockspec_format = "3.0" to remain backwards compatible.
Removing description.labels and rockspec_format = "3.0" is all that is
needed to support LuaRocks 2?

Thanks.
Oliver Schmidt
2018-09-28 17:07:44 UTC
Permalink
Post by Luiz Henrique de Figueiredo
attached is a simple rockspec that can build "limath" with luarocks's builtin build type.
Thanks. My Makefiles already have a "build" target, hence the build
entry in the template I've posted. This was suggested by Hisham, but
I'm not sure I did it right.
I have not much experience using luarocks's make build type, especially this
could be problematic under windows if there is no GNU Make installed. IMHO it's
much easier to have multi platform support using luarocks builtin build type
especially for simple C projects.
Post by Luiz Henrique de Figueiredo
I removed description.labels and rockspec_format = "3.0" to remain backwards compatible.
Removing description.labels and rockspec_format = "3.0" is all that is
needed to support LuaRocks 2?
as you can see from the automatic build & tests: yes it builds with luarocks 2 &
3, see

Linux & MacOS : https://travis-ci.org/osch/lua-limath-test
Windows: https://ci.appveyor.com/project/osch/lua-limath-test

Loading...