aboutsummaryrefslogtreecommitdiffstats
path: root/lang/lua52
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2014-01-10 16:39:12 +0800
committerBaptiste Daroussin <bapt@FreeBSD.org>2014-01-10 16:39:12 +0800
commit338afcf63879284f2d85d7dc5b79465ff9f3d9d8 (patch)
treed6b09531a442789e8525a4e8b287370832d3337c /lang/lua52
parent4046b0c257c9a93a9cc9fcdfd5ab33ecd7a8397e (diff)
downloadfreebsd-ports-gnome-338afcf63879284f2d85d7dc5b79465ff9f3d9d8.tar.gz
freebsd-ports-gnome-338afcf63879284f2d85d7dc5b79465ff9f3d9d8.tar.zst
freebsd-ports-gnome-338afcf63879284f2d85d7dc5b79465ff9f3d9d8.zip
Add missing lua.pc files (missed in previous commits)
Rework the makefile to use jmmv method from PR which is cleaner than my initial attempt PR: ports/180786 Submitted by: jmmv
Diffstat (limited to 'lang/lua52')
-rw-r--r--lang/lua52/Makefile24
-rw-r--r--lang/lua52/files/lua-5.2.pc.in10
2 files changed, 27 insertions, 7 deletions
diff --git a/lang/lua52/Makefile b/lang/lua52/Makefile
index c10e2bf66436..3c6483bdf64c 100644
--- a/lang/lua52/Makefile
+++ b/lang/lua52/Makefile
@@ -16,8 +16,6 @@ LICENSE= MIT
LUA_VER= 5.2
USES= pkgconfig readline
USE_LDCONFIG= yes
-SUB_FILES= lua-${LUA_VER}.pc
-SUB_LIST= LUA_VERSION=${PORTVERSION}
# Overriding __MAKE_CONF makes sure that we don't re-parse
# /etc/make.conf during do-build, which would jeopardize the build
@@ -43,11 +41,22 @@ MAKE_ARGS+= MYCFLAGS="${CFLAGS} -DLUA_USE_LINUX" \
INSTALL_INC=${STAGEDIR}${PREFIX}/include/lua52 \
INSTALL_EXEC="${INSTALL_PROGRAM}"
-.include <bsd.port.options.mk>
+# 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
+
+SUB_FILES= lua-${LUA_VER}.pc
+SUB_LIST= version=${PORTVERSION} \
+ includedir=${LUA_INCDIR} \
+ libdir=${LUA_LIBDIR} \
+ soname=lua-${LUA_VER}
-.if ${ARCH} == "amd64" || ${ARCH} == "powerpc"
-CFLAGS+= -fPIC
-.endif
+CFLAGS_amd64= -fPIC
+CFLAGS_powerpc= -fPIC
post-patch:
@${REINPLACE_CMD} -e 's,rand *(,random(,g' \
@@ -56,11 +65,12 @@ post-patch:
${WRKSRC}/src/luaconf.h
post-install:
- @${MV} ${WRKDIR}/lua-${LUA_VER}.pc ${STAGEDIR}${PREFIX}/libdata/pkgconfig
@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/liblua-${LUA_VER}.so
@${MV} ${STAGEDIR}${PREFIX}/man/man1/lua.1 \
${STAGEDIR}${PREFIX}/man/man1/lua52.1
@${MV} ${STAGEDIR}${PREFIX}/man/man1/luac.1 \
${STAGEDIR}${PREFIX}/man/man1/luac52.1
+ ${INSTALL_DATA} ${WRKDIR}/lua-${LUA_VER}.pc \
+ ${STAGEDIR}${PREFIX}/libdata/pkgconfig
.include <bsd.port.mk>
diff --git a/lang/lua52/files/lua-5.2.pc.in b/lang/lua52/files/lua-5.2.pc.in
new file mode 100644
index 000000000000..a9c4633ad112
--- /dev/null
+++ b/lang/lua52/files/lua-5.2.pc.in
@@ -0,0 +1,10 @@
+version=%%version%%
+libdir=%%libdir%%
+includedir=%%includedir%%
+soname=%%soname%%
+
+Name: Lua
+Description: An Extensible Extension Language
+Version: ${version}
+Libs: -L${libdir} -l${soname} -lm
+Cflags: -I${includedir}