Annotation of pkgsrc/lang/lua/luaversion.mk, revision 1.1

1.1     ! dholland    1: # $NetBSD$
        !             2: 
        !             3: # This file determins which Lua version is used as a dependency for
        !             4: # a package.
        !             5: #
        !             6: # === User-settable variables ===
        !             7: #
        !             8: # LUA_VERSION_DEFAULT
        !             9: #      The preferred lua version to use.
        !            10: #
        !            11: #      Possible values: 51 52
        !            12: #      Default: 52
        !            13: #
        !            14: # === Infrastructure variables ===
        !            15: #
        !            16: # LUA_VERSION_REQD
        !            17: #      Lua version to use. This variable should not be set by
        !            18: #      packages; it is ordinarily set by multiversion builds.
        !            19: #
        !            20: #      Possible values: ${LUA_VERSIONS_ACCEPTED}
        !            21: #      Default: ${LUA_VERSION_DEFAULT}
        !            22: #
        !            23: # === Package-settable variables ===
        !            24: #
        !            25: # LUA_VERSIONS_ACCEPTED
        !            26: #      The Lua versions that the package can build against. Order
        !            27: #      is significant; those listed earlier are preferred over those
        !            28: #      listed later.
        !            29: #
        !            30: #      Possible values: 51 52
        !            31: #      Default: 52 51
        !            32: #
        !            33: # LUA_VERSIONS_INCOMPATIBLE
        !            34: #      The Lua versions that the package *cannot* build against.
        !            35: #
        !            36: #      Possible values: 51 52
        !            37: #      Default: <empty>
        !            38: #
        !            39: # LUA_SELF_CONFLICT
        !            40: #      If set to "yes", CONFLICTS entries are added among the various
        !            41: #      per-Lua-version variants of a multiversion package.
        !            42: #
        !            43: # === Defined variables ===
        !            44: #
        !            45: # LUA_PKGPREFIX
        !            46: #      The prefix to use in PKGNAME for multiversion packages.
        !            47: #
        !            48: #      Example: lua51
        !            49: #
        !            50: # Keywords: Lua
        !            51: #
        !            52: 
        !            53: .if !defined (LUA_LUAVERSION_MK)
        !            54: LUA_LUAVERSION_MK=     # defined
        !            55: 
        !            56: .include "../../mk/bsd.prefs.mk"
        !            57: 
        !            58: BUILD_DEFS+=           LUA_VERSION_DEFAULT
        !            59: BUILD_DEFS_EFFECTS+=   LUAPACKAGE
        !            60: 
        !            61: LUA_VERSION_DEFAULT?=  52
        !            62: LUA_VERSIONS_ACCEPTED?=        52 51
        !            63: LUA_VERSIONS_INCOMPATIBLE?=# empty
        !            64: 
        !            65: #
        !            66: # Resolve LUA_VERSIONS_INCOMPATBLE and generate the _OK vars.
        !            67: #
        !            68: .for v in ${LUA_VERSIONS_ACCEPTED}
        !            69: .if empty(LUA_VERSIONS_INCOMPATIBLE:M${v})
        !            70: _LUA_VERSION_${v}_OK=          yes
        !            71: _LUA_VERSIONS_ACCEPTED+=       ${v}
        !            72: .endif
        !            73: .endfor
        !            74: 
        !            75: # Pick a version
        !            76: .if defined(LUA_VERSION_REQD)
        !            77: .  if defined(_LUA_VERSION_${LUA_VERSION_REQD}_OK)
        !            78: _LUA_VERSION=          ${LUA_VERSION_REQD}
        !            79: .  endif
        !            80: .else
        !            81: .  if defined(_LUA_VERSION_${LUA_VERSION_DEFAULT}_OK)
        !            82: _LUA_VERSION?=         ${LUA_VERSION_DEFAULT}
        !            83: .  endif
        !            84: .  for v in ${_LUA_VERSIONS_ACCEPTED}
        !            85: .    if defined(_LUA_VERSION_${v}_OK)
        !            86: _LUA_VERSION?=         ${v}
        !            87: .    endif
        !            88: .  endfor
        !            89: .endif
        !            90: 
        !            91: #
        !            92: # Enable multiversion builds.
        !            93: #
        !            94: MULTI+=        LUA_VERSION_REQD=${_LUA_VERSION}
        !            95: 
        !            96: # In case nothing matched
        !            97: _LUA_VERSION?=         none
        !            98: 
        !            99: #
        !           100: # Handle self-conflicts
        !           101: #
        !           102: .if !empty(LUA_SELF_CONFLICT:M[Yy][Ee][Ss])
        !           103: .for v in ${_LUA_VERSIONS_ACCEPTED:N${_LUA_VERSION}}
        !           104: CONFLICTS+=    ${PKGNAME:S/lua${_LUA_VERSION}/lua${v}/:C/-[0-9].*$/-[0-9]*/}
        !           105: .endfor
        !           106: .endif
        !           107: 
        !           108: .if ${_LUA_VERSION} == "52"
        !           109: LUA_PACKAGE=           lua52
        !           110: LUA_PKGSRCDIR=         ../../lang/lua52
        !           111: LUA_PKGPREFIX=         lua52
        !           112: LUA_BASEDEPENDS=       lua52>=5.2<5.3${LUA_PKGSRCDIR}
        !           113: 
        !           114: .elif ${_LUA_VERSION} == "51"
        !           115: LUA_PACKAGE=           lua51
        !           116: LUA_PKGSRCDIR=         ../../lang/lua51
        !           117: LUA_PKGPREFIX=         lua51
        !           118: LUA_BASEDEPENDS=       lua51>=5.1<5.2:${LUA_PKGSRCDIR}
        !           119: 
        !           120: .else
        !           121: PKG_FAIL_REASION+=     "No valid Lua version found"
        !           122: 
        !           123: .endif
        !           124: 
        !           125: #LUA_DEPENDS=  ${BUILDLINK_API_DEPENDS.${LUA_PACKAGE}}:${LUA_PKGSRCDIR}
        !           126: 
        !           127: .include "${LUA_PKGSRCDIR}/version.mk"
        !           128: _LUA_DOT_VERSION=      ${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}
        !           129: 
        !           130: .endif  # LUA_LUAVERSION_MK

CVSweb <webmaster@jp.NetBSD.org>