Changeset View
Changeset View
Standalone View
Standalone View
Makefile
# Created by: GreenDog <fiziologus@gmail.com> | # $FreeBSD$ | ||||
# $FreeBSD: head/lang/lua54/Makefile 454163 2017-11-14 06:28:06Z riggs $ | |||||
PORTNAME= lua | PORTNAME= lua | ||||
PORTVERSION= 5.3.4 | PORTVERSION= 5.4.0 | ||||
PORTREVISION= 2 | DISTVERSIONSUFFIX=-work2 | ||||
mat: Please remove all this. | |||||
CATEGORIES= lang | CATEGORIES= lang | ||||
Not Done Inline ActionsThis should probably be: DISTVERSION= 5.4.0-work2 mat: This should probably be:
```
DISTVERSION= 5.4.0-work2
``` | |||||
MASTER_SITES= http://www.lua.org/ftp/ | MASTER_SITES= https://www.lua.org/work/ | ||||
PKGNAMESUFFIX= 53 | PKGNAMESUFFIX= 54 | ||||
MAINTAINER= russ.haley@gmail.com | MAINTAINER= russ.haley@gmail.com | ||||
Not Done Inline ActionsRemove. mat: Remove. | |||||
COMMENT= Small, compilable scripting language providing easy access to C code | COMMENT= Small, embeddable scripting language providing easy access to C code | ||||
LICENSE= MIT | LICENSE= MIT | ||||
USES= libedit | LUA_VER= 5.4 | ||||
LUA_VER= 5.3 | |||||
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 | |||||
# so that applications need not second-guess lua's dependencies. | |||||
CPPFLAGS+= -I${LOCALBASE}/include | |||||
LDFLAGS+= -lm -pthread | |||||
BUILD_WRKSRC= ${WRKSRC}/src | BUILD_WRKSRC= ${WRKSRC}/src | ||||
MAKE_ARGS+= MYCFLAGS="${CFLAGS} ${CPPFLAGS} -DLUA_USE_LINUX" \ | |||||
MYLDFLAGS="${LDFLAGS}" \ | |||||
MYLIBS="-Wl,-E -L${LOCALBASE}/lib -ledit" \ | |||||
CC="${CC}" \ | |||||
LUA_T=lua53 \ | |||||
LUAC_T=luac53 \ | |||||
LUA_A=liblua-${LUA_VER}.a \ | |||||
LUA_SO=liblua-${LUA_VER}.so \ | |||||
LUA_SONAME=liblua-${LUA_VER}.so \ | |||||
TO_BIN="lua53 luac53" \ | |||||
TO_LIB="liblua-${LUA_VER}.a liblua-${LUA_VER}.so" \ | |||||
INSTALL_TOP=${STAGEDIR}${PREFIX} \ | |||||
INSTALL_INC=${STAGEDIR}${PREFIX}/include/lua53 \ | |||||
INSTALL_EXEC="${INSTALL_PROGRAM}" | |||||
# Cope with the lack of support for Lua 5.2 in bsd.lua.mk. These | # Source, destination, and filenames to copy for the DOCS option | ||||
# overrides, which are required below, should be removed once bsd.lua.mk | # (automatically added to pkg-plist if DOCS is set) | ||||
# understands this lua version. | # We override DOCSDIR to get a per-version subdir. | ||||
DOCSDIR= ${PREFIX}/share/doc/${PORTNAME}${PKGNAMESUFFIX} | |||||
PORTDOCS= *.html *.css *.gif *.png | |||||
BUILD_WRKDOC= ${WRKSRC}/doc | |||||
LUA_PREFIX?= ${PREFIX} | LUA_PREFIX?= ${PREFIX} | ||||
LUA_SUBDIR?= lua${PKGNAMESUFFIX} | |||||
LUA_INCDIR?= ${LUA_PREFIX}/include/${LUA_SUBDIR} | # 2018-03-17: AG - These should match lua.mk, but we can't include that here | ||||
LUA_CMD?= ${PORTNAME}${PKGNAMESUFFIX} | |||||
LUAC_CMD?= ${PORTNAME}c${PKGNAMESUFFIX} | |||||
LUA_INCDIR?= ${LUA_PREFIX}/include/${PORTNAME}${PKGNAMESUFFIX} | |||||
LUA_LIBDIR?= ${LUA_PREFIX}/lib | LUA_LIBDIR?= ${LUA_PREFIX}/lib | ||||
SUB_FILES= lua-${LUA_VER}.pc | LUA_LIB_STATIC=lib${PORTNAME}-${LUA_VER}.a | ||||
LUA_LIB_SHARED=lib${PORTNAME}-${LUA_VER}.so | |||||
LUA_PC_FILE=${PORTNAME}-${LUA_VER}.pc | |||||
# using the "bsd" target rather than "freebsd" saves patching out the | |||||
# assumption of using base libedit in order to make it configurable. "bsd" | |||||
# is "generic" plus the POSIX and DLOPEN options, plus -Wl,-E at link time; | |||||
# it doesn't set CC either, which makes it easier for us to control that too. | |||||
ALL_TARGET=bsd | |||||
# Options | |||||
OPTIONS_DEFAULT+= LIBEDIT DOCS | |||||
Not Done Inline Actions+1 russ.haley_gmail.com: +1 | |||||
OPTIONS_GROUP= DOCSGROUP DEBUGGROUP | |||||
OPTIONS_GROUP_DOCSGROUP= DOCS | |||||
OPTIONS_GROUP_DEBUGGROUP= ASSERT APICHECK | |||||
OPTIONS_SINGLE= EDIT | |||||
Not Done Inline ActionsWould it be wrong of me to add a lua-docs shell script to /usr/local/bin that looks for firefox or chromium and opens readme.html? russ.haley_gmail.com: Would it be wrong of me to add a lua-docs shell script to /usr/local/bin that looks for firefox… | |||||
Not Done Inline ActionsIt ... doesn't seem to be common style as far as I can see. I'm not keen on the idea. andrew_tao173.riddles.org.uk: It ... doesn't seem to be common style as far as I can see. I'm not keen on the idea. | |||||
OPTIONS_SINGLE_EDIT=EDITNONE LIBEDIT LIBEDIT_PORT READLINE | |||||
# Option descriptions | |||||
DEBUGGROUP_DESC = Debugging options | |||||
ASSERT_DESC = Enable interpreter assertions | |||||
APICHECK_DESC = Enable API checks | |||||
DOCSGROUP_DESC = Documentation options | |||||
DOCS_DESC = Install language and API reference (HTML, ~400kB) | |||||
EDIT_DESC = Interactive command-line editing | |||||
EDITNONE_DESC = No command-line editing | |||||
LIBEDIT_DESC = Use base system libedit (recommended) | |||||
LIBEDIT_PORT_DESC=Use libedit from ports | |||||
READLINE_DESC = Use GNU Readline from ports | |||||
# Option implementations | |||||
ASSERT_EXTRA_PATCHES=${PATCHDIR}/extra-patch-assert | |||||
APICHECK_CPPFLAGS=-DLUA_USE_APICHECK | |||||
LIBEDIT_CPPFLAGS=-DLUA_USE_READLINE -I/usr/include/edit | |||||
LIBEDIT_LIBS=-ledit | |||||
LIBEDIT_PORT_USES=libedit | |||||
# USES=libedit adds -I/usr/local/include -L/usr/local/lib itself | |||||
LIBEDIT_PORT_CPPFLAGS=-DLUA_USE_READLINE | |||||
LIBEDIT_PORT_LIBS=-ledit | |||||
READLINE_USES=readline | |||||
# USES=readline adds -I/usr/local/include -L/usr/local/lib itself | |||||
READLINE_CPPFLAGS=-DLUA_USE_READLINE | |||||
READLINE_LIBS=-lreadline | |||||
# end of option vars | |||||
CFLAGS+= -fPIC | |||||
WITHOUT_NO_STRICT_ALIASING=yes | |||||
MAKE_ARGS += CC="${CC}" \ | |||||
MYCFLAGS="${CPPFLAGS} ${CFLAGS}" \ | |||||
MYLDFLAGS="${LDFLAGS}" \ | |||||
MYLIBS="${LIBS}" \ | |||||
LUA_T=${LUA_CMD} \ | |||||
LUAC_T=${LUAC_CMD} \ | |||||
Not Done Inline Actionsoops, typo, should be soname=${PORTNAME}-${LUA_VER}, will fix andrew_tao173.riddles.org.uk: oops, typo, should be soname=${PORTNAME}-${LUA_VER}, will fix | |||||
LUA_A=${LUA_LIB_STATIC} \ | |||||
LUA_SO=${LUA_LIB_SHARED} \ | |||||
LUA_SONAME=${LUA_LIB_SHARED} \ | |||||
TO_BIN="${LUA_CMD} ${LUAC_CMD}" \ | |||||
TO_LIB="${LUA_LIB_SHARED} ${LUA_LIB_STATIC}" \ | |||||
INSTALL_TOP=${STAGEDIR}${PREFIX} \ | |||||
INSTALL_INC=${STAGEDIR}${LUA_INCDIR} \ | |||||
INSTALL_EXEC="${INSTALL_PROGRAM}" | |||||
SUB_FILES= ${LUA_PC_FILE} | |||||
SUB_LIST= version=${PORTVERSION} \ | SUB_LIST= version=${PORTVERSION} \ | ||||
includedir=${LUA_INCDIR} \ | includedir=${LUA_INCDIR} \ | ||||
libdir=${LUA_LIBDIR} \ | libdir=${LUA_LIBDIR} \ | ||||
soname=lua-${LUA_VER} | soname=${PORTNAME}-${LUA_VER} | ||||
CFLAGS+= -fPIC | |||||
post-patch: | post-patch: | ||||
@${REINPLACE_CMD} -e 's,rand *(,random(,g' \ | @${REINPLACE_CMD} -e "/LUA_ROOT/s,/usr/local,${LUA_PREFIX}," \ | ||||
${WRKSRC}/src/lmathlib.c | ${WRKSRC}/src/luaconf.h | ||||
@${REINPLACE_CMD} -e "/LUA_ROOT/s|/usr/local|${LUA_PREFIX}| ; \ | |||||
s,readline/,editline/,g ; \ | |||||
/history\.h/d" \ | |||||
${WRKSRC}/src/luaconf.h ${WRKSRC}/src/lua.c | |||||
post-patch-LIBEDIT_PORT-on: | |||||
@${REINPLACE_CMD} -e "s,readline/,editline/,g ; \ | |||||
/history\.h/d" ${WRKSRC}/src/lua.c | |||||
post-install: | post-install: | ||||
@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/liblua-${LUA_VER}.so | ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/${LUA_LIB_SHARED} | ||||
@${MV} ${STAGEDIR}${PREFIX}/man/man1/lua.1 \ | ${MV} ${STAGEDIR}${PREFIX}/man/man1/lua.1 \ | ||||
${STAGEDIR}${PREFIX}/man/man1/lua53.1 | ${STAGEDIR}${PREFIX}/man/man1/${LUA_CMD}.1 | ||||
@${MV} ${STAGEDIR}${PREFIX}/man/man1/luac.1 \ | ${MV} ${STAGEDIR}${PREFIX}/man/man1/luac.1 \ | ||||
${STAGEDIR}${PREFIX}/man/man1/luac53.1 | ${STAGEDIR}${PREFIX}/man/man1/${LUAC_CMD}.1 | ||||
${INSTALL_DATA} ${WRKDIR}/lua-${LUA_VER}.pc \ | ${INSTALL_DATA} ${WRKDIR}/${LUA_PC_FILE} \ | ||||
${STAGEDIR}${PREFIX}/libdata/pkgconfig | ${STAGEDIR}${PREFIX}/libdata/pkgconfig | ||||
post-install-DOCS-on: | |||||
${MKDIR} ${STAGEDIR}${DOCSDIR} | |||||
${INSTALL_MAN} ${BUILD_WRKDOC}/* ${STAGEDIR}${DOCSDIR}/. | |||||
.include <bsd.port.mk> | .include <bsd.port.mk> |
Please remove all this.