aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Mk/bsd.lua.mk22
-rw-r--r--lang/lua/Makefile19
-rw-r--r--lang/lua/files/patch-Makefile27
-rw-r--r--lang/lua/files/patch-src-Makefile25
-rw-r--r--lang/lua/pkg-plist4
5 files changed, 58 insertions, 39 deletions
diff --git a/Mk/bsd.lua.mk b/Mk/bsd.lua.mk
index 3e8c9d8f7501..008429d47f94 100644
--- a/Mk/bsd.lua.mk
+++ b/Mk/bsd.lua.mk
@@ -105,6 +105,26 @@
# running.
# USE_LUA_NOT=5.1
#
+# Notes about the integration of lua related ports with bsd.lua.mk:
+# (please read when updating ports referred here, see lang/lua[0-9]*)
+#
+# The lua/tolua ports have to be patched so they can coexist, as the internal
+# application build infrastructure does not handle it automatically. Currently
+# the framework provides variables to the lua ports themselves, so changing
+# some things here won't require changes in lang/{lua,tolua}*.
+#
+# For lua ports: if they install a static library, use the same method for
+# tolua ports, otherwise in addition the libraries have to be symlinked to the
+# common library directory with a versioned name, and linked with the -soname
+# parameter (so when a port links with -L/usr/local/lib/lua51 -llua, it stores
+# the dynamic dependency as the name which figures under /usr/local/lib).
+#
+# For tolua ports: as it is a static library (.a), installing binaries,
+# headers and libraries under a versioned directory is fine (binary has also a
+# symlink).
+#
+# The lua modules install in a separate directory, so there is no problem.
+#
LUA_Include_MAINTAINER= alepulver@FreeBSD.org
@@ -164,7 +184,7 @@ _LUA_PORT_pty_5.0= devel/lua50-pty
_LUA_PORT_socket_5.0= net/lua50-luasocket
_LUA_PORT_lua_5.1= lang/lua
-_LUA_DEPTYPE_lua_5.1= build
+_LUA_DEPTYPE_lua_5.1= lib
_LUA_PORT_filename_5.1= devel/lua-filename
_LUA_PORT_gettext_5.1= devel/lua-gettext
diff --git a/lang/lua/Makefile b/lang/lua/Makefile
index 66eff64e0460..da87c46af150 100644
--- a/lang/lua/Makefile
+++ b/lang/lua/Makefile
@@ -7,7 +7,7 @@
PORTNAME= lua
PORTVERSION= 5.1.3
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= lang
MASTER_SITES= http://www.lua.org/ftp/ \
ftp://ftp.tecgraf.puc-rio.br/pub/lua/ \
@@ -23,7 +23,8 @@ USE_LUA= 5.1
LUA_COMPS= # only define variables
ALL_TARGET= freebsd
USE_GNOME= pkgconfig
-USE_LDCONFIG= ${LUA_LIBDIR}
+USE_LDCONFIG= yes
+MAKE_ENV= LUA_SONAME="liblua-${LUA_VER}.so.${LUA_VER_SH}"
MAN1= lua-${LUA_VER}.1 luac-${LUA_VER}.1
DOCSDIR= ${PREFIX}/share/doc/${LUA_SUBDIR}
@@ -46,7 +47,7 @@ post-patch:
s|^(CFLAGS=)|\1 ${CFLAGS}| ; \
s|/usr/local|${PREFIX}|' \
${WRKSRC}/Makefile ${WRKSRC}/src/Makefile
- @${REINPLACE_CMD} -Ee \
+ @${REINPLACE_CMD} -i '' -Ee \
's|^(prefix=).*|\1 ${PREFIX}| ; \
s|^(libdir=).*|\1 ${LUA_LIBDIR}| ; \
s|^(includedir=).*|\1 ${LUA_INCDIR}| ; \
@@ -55,7 +56,7 @@ post-patch:
s|^(INSTALL_LIB=).*|\1 ${LUA_LIBDIR}| ; \
s|^(INSTALL_CMOD=).*|\1 ${LUA_MODLIBDIR}| ; \
s|^(INSTALL_LMOD=).*|\1 ${LUA_MODSHAREDIR}|' \
- ${WRKSRC}/etc/lua.pc && ${RM} ${WRKSRC}/etc/lua.pc.bak
+ ${WRKSRC}/etc/lua.pc
post-build:
@${RM} -f ${WRKSRC}/test/lua ${WRKSRC}/test/luac
@@ -75,8 +76,13 @@ do-install:
# Libraries.
${MKDIR} ${LUA_LIBDIR}
${INSTALL_DATA} ${WRKSRC}/src/liblua.a ${LUA_LIBDIR}
- ${INSTALL_PROGRAM} ${WRKSRC}/src/liblua.so ${LUA_LIBDIR}/liblua.so.1
- cd ${LUA_LIBDIR} && ${LN} -s liblua.so.1 liblua.so
+ ${INSTALL_PROGRAM} ${WRKSRC}/src/liblua.so \
+ ${LUA_LIBDIR}/liblua-${LUA_VER}.so.${LUA_VER_SH}
+ @${LN} -sf liblua-${LUA_VER}.so.${LUA_VER_SH} ${LUA_LIBDIR}/liblua.so
+ @${LN} -sf ${LUA_SUBDIR}/liblua-${LUA_VER}.so.${LUA_VER_SH} \
+ ${PREFIX}/lib
+ @${LN} -sf liblua-${LUA_VER}.so.${LUA_VER_SH} \
+ ${PREFIX}/lib/liblua-${LUA_VER}.so
# Manual pages.
.for f in ${LUA_MAN}
${INSTALL_MAN} ${WRKSRC}/doc/${f} \
@@ -97,7 +103,6 @@ do-install:
.endfor
.endif
# lua.pc
- ${MKDIR} ${LOCALBASE}/libdata/pkgconfig
${INSTALL_DATA} ${WRKSRC}/etc/lua.pc ${PREFIX}/libdata/pkgconfig/lua-${LUA_VER}.pc
# Module directories.
${MKDIR} ${LUA_MODLIBDIR}
diff --git a/lang/lua/files/patch-Makefile b/lang/lua/files/patch-Makefile
deleted file mode 100644
index 8b46a595bcd5..000000000000
--- a/lang/lua/files/patch-Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
---- src/Makefile.orig 2008-05-29 19:24:46.000000000 +0900
-+++ src/Makefile 2008-05-29 19:27:30.000000000 +0900
-@@ -31,12 +31,13 @@
-
- LUA_T= lua
- LUA_O= lua.o
-+LUA_SO= liblua.so
-
- LUAC_T= luac
- LUAC_O= luac.o print.o
-
- ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O)
--ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
-+ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO)
- ALL_A= $(LUA_A)
-
- default: $(PLAT)
-@@ -47,6 +48,9 @@
-
- a: $(ALL_A)
-
-+$(LUA_SO): $(CORE_O) $(LIB_O)
-+ $(CC) -o $@ $(MYLDFLAGS) -shared $?
-+
- $(LUA_A): $(CORE_O) $(LIB_O)
- $(AR) $@ $?
- $(RANLIB) $@
diff --git a/lang/lua/files/patch-src-Makefile b/lang/lua/files/patch-src-Makefile
index 51b3075c88c8..c0c41025e95f 100644
--- a/lang/lua/files/patch-src-Makefile
+++ b/lang/lua/files/patch-src-Makefile
@@ -1,5 +1,5 @@
---- src/Makefile.orig 2006-03-21 17:41:49.000000000 -0700
-+++ src/Makefile 2008-03-18 09:41:01.000000000 -0600
+--- ./src/Makefile.orig 2008-01-19 17:37:58.000000000 -0200
++++ ./src/Makefile 2008-08-10 16:00:41.000000000 -0300
@@ -9,7 +9,8 @@
CC= gcc
@@ -10,9 +10,28 @@
RANLIB= ranlib
RM= rm -f
LIBS= -lm $(MYLIBS)
-@@ -48,7 +49,7 @@
+@@ -31,12 +32,13 @@
+
+ LUA_T= lua
+ LUA_O= lua.o
++LUA_SO= liblua.so
+
+ LUAC_T= luac
+ LUAC_O= luac.o print.o
+
+ ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O)
+-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
++ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO)
+ ALL_A= $(LUA_A)
+
+ default: $(PLAT)
+@@ -47,8 +49,11 @@
+
a: $(ALL_A)
++$(LUA_SO): $(CORE_O) $(LIB_O)
++ $(CC) -o $@ $(MYLDFLAGS) -shared -Wl,-soname=$(LUA_SONAME) $?
++
$(LUA_A): $(CORE_O) $(LIB_O)
- $(AR) $@ $?
+ $(AR) $(ARFLAGS) $@ $?
diff --git a/lang/lua/pkg-plist b/lang/lua/pkg-plist
index 68844115afd6..5cb722376d49 100644
--- a/lang/lua/pkg-plist
+++ b/lang/lua/pkg-plist
@@ -9,9 +9,11 @@ bin/luac-%%LUA_VER%%
%%LUA_INCDIR%%/lua.hpp
%%LUA_INCDIR%%/luaconf.h
%%LUA_INCDIR%%/lualib.h
+lib/liblua-%%LUA_VER%%.so
+lib/liblua-%%LUA_VER%%.so.%%LUA_VER_SH%%
%%LUA_LIBDIR%%/liblua.a
%%LUA_LIBDIR%%/liblua.so
-%%LUA_LIBDIR%%/liblua.so.1
+%%LUA_LIBDIR%%/liblua-%%LUA_VER%%.so.%%LUA_VER_SH%%
libdata/pkgconfig/lua-%%LUA_VER%%.pc
%%PORTDOCS%%%%DOCSDIR%%/README
%%PORTDOCS%%%%DOCSDIR%%/amazon.gif