diff options
author | obache <obache@pkgsrc.org> | 2014-12-07 05:10:43 +0000 |
---|---|---|
committer | obache <obache@pkgsrc.org> | 2014-12-07 05:10:43 +0000 |
commit | 58738ef445d27a177996a9be9716c6a6503fa6ed (patch) | |
tree | 04924d1370abecdb2367133d98fa0116efb42757 | |
parent | e52f4eea2b86dd9ec93bd8365cd2ae29e278ec76 (diff) | |
download | pkgsrc-58738ef445d27a177996a9be9716c6a6503fa6ed.tar.gz |
Auto detect lua version from required package name.
resolve PR pkg/49318
-rw-r--r-- | lang/lua/luaversion.mk | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lang/lua/luaversion.mk b/lang/lua/luaversion.mk index bb96f485529..8267fe0bc61 100644 --- a/lang/lua/luaversion.mk +++ b/lang/lua/luaversion.mk @@ -1,4 +1,4 @@ -# $NetBSD: luaversion.mk,v 1.5 2014/05/03 13:00:44 alnsn Exp $ +# $NetBSD: luaversion.mk,v 1.6 2014/12/07 05:10:43 obache Exp $ # This file determins which Lua version is used as a dependency for # a package. @@ -64,6 +64,16 @@ .if !defined (LUA_LUAVERSION_MK) LUA_LUAVERSION_MK= # defined +# derive a Lua version from the package name if possible +# optionally handled quoted package names +.if defined(PKGNAME_REQD) && !empty(PKGNAME_REQD:Mlua[0-9][0-9]-*) || \ + defined(PKGNAME_REQD) && !empty(PKGNAME_REQD:M*-lua[0-9][0-9]-*) +LUA_VERSION_REQD?= ${PKGNAME_REQD:C/(^.*-|^)lua([0-9][0-9])-.*/\2/} +.elif defined(PKGNAME_OLD) && !empty(PKGNAME_OLD:Mlua[0-9][0-9]-*) || \ + defined(PKGNAME_OLD) && !empty(PKGNAME_OLD:M*-lua[0-9][0-9]-*) +LUA_VERSION_REQD?= ${PKGNAME_OLD:C/(^.*-|^)lua([0-9][0-9])-.*/\2/} +.endif + .include "../../mk/bsd.prefs.mk" BUILD_DEFS+= LUA_VERSION_DEFAULT |