[76094] trunk/dports/lang/lua

and.damore at macports.org and.damore at macports.org
Fri Feb 18 08:08:48 PST 2011


Revision: 76094
          http://trac.macports.org/changeset/76094
Author:   and.damore at macports.org
Date:     2011-02-18 08:08:47 -0800 (Fri, 18 Feb 2011)
Log Message:
-----------
lua: added patch per ticket #27378, added compat_version variable, closing #27378 and #18402

Modified Paths:
--------------
    trunk/dports/lang/lua/Portfile

Added Paths:
-----------
    trunk/dports/lang/lua/files/
    trunk/dports/lang/lua/files/patch-dlopen.diff

Modified: trunk/dports/lang/lua/Portfile
===================================================================
--- trunk/dports/lang/lua/Portfile	2011-02-18 15:53:09 UTC (rev 76093)
+++ trunk/dports/lang/lua/Portfile	2011-02-18 16:08:47 UTC (rev 76094)
@@ -2,7 +2,8 @@
 
 PortSystem          1.0
 name                lua
-version             5.1.4
+set compat_version      5.1
+version             ${compat_version}.4
 categories          lang
 platforms           darwin
 maintainers         pmq openmaintainer
@@ -23,11 +24,19 @@
 test.run            yes
 test.env            DYLD_LIBRARY_PATH=./lib
 
+patchfiles          patch-dlopen.diff
+patch.args          -p1
 post-patch {
     reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/Makefile
     reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/src/luaconf.h
     reinplace "s|/man/man1|/share/man/man1|g" ${worksrcpath}/Makefile
 
+    # reinplace %VERSION% and %COMPAT_VERSION% after applying patch-dlopen.diff
+    reinplace "s|%VERSION%|${version}|g" ${worksrcpath}/Makefile
+    reinplace "s|%VERSION%|${version}|g" ${worksrcpath}/src/Makefile
+    reinplace "s|%COMPAT_VERSION%|${compat_version}|g" ${worksrcpath}/Makefile
+    reinplace "s|%COMPAT_VERSION%|${compat_version}|g" ${worksrcpath}/src/Makefile
+    
     # for the pkgconfig file
     reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/etc/lua.pc
 }

Added: trunk/dports/lang/lua/files/patch-dlopen.diff
===================================================================
--- trunk/dports/lang/lua/files/patch-dlopen.diff	                        (rev 0)
+++ trunk/dports/lang/lua/files/patch-dlopen.diff	2011-02-18 16:08:47 UTC (rev 76094)
@@ -0,0 +1,56 @@
+diff -x .svn -ru work/lua-5.1.4/Makefile lua-5.1.4/Makefile
+--- lua-5.1.4/Makefile	2008-08-12 02:40:48.000000000 +0200
++++ lua-5.1.4/Makefile	2010-11-18 22:30:01.000000000 +0100
+@@ -43,7 +43,7 @@
+ # What to install.
+ TO_BIN= lua luac
+ TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp
+-TO_LIB= liblua.a
++TO_LIB= liblua.%VERSION%.dylib
+ TO_MAN= lua.1 luac.1
+ 
+ # Lua version and release.
+@@ -64,6 +64,8 @@
+ 	cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
+ 	cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
+ 	cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
++	cd $(INSTALL_LIB) && sudo ln -s liblua.%VERSION%.dylib liblua.dylib
++	cd $(INSTALL_LIB) && sudo ln -s liblua.%VERSION%.dylib liblua.%COMPAT_VERSION%.dylib
+ 
+ ranlib:
+ 	cd src && cd $(INSTALL_LIB) && $(RANLIB) $(TO_LIB)
+diff -x .svn -ru work/lua-5.1.4/src/Makefile lua-5.1.4/src/Makefile
+--- lua-5.1.4/src/Makefile	2008-01-19 20:37:58.000000000 +0100
++++ lua-5.1.4/src/Makefile	2010-11-18 22:31:34.000000000 +0100
+@@ -22,7 +22,7 @@
+ 
+ PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
+ 
+-LUA_A=	liblua.a
++LUA_A=	liblua.%VERSION%.dylib
+ CORE_O=	lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \
+ 	lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o  \
+ 	lundump.o lvm.o lzio.o
+@@ -50,9 +50,12 @@
+ $(LUA_A): $(CORE_O) $(LIB_O)
+ 	$(AR) $@ $?
+ 	$(RANLIB) $@
++	$(CC) -dynamiclib -install_name @executable_path/../lib/liblua.%COMPAT_VERSION%.dylib \
++		-compatibility_version %COMPAT_VERSION% -current_version %VERSION% \
++		-o liblua.%VERSION%.dylib $^
+ 
+ $(LUA_T): $(LUA_O) $(LUA_A)
+-	$(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
++	$(CC) -fno-common -DLUA_USE_LINUX -lreadline -L. -llua.%VERSION% lua.c -o lua
+ 
+ $(LUAC_T): $(LUAC_O) $(LUA_A)
+ 	$(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
+@@ -99,7 +102,7 @@
+ 	$(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses"
+ 
+ macosx:
+-	$(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-lreadline"
++	$(MAKE) all MYCFLAGS="-fno-common -DLUA_USE_LINUX" MYLIBS="-lreadline"
+ # use this on Mac OS X 10.3-
+ #	$(MAKE) all MYCFLAGS=-DLUA_USE_MACOSX
+ 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110218/af0d04a4/attachment.html>


More information about the macports-changes mailing list