Changeset View
Changeset View
Standalone View
Standalone View
lang/lua51/Makefile
# Created by: GreenDog <fiziologus@gmail.com> | # Created by: GreenDog <fiziologus@gmail.com> | ||||
# $FreeBSD$ | # $FreeBSD$ | ||||
PORTNAME= lua | PORTNAME= lua | ||||
PORTVERSION= 5.1.5 | PORTVERSION= 5.1.5 | ||||
PORTREVISION= 9 | PORTREVISION= 9 | ||||
CATEGORIES= lang | CATEGORIES= lang | ||||
MASTER_SITES= http://www.lua.org/ftp/ | MASTER_SITES= http://www.lua.org/ftp/ | ||||
PKGNAMESUFFIX= 51 | PKGNAMESUFFIX= 51 | ||||
MAINTAINER= nicklaus.t@me.com | MAINTAINER= nicklaus.t@me.com | ||||
COMMENT= Small, compilable scripting language providing easy access to C code | COMMENT= Small, compilable scripting language providing easy access to C code | ||||
LICENSE= MIT | LICENSE= MIT | ||||
USES= libedit | USES= libedit lua:core,51 | ||||
LUA_VER= 5.1 | |||||
USE_LDCONFIG= yes | USE_LDCONFIG= yes | ||||
# Overriding __MAKE_CONF makes sure that we don't re-parse | # Overriding __MAKE_CONF makes sure that we don't re-parse | ||||
# /etc/make.conf during do-build, which would jeopardize the build | # /etc/make.conf during do-build, which would jeopardize the build | ||||
# if, for instance, the user set CFLAGS=mumble | # if, for instance, the user set CFLAGS=mumble | ||||
# NOTE: /etc/make.conf is read BEFORE Makefile, so we already | # NOTE: /etc/make.conf is read BEFORE Makefile, so we already | ||||
# have its settings when we get here. | # have its settings when we get here. | ||||
# See http://wiki.freebsd.org/MatthiasAndree/LuaLessonsLearnt | # See http://wiki.freebsd.org/MatthiasAndree/LuaLessonsLearnt | ||||
MAKE_ARGS= __MAKE_CONF=${NONEXISTENT} | MAKE_ARGS= __MAKE_CONF=${NONEXISTENT} | ||||
# liblua.so requires libm, so make sure it has an explicit dependency | # liblua.so requires libm, so make sure it has an explicit dependency | ||||
# so that applications need not second-guess lua's dependencies. | # so that applications need not second-guess lua's dependencies. | ||||
CPPFLAGS+= -I${LOCALBASE}/include | CPPFLAGS+= -I${LOCALBASE}/include | ||||
LDFLAGS+= -lm -pthread | LDFLAGS+= -lm -pthread | ||||
BUILD_WRKSRC= ${WRKSRC}/src | BUILD_WRKSRC= ${WRKSRC}/src | ||||
MAKE_ARGS+= MYCFLAGS="${CFLAGS} ${CPPFLAGS} -DLUA_USE_LINUX" \ | MAKE_ARGS+= MYCFLAGS="${CFLAGS} ${CPPFLAGS} -DLUA_USE_LINUX" \ | ||||
MYLDFLAGS="${LDFLAGS}" \ | MYLDFLAGS="${LDFLAGS}" \ | ||||
MYLIBS="-Wl,-E -L${LOCALBASE}/lib -ledit" \ | MYLIBS="-Wl,-E -L${LOCALBASE}/lib -ledit" \ | ||||
CC="${CC}" \ | CC="${CC}" \ | ||||
LUA_T=lua51 \ | LUA_T=lua51 \ | ||||
LUAC_T=luac51 \ | LUAC_T=luac51 \ | ||||
LUA_A=liblua-${LUA_VER}.a \ | LUA_A=liblua-${LUA_VER}.a \ | ||||
LUA_SO=liblua-${LUA_VER}.so \ | LUA_SO=liblua-${LUA_VER}.so \ | ||||
LUA_SONAME=liblua-${LUA_VER}.so \ | LUA_SONAME=liblua-${LUA_VER}.so \ | ||||
TO_BIN="lua51 luac51" \ | TO_BIN="lua51 luac51" \ | ||||
TO_LIB="liblua-${LUA_VER}.a liblua-${LUA_VER}.so" \ | TO_LIB="liblua-${LUA_VER}.a liblua-${LUA_VER}.so" \ | ||||
INSTALL_TOP=${STAGEDIR}${PREFIX} \ | INSTALL_TOP=${STAGEDIR}${PREFIX} \ | ||||
INSTALL_INC=${STAGEDIR}${PREFIX}/include/lua51 \ | INSTALL_INC=${STAGEDIR}${PREFIX}/include/lua51 \ | ||||
INSTALL_EXEC="${INSTALL_PROGRAM}" | INSTALL_EXEC="${INSTALL_PROGRAM}" | ||||
# Cope with the lack of support for Lua 5.2 in bsd.lua.mk. These | |||||
# overrides, which are required below, should be removed once bsd.lua.mk | |||||
# understands this lua version. | |||||
LUA_PREFIX?= ${PREFIX} | |||||
LUA_SUBDIR?= lua${PKGNAMESUFFIX} | |||||
LUA_INCDIR?= ${LUA_PREFIX}/include/${LUA_SUBDIR} | |||||
LUA_LIBDIR?= ${LUA_PREFIX}/lib | |||||
CFLAGS+= -fPIC | CFLAGS+= -fPIC | ||||
post-patch: | post-patch: | ||||
@${REINPLACE_CMD} -e 's,rand *(,random(,g' \ | @${REINPLACE_CMD} -e 's,rand *(,random(,g' \ | ||||
${WRKSRC}/src/lmathlib.c | ${WRKSRC}/src/lmathlib.c | ||||
@${REINPLACE_CMD} -e "/LUA_ROOT/s|/usr/local|${LUA_PREFIX}| ; \ | @${REINPLACE_CMD} -e "/LUA_ROOT/s|/usr/local|${LUA_PREFIX}| ; \ | ||||
s,readline/,editline/,g ; \ | s,readline/,editline/,g ; \ | ||||
Show All 24 Lines |