Page MenuHomeFreeBSD

Uses/lua.mk - add flavor support and other options
Needs ReviewPublic

Authored by andrew_tao173.riddles.org.uk on Jul 29 2018, 1:41 AM.

Details

Reviewers
None
Group Reviewers
portmgr
Summary

This is a (first attempt at) adding flavor support to USES=lua, plus some additional options.

The intent is to allow the following:

  1. Lua modules like devel/lua-stdlib-* can be changed to use flavors to keep their dependencies straight, and some helper definitions in lua.mk make it easier for them to keep their documentation subdirs separate
  2. The lang/lua ports themselves could be changed to use USES=lua:envcore,NN to centralize the definitions of all the LUA_* variables in one place, rather than duplicating them between lua.mk and lang/luaNN/Makefile
  3. Applications that use Lua probably wouldn't want to use the flavors option, but can now use LUA_FLAVOR when declaring dependencies on libs
  4. More version range options are supported, e.g. USES=lua:52-54 or USES=lua:-53

A functional change is that this version makes no attempt to look at what versions of Lua are already installed - that seems to me to be a very bad idea.

Test Plan

Needs input.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

Herald added a subscriber: mat. · View Herald Transcript
mat added inline comments.Aug 6 2018, 11:19 AM
Mk/Uses/lua.mk
226–230

I am not sure why this test. If you are building lang/luaXY, PORTNAME is lua anyway.

Mk/Uses/lua.mk
226–230

You're right, that's unnecessary.

Remove an unnecessary conditional as pointed out by mat.

Remove some not-very-helpful commentary.

andrew_tao173.riddles.org.uk marked 2 inline comments as done.Aug 8 2018, 9:37 PM
ygy added a subscriber: ygy.Aug 12 2018, 5:13 AM
russ.haley_gmail.com added a comment.EditedNov 8 2019, 5:56 AM

I am testing this patch with LuaRocks (as noted in above). I removed all the OPTIONS that I had created which used flavors and added lua:51-54 to my USES:

USES=		gmake uniquefiles lua:51-54

When I attempt to build I get the following error:

russellh@gbsd2 ~/f/p/d/lua-luarocks> make FLAVOR=53
make: "/usr/home/russellh/freebsd/ports/Mk/Uses/lua.mk" line 149: warning: String comparison operator should be either == or !=
make: "/usr/home/russellh/freebsd/ports/Mk/Uses/lua.mk" line 149: Malformed conditional (${_LUA_MIN_VERSION} <= ${:U54} && ${_LUA_MAX_VERSION} >= ${:U54})
make: "/usr/home/russellh/freebsd/ports/Mk/Uses/lua.mk" line 149: warning: String comparison operator should be either == or !=
make: "/usr/home/russellh/freebsd/ports/Mk/Uses/lua.mk" line 149: Malformed conditional (${_LUA_MIN_VERSION} <= ${:U53} && ${_LUA_MAX_VERSION} >= ${:U53})
make: "/usr/home/russellh/freebsd/ports/Mk/Uses/lua.mk" line 149: warning: String comparison operator should be either == or !=
make: "/usr/home/russellh/freebsd/ports/Mk/Uses/lua.mk" line 149: Malformed conditional (${_LUA_MIN_VERSION} <= ${:U52} && ${_LUA_MAX_VERSION} >= ${:U52})
make: "/usr/home/russellh/freebsd/ports/Mk/Uses/lua.mk" line 149: warning: String comparison operator should be either == or !=
make: "/usr/home/russellh/freebsd/ports/Mk/Uses/lua.mk" line 149: Malformed conditional (${_LUA_MIN_VERSION} <= ${:U51} && ${_LUA_MAX_VERSION} >= ${:U51})
make: Fatal errors encountered -- cannot continue
make: stopped in /usr/home/russellh/freebsd/ports/devel/lua-luarocks

What have I done wrong? It doesn't matter what value I put in the make FLAVOR= command

Also, could this patch be modified to support LuaJIT?

Any breakage is probably my fault - I need to pick this one up again and work on it some more.

As for luajit, there's a problem with proliferation at the moment - it looks like there are two separate live forks now in addition to the original (moribund) project.