forked from Lainports/freebsd-ports
It has been common practice to have one or more URLs at the end of the ports' pkg-descr files, one per line and prefixed with "WWW:". These URLs should point at a project website or other relevant resources. Access to these URLs required processing of the pkg-descr files, and they have often become stale over time. If more than one such URL was present in a pkg-descr file, only the first one was tarnsfered into the port INDEX, but for many ports only the last line did contain the port specific URL to further information. There have been several proposals to make a project URL available as a macro in the ports' Makefiles, over time. This commit implements such a proposal and moves one of the WWW: entries of each pkg-descr file into the respective port's Makefile. A heuristic attempts to identify the most relevant URL in case there is more than one WWW: entry in some pkg-descr file. URLs that are not moved into the Makefile are prefixed with "See also:" instead of "WWW:" in the pkg-descr files in order to preserve them. There are 1256 ports that had no WWW: entries in pkg-descr files. These ports will not be touched in this commit. The portlint port has been adjusted to expect a WWW entry in each port Makefile, and to flag any remaining "WWW:" lines in pkg-descr files as deprecated. Approved by: portmgr (tcberner)
148 lines
4.2 KiB
Makefile
148 lines
4.2 KiB
Makefile
PORTNAME= lua
|
|
DISTVERSION= 5.3.6
|
|
CATEGORIES= lang
|
|
MASTER_SITES= https://www.lua.org/ftp/
|
|
PKGNAMESUFFIX= ${LUA_VER_STR}
|
|
|
|
MAINTAINER= russ.haley@gmail.com
|
|
COMMENT= Powerful, efficient, lightweight, embeddable scripting language
|
|
WWW= https://www.lua.org/
|
|
|
|
LICENSE= MIT
|
|
|
|
USES= cpe lua:core,53
|
|
USE_LDCONFIG= yes
|
|
|
|
# Overriding __MAKE_CONF makes sure that we don't re-parse
|
|
# /etc/make.conf during do-build, which would jeopardize the build
|
|
# if, for instance, the user set CFLAGS=mumble
|
|
# NOTE: /etc/make.conf is read BEFORE Makefile, so we already
|
|
# have its settings when we get here.
|
|
# See http://wiki.freebsd.org/MatthiasAndree/LuaLessonsLearnt
|
|
MAKE_ARGS= __MAKE_CONF=${NONEXISTENT}
|
|
|
|
# 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
|
|
|
|
LUA_LIB_STATIC= liblua-${LUA_VER}.a
|
|
LUA_LIB_SHARED= liblua-${LUA_VER}.so
|
|
LUA_PC_FILE= lua-${LUA_VER}.pc
|
|
|
|
CFLAGS+= -fPIC
|
|
# 2019-01-25: -pthread in LIBS is a work around for the following bug:
|
|
# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=235211
|
|
LIBS+= -pthread
|
|
|
|
WITHOUT_NO_STRICT_ALIASING=yes
|
|
|
|
MAKE_ARGS+= CC="${CC}" \
|
|
MYCFLAGS="${CPPFLAGS} ${CFLAGS}" \
|
|
MYLDFLAGS="${LDFLAGS}" \
|
|
MYLIBS="${LIBS}" \
|
|
LUA_T=${LUA_CMD} \
|
|
LUAC_T=${LUAC_CMD} \
|
|
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}"
|
|
|
|
# Source, destination, and filenames to copy for the DOCS option
|
|
# (automatically added to pkg-plist if DOCS is set)
|
|
# We override DOCSDIR to get a per-version subdir.
|
|
# We put the docs for Lua proper in a lua/ subdir of the version subdir
|
|
# so that ports for Lua modules can use the version subdir too without
|
|
# making a mess.
|
|
DOCSDIR= ${LUA_DOCSDIR}
|
|
BUILD_WRKDOC= ${WRKSRC}/doc
|
|
|
|
SUB_FILES= ${LUA_PC_FILE}
|
|
SUB_LIST= version=${PORTVERSION} \
|
|
includedir=${LUA_INCDIR} \
|
|
libdir=${LUA_LIBDIR} \
|
|
soname=lua-${LUA_VER}
|
|
|
|
BUILD_WRKSRC= ${WRKSRC}/src
|
|
|
|
PORTDOCS= *
|
|
|
|
# Options
|
|
|
|
OPTIONS_DEFAULT= LIBEDIT_DL
|
|
|
|
OPTIONS_GROUP= DOCSGRP DEBUGGRP
|
|
OPTIONS_GROUP_DEBUGGRP= ASSERT APICHECK
|
|
OPTIONS_GROUP_DOCSGRP= DOCS
|
|
|
|
OPTIONS_SINGLE= EDITGRP
|
|
OPTIONS_SINGLE_EDITGRP= EDITNONE LIBEDIT_DL LIBEDIT READLINE
|
|
|
|
# Option descriptions
|
|
|
|
APICHECK_DESC= Enable API checks
|
|
ASSERT_DESC= Enable interpreter assertions
|
|
DEBUGGRP_DESC= Debugging options
|
|
|
|
DOCSGRP_DESC= Documentation options
|
|
DOCS_DESC= Install language and API reference (HTML, ~400kB)
|
|
|
|
EDITGRP_DESC= Interactive command-line editing
|
|
EDITNONE_DESC= No command-line editing
|
|
LIBEDIT_DESC= Use libedit (breaks lcurses)
|
|
LIBEDIT_DL_DESC=Use dynamically loaded libedit (recommended)
|
|
READLINE_DESC= Use GNU Readline (breaks lcurses)
|
|
|
|
# Option implementations
|
|
|
|
APICHECK_CPPFLAGS= -DLUA_USE_APICHECK
|
|
ASSERT_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-assert
|
|
|
|
# EDITNONE currently requires no settings
|
|
|
|
LIBEDIT_USES= libedit
|
|
LIBEDIT_CPPFLAGS= -DLUA_USE_READLINE
|
|
LIBEDIT_LIBS= -ledit
|
|
|
|
LIBEDIT_DL_USES= libedit
|
|
LIBEDIT_DL_CPPFLAGS= -DLUA_USE_READLINE_DL
|
|
|
|
READLINE_USES= readline
|
|
READLINE_CPPFLAGS= -DLUA_USE_READLINE
|
|
READLINE_LIBS= -lreadline
|
|
|
|
# end of option vars
|
|
|
|
post-patch:
|
|
@${REINPLACE_CMD} -e "/LUA_ROOT/s,/usr/local,${LUA_PREFIX}," \
|
|
${WRKSRC}/src/luaconf.h
|
|
|
|
post-patch-LIBEDIT-on:
|
|
@${REINPLACE_CMD} -e "s,readline/,editline/,g ; \
|
|
/history\.h/d" ${WRKSRC}/src/lua.c
|
|
|
|
post-patch-LIBEDIT_DL-on:
|
|
@${REINPLACE_CMD} \
|
|
-e "/^#def.*LUA_READLINE_LIBPATH/s,/usr/local,${LOCALBASE}," \
|
|
${WRKSRC}/src/lua.c
|
|
|
|
post-install:
|
|
${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/${LUA_LIB_SHARED}
|
|
${MV} ${STAGEDIR}${PREFIX}/man/man1/lua.1 \
|
|
${STAGEDIR}${PREFIX}/man/man1/${LUA_CMD}.1
|
|
${MV} ${STAGEDIR}${PREFIX}/man/man1/luac.1 \
|
|
${STAGEDIR}${PREFIX}/man/man1/${LUAC_CMD}.1
|
|
${INSTALL_DATA} ${WRKDIR}/${LUA_PC_FILE} \
|
|
${STAGEDIR}${PREFIX}/libdata/pkgconfig
|
|
|
|
post-install-DOCS-on:
|
|
${MKDIR} ${STAGEDIR}${DOCSDIR}
|
|
(cd ${BUILD_WRKDOC} && \
|
|
${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR} '-not -name *\.1')
|
|
|
|
.include <bsd.port.mk>
|