1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-18 19:49:40 +00:00
freebsd-ports/lang/lua51/Makefile
Stefan Eßer b7f05445c0 Add WWW entries to port Makefiles
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)
2022-09-07 23:10:59 +02:00

76 lines
2.4 KiB
Makefile

PORTNAME= lua
PORTVERSION= 5.1.5
PORTREVISION= 9
CATEGORIES= lang
MASTER_SITES= http://www.lua.org/ftp/
PKGNAMESUFFIX= 51
MAINTAINER= nicklaus.t@me.com
COMMENT= Small, compilable scripting language providing easy access to C code
WWW= https://www.lua.org/
LICENSE= MIT
USES= cpe libedit lua:core,51
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}
# 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
MAKE_ARGS+= MYCFLAGS="${CFLAGS} ${CPPFLAGS} -DLUA_USE_LINUX" \
MYLDFLAGS="${LDFLAGS}" \
MYLIBS="-Wl,-E -L${LOCALBASE}/lib -ledit" \
CC="${CC}" \
LUA_T=lua51 \
LUAC_T=luac51 \
LUA_A=liblua-${LUA_VER}.a \
LUA_SO=liblua-${LUA_VER}.so \
LUA_SONAME=liblua-${LUA_VER}.so \
TO_BIN="lua51 luac51" \
TO_LIB="liblua-${LUA_VER}.a liblua-${LUA_VER}.so" \
INSTALL_TOP=${STAGEDIR}${PREFIX} \
INSTALL_INC=${STAGEDIR}${PREFIX}/include/lua51 \
INSTALL_EXEC="${INSTALL_PROGRAM}"
CFLAGS+= -fPIC
post-patch:
@${REINPLACE_CMD} -e 's,rand *(,random(,g' \
${WRKSRC}/src/lmathlib.c
@${REINPLACE_CMD} -e "/LUA_ROOT/s|/usr/local|${LUA_PREFIX}| ; \
s,readline/,editline/,g ; \
/history\.h/d" \
${WRKSRC}/src/luaconf.h
@${REINPLACE_CMD} -i '' -Ee \
's|^(prefix=).*|\1 ${PREFIX}| ; \
s|^(libdir=).*|\1 ${LUA_LIBDIR}| ; \
s|^(includedir=).*|\1 ${LUA_INCDIR}| ; \
s|^(INSTALL_BIN=).*|\1 ${LUA_BINDIR}| ; \
s|^(INSTALL_INC=).*|\1 ${LUA_INCDIR}| ; \
s|^(INSTALL_LIB=).*|\1 ${LUA_LIBDIR}| ; \
s|^(INSTALL_CMOD=).*|\1 ${LUA_MODLIBDIR}| ; \
s|^(INSTALL_LMOD=).*|\1 ${LUA_MODSHAREDIR}| ; \
s|llua|llua-${LUA_VER}|' \
${WRKSRC}/etc/lua.pc
post-install:
@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/liblua-${LUA_VER}.so
@${MV} ${STAGEDIR}${PREFIX}/man/man1/lua.1 \
${STAGEDIR}${PREFIX}/man/man1/lua51.1
@${MV} ${STAGEDIR}${PREFIX}/man/man1/luac.1 \
${STAGEDIR}${PREFIX}/man/man1/luac51.1
${INSTALL_DATA} ${WRKSRC}/etc/lua.pc \
${STAGEDIR}${PREFIX}/libdata/pkgconfig/lua-${LUA_VER}.pc
.include <bsd.port.mk>