From owner-svn-ports-all@FreeBSD.ORG Fri Jan 10 08:25:50 2014 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 71262E15; Fri, 10 Jan 2014 08:25:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5D43E1313; Fri, 10 Jan 2014 08:25:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0A8PoYv096443; Fri, 10 Jan 2014 08:25:50 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0A8PovY096441; Fri, 10 Jan 2014 08:25:50 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201401100825.s0A8PovY096441@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 10 Jan 2014 08:25:50 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r339322 - in head/Mk: . Uses X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jan 2014 08:25:50 -0000 Author: bapt Date: Fri Jan 10 08:25:49 2014 New Revision: 339322 URL: http://svnweb.freebsd.org/changeset/ports/339322 Log: Add a USES=lua (WIP) that only supports lua 5.2 Goal is to slowly port any lua software to lua 5.2 and then remove lua 5.1 along with bsd.lua.mk Make version flexible and settable via DEFAULT_VERSIONS to prepare the futur days of lua Added: head/Mk/Uses/lua.mk (contents, props changed) Modified: head/Mk/bsd.default-versions.mk Added: head/Mk/Uses/lua.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/Mk/Uses/lua.mk Fri Jan 10 08:25:49 2014 (r339322) @@ -0,0 +1,106 @@ +# $FreeBSD$ +# +# Provide support for lua +# +# MAINTAINER: lua@FreeBSD.org +# + +.if !defined(_INCLUDE_USES_LUA_MK) +_INCLUDE_USES_LUA_MK= yes + +_LUA_VALID_VERSIONS= 52 + +.include "${PORTSDIR}/Mk/bsd.default-versions.mk" +_LUA_DEFAULT_VERSION= ${LUA_DEFAULT:S/.//} +.if ! ${_LUA_VALID_VERSIONS:M${_LUA_DEFAULT_VERSION}} +IGNORE= Invalid lua version ${LUA_DEFAULT} +.endif + +_LUA_ARGS= ${lua_ARGS:S/,/ /g} + +# +# Parse a ver+ argument +# +.if ${_LUA_ARGS:M*+} +_LUA_MIN_VERSION:= ${_LUA_ARGS:M*+:S/+//} +_LUA_WANTED_VERSION:= ${_LUA_DEFAULT_VERSION} +.endif + +# +# Parse one or more ver arguments +# +.if ${_LUA_ARGS:M5[1-2]} +_LUA_WANTED_VERSIONS:= ${_LUA_ARGS:M5[1-2]} +.endif + +# +# If no version was specified with any of the ver or ver+ arguments, set the +# default version. +# +.if !defined(_LUA_WANTED_VERSIONS) +_LUA_WANTED_VERSIONS= ${_LUA_DEFAULT_VERSION} +.endif + +# +# Resolve minimum versions (ver+). Append anything greater or equal than the +# specified minimum version to the list of wanted versions. +# +.if defined(_LUA_MIN_VERSION) +. for _v in ${_LUA_VALID_VERSIONS} +. if ${_LUA_MIN_VERSION} <= ${_v} +_LUA_WANTED_VERSIONS+=${_v} +. endif +. endfor +.endif + +# +# Right now we have built a list of potential versions that we may depend on. +# Let's sort them and remove any duplicates. We then locate the highest one +# already installed, if any. +# +.for _v in ${_LUA_WANTED_VERSIONS:O:u} +_LUA_HIGHEST_VERSION:=${_v} +. if exists(${LOCALBASE}/bin/lua${_v}) +_LUA_WANTED_VERSION:= ${_v} +. endif +.endfor + +# +# If we couldn't find any wanted version installed, depend on the highest one. +.if !defined(_LUA_WANTED_VERSION) +_LUA_WANTED_VERSION:= ${_LUA_HIGHEST_VERSION} +.endif + +# +# Exported variables +# +LUA_VER_STR= ${_LUA_WANTED_VERSION} +LUA_VER= ${_LUA_WANTED_VERSION:S/5/5./} +LUA_CMD= lua${_LUA_WANTED_VERSION} +LUAC_CMD= luac${_LUA_WANTED_VERSION} +LUA_INCDIR= ${LOCALBASE}/include/lua${_LUA_WANTED_VERSION} +LUA_MODLIBDIR= ${LOCALBASE}/lib/lua/${LUA_VER} +LUA_MODSHAREDIR= ${LOCALBASE}/share/lua/${LUA_VER} +LUA_LIBDIR= ${LOCALBASE}/lib +LUA_PKGNAMEPREFIX= lua${LUA_VER_STR}- + +PLIST_SUB+= LUA_MODLIBDIR=${LUA_MODLIBDIR:S,^${LOCALBASE}/,,} \ + LUA_MODSHAREDIR=${LUA_MODSHAREDIR:S,^${LOCALBASE}/,,} \ + LUA_VER=${LUA_VER} \ + LUA_INCDIR=${LUA_INCDIR} \ + LUA_LIBDIR=${LUA_LIBDIR} +MAKE_ENV+= LUA_MODLIBDIR=${LUA_MODLIBDIR} \ + LUA_MODSHAREDIR=${LUA_MODSHAREDIR} \ + LUA_VER=${LUA_VER} \ + LUA_INCDIR=${LUA_INCDIR} \ + LUA_LIBDIR=${LUA_LIBDIR} + +.if ${_LUA_ARGS:Mbuild} +BUILD_DEPENDS= ${LUA_CMD}:${PORTSDIR}/lang/lua${LUA_VER_STR:51=} +.elfif ${_LUA_ARGS:Mrun} +RUN_DEPENDS= ${LUA_CMD}:${POTSDIR}/lang/lua${LUA_VER_STR:51=} +.else +LIB_DEPENDS= liblua-${LUA_VER}.so:${PORTSDIR}/lang/lua${LUA_VERSTR:51=} +.endif + +.endif Modified: head/Mk/bsd.default-versions.mk ============================================================================== --- head/Mk/bsd.default-versions.mk Fri Jan 10 08:25:34 2014 (r339321) +++ head/Mk/bsd.default-versions.mk Fri Jan 10 08:25:49 2014 (r339322) @@ -23,5 +23,6 @@ TCLTK_DEFAULT?= 8.6 PYTHON_DEFAULT?= 2.7 PYTHON2_DEFAULT?= 2.7 PYTHON3_DEFAULT?= 3.3 +LUA_DEFAULT?= 5.2 .endif