iceball
iceball copied to clipboard
Building on Arch Linux.
In Arch (or at least a fork of it, Parabola, which I use) Lua5.1 is in package lua51 and the .pc file is located at /usr/lib/pkgconfig/lua51.pc. So I added another elif to findlua.sh and now I can build with root make file:
elif pkg-config lua51 ; then
# Arch
pkg-config lua51 $@
Initially I was trying to build with cmake, and did make some progress. There doesn't seem to be a Findzlib.cmake in zlib package. This worked instead:
find_package(PkgConfig REQUIRED) pkg_search_module(ZLIB REQUIRED zlib) ~~find_package(zlib REQUIRED)~~
I'm not sure if there is an easy way to use both without issues. I was then getting errors regarding
'LUA_GLOBALSINDEX' undeclared (first use in this function)
So I needed to use library/include variables for LUA51 instead of LUA:
LUA51_LIBRARIES ~~LUA_LIBRARIES~~ LUA51_INCLUDE_DIRS ~~LUA_INCLUDE_DIR~~ find_package(Lua51 REQUIRED) ~~find_package(Lua REQUIRED)~~
This got me to linking, where I got some incomprehensible (to me) errors. I think the LUA51 variables where different from the LUA counterparts, apart from how they obviously would be. I can post that if anyone wants to pursue it further. Personally, trying to compile with cmake made me an alcoholic.
Wew, more reason to keep around the makefile support.
Does it build fine on the dev branch? I've switched the default branch over to that as ultimately the master branch hasn't been touched in quite some time (means we don't have to bump versions).
With that said, a PR based against the dev branch for findlua.sh would be good.
Another PR for getting it to work with CMake would also be good but make sure you somehow have it working - if it doesn't work, just post what you have to and if someone's interested they may be able to help.
In dev branch, I can use make without any changes. The findlua.sh luajit elif works. I guess I'll still make a pull with my changes for people who don't have it.
EDIT: building with cmake works fine in dev too. I guess it has to do with checking for luajit and using it instead if found. My method was:
mkdir build && cd build cmake .. make
Thanks for the patch. I'd recommend running with LuaJIT where possible though.