I think the LUA_VERSION detection in lua-detect.mk is broken.
$ pkg-config --exists lua5.1 && echo 5.1 5.1 $ make build/lua-detect.mk:21: *** Could not find any lua version. (Did you install the -dev package?). Stop.
I think this is happening because the makefile does
LUA_VERSION ?= $(shell pkg-config --exists lua5.2 && echo 5.2) LUA_VERSION ?= $(shell pkg-config --exists lua5.1 && echo 5.1) LUA_VERSION ?= $(shell pkg-config --exists lua && echo 5.0)
but the first ?= assigns '' to LUA_VERSION. '' is not the same as undefined in make.
Yep. My suggestion is one assignment with ||
Close, but no cigar. I get LUA_VERSION == "5.1 5.0", I think because || and && have the same precedence.
No logic of both
&&
and||
exactly the same I expected:- If left side of
&&
fails whole expression fails without calling right side.- If left side of
||
succeed than whole expression succeed without calling right-side.- Precedence of shell (at least
bash
) follows usual math rules (&&
have higher preceedence over||
)https://sourceforge.net/p/notion/notion/ci/506d409edb256d9476570b66aa98bd3975aa24dc/ should do it, right?
Yes, that works for me.
In Gentoo, which currently doesn't seem to support side-by-side installs, version 5.1.5 does not install the pkg-config file as lua5.1. That would almost be ok since the version would be set to '', and it would call pkg-config correctly. The problem occurs later when the file expects LUA_INCLUDES to have a value. Gentoo's install doesn't require any flags here, so that test doesn't make sense. Removing that block allows it to proceed normally.
Yep I missed that. Looks like I forgot to check actual value of
LUA_VERSION
. I use Exherbo and use5.1.4
but it works for by some reason. But both in Gentoo and Exherbo using auto-detection is a bad idea and should be changed to explicitly provideLUA_VERSION
as make parameter. That will save us from auto-magic deps on unknown version of lua (in case if we'll have slotted versions).Nevertheless that code detects wrong version and assumes that I have
5.0
. Lets first detect pkg-config module with those lines (i.e. to uselua5.1.pc
orlua.pc
). And after that callpkg-config --modversion
lua. Sample:Note that I don't know do we need full version or only first two components.