[118448] trunk/dports/lang

and.damore at macports.org and.damore at macports.org
Wed Apr 2 08:15:18 PDT 2014


Revision: 118448
          https://trac.macports.org/changeset/118448
Author:   and.damore at macports.org
Date:     2014-04-02 08:15:18 -0700 (Wed, 02 Apr 2014)
Log Message:
-----------
port lua51: add new versioned lua 5.1 branch for those libraries relying on 5.1 API

Added Paths:
-----------
    trunk/dports/lang/lua51/
    trunk/dports/lang/lua51/Portfile
    trunk/dports/lang/lua51/files/
    trunk/dports/lang/lua51/files/patch-Makefile.diff
    trunk/dports/lang/lua51/files/patch-etc_lua.pc.diff
    trunk/dports/lang/lua51/files/patch-src_Makefile.diff

Added: trunk/dports/lang/lua51/Portfile
===================================================================
--- trunk/dports/lang/lua51/Portfile	                        (rev 0)
+++ trunk/dports/lang/lua51/Portfile	2014-04-02 15:15:18 UTC (rev 118448)
@@ -0,0 +1,85 @@
+# $Id$
+
+PortSystem          1.0
+
+name                lua51
+version             5.1.5
+set abi             [join [lrange [split $version "."] 0 end-1] "."]
+categories          lang
+license             MIT
+platforms           darwin
+maintainers         nomaintainer
+description         powerful, lightweight programming language
+long_description    \
+    Lua is a powerful, light-weight programming language designed for \
+    extending applications. Lua is also frequently used as a general-purpose, \
+    standalone language.
+
+homepage            http://www.lua.org
+distname            lua-${version}
+master_sites        ${homepage}/ftp/
+
+checksums           sha1    b3882111ad02ecc6b972f8c1241647905cb2e3fc \
+                    rmd160  b0c2234675335a8bf158a125b6778cf800c754a0
+
+depends_lib         port:readline
+
+test.run            yes
+test.env            DYLD_LIBRARY_PATH=./lib
+
+patchfiles          patch-Makefile.diff \
+                    patch-src_Makefile.diff \
+                    patch-etc_lua.pc.diff
+
+post-patch {
+    reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/src/luaconf.h
+    
+    # reinplace %PREFIX% to fix @executable_path, cf. ticket no. 28726
+    reinplace "s|%PREFIX%|${prefix}|g" \
+        ${worksrcpath}/Makefile \
+        ${worksrcpath}/src/Makefile \
+        ${worksrcpath}/etc/lua.pc
+}
+
+use_configure       no
+
+build.target        macosx
+build.args-append   V=${abi} \
+                    R=${version} \
+                    PREFIX=${prefix} \
+                    CC="${configure.cc}" \
+                    LDFLAGS="${configure.ldflags} [get_canonical_archflags ld]" \
+                    CFLAGS="${configure.cflags} ${configure.cppflags} [get_canonical_archflags cc]"
+
+use_parallel_build  no
+
+destroot.post_args-append   INSTALL_TOP=${destroot}${prefix}
+post-destroot {
+    #  install docs
+    xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}
+    xinstall -m 0644 -W ${worksrcpath} COPYRIGHT HISTORY README \
+             ${destroot}${prefix}/share/doc/${name}
+    foreach f [glob ${worksrcpath}/doc/*] {
+        xinstall -m 0644 $f ${destroot}${prefix}/share/doc/${name}
+    }
+        
+    #  install test and etc stuff in shared/${name}
+    xinstall -d -m 0755 ${destroot}${prefix}/share/examples
+    copy ${worksrcpath}/test ${destroot}${prefix}/share/examples/${name}
+
+    #  version executable and man pages files
+    foreach f [glob ${destroot}${prefix}/bin/*] {
+        move $f ${f}${abi}
+    }
+    foreach f [glob ${destroot}${prefix}/share/man/man1/*] {
+        move $f [file rootname $f]-${abi}[file extension $f]
+    }
+
+    #  install versioned pkgconfig file
+    xinstall -d -m 0755 ${destroot}${prefix}/lib/pkgconfig
+    xinstall -m 0644 ${worksrcpath}/etc/lua.pc ${destroot}${prefix}/lib/pkgconfig/lua-${abi}.pc
+}
+
+livecheck.type  regex
+livecheck.url   ${master_sites}
+livecheck.regex {lua-(\d+(?:\.\d+)*)}


Property changes on: trunk/dports/lang/lua51/Portfile
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

Added: trunk/dports/lang/lua51/files/patch-Makefile.diff
===================================================================
--- trunk/dports/lang/lua51/files/patch-Makefile.diff	                        (rev 0)
+++ trunk/dports/lang/lua51/files/patch-Makefile.diff	2014-04-02 15:15:18 UTC (rev 118448)
@@ -0,0 +1,36 @@
+--- Makefile.orig	2014-04-02 16:29:20.000000000 +0200
++++ Makefile	2014-04-02 16:35:02.000000000 +0200
+@@ -9,11 +9,11 @@
+ 
+ # Where to install. The installation starts in the src and doc directories,
+ # so take care if INSTALL_TOP is not an absolute path.
+-INSTALL_TOP= /usr/local
++INSTALL_TOP= %PREFIX%
+ INSTALL_BIN= $(INSTALL_TOP)/bin
+-INSTALL_INC= $(INSTALL_TOP)/include
+-INSTALL_LIB= $(INSTALL_TOP)/lib
+-INSTALL_MAN= $(INSTALL_TOP)/man/man1
++INSTALL_INC= $(INSTALL_TOP)/include/lua-${V}
++INSTALL_LIB= $(INSTALL_TOP)/lib/lua-${V}
++INSTALL_MAN= $(INSTALL_TOP)/share/man/man1
+ #
+ # You probably want to make INSTALL_LMOD and INSTALL_CMOD consistent with
+ # LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h (and also with etc/lua.pc).
+@@ -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.${R}.a liblua.${R}.dylib
+ TO_MAN= lua.1 luac.1
+ 
+ # Lua version and release.
+@@ -53,7 +53,7 @@
+ all:	$(PLAT)
+ 
+ $(PLATS) clean:
+-	cd src && $(MAKE) $@
++	cd src && $(MAKE) $@ V=${V} R=${R} INSTALL_LIB=${INSTALL_LIB}
+ 
+ test:	dummy
+ 	src/lua test/hello.lua

Added: trunk/dports/lang/lua51/files/patch-etc_lua.pc.diff
===================================================================
--- trunk/dports/lang/lua51/files/patch-etc_lua.pc.diff	                        (rev 0)
+++ trunk/dports/lang/lua51/files/patch-etc_lua.pc.diff	2014-04-02 15:15:18 UTC (rev 118448)
@@ -0,0 +1,33 @@
+--- etc/lua.pc.orig	2014-04-02 16:29:34.000000000 +0200
++++ etc/lua.pc	2014-04-02 16:35:23.000000000 +0200
+@@ -8,24 +8,24 @@
+ R= 5.1.5
+ 
+ # grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/'
+-prefix= /usr/local
++prefix= %PREFIX%
+ INSTALL_BIN= ${prefix}/bin
+-INSTALL_INC= ${prefix}/include
+-INSTALL_LIB= ${prefix}/lib
++INSTALL_INC= ${prefix}/include/lua-${V}
++INSTALL_LIB= ${prefix}/lib/lua-${V}
+ INSTALL_MAN= ${prefix}/man/man1
+ INSTALL_LMOD= ${prefix}/share/lua/${V}
+ INSTALL_CMOD= ${prefix}/lib/lua/${V}
+ 
+ # canonical vars
+ exec_prefix=${prefix}
+-libdir=${exec_prefix}/lib
+-includedir=${prefix}/include
++libdir=${exec_prefix}/lib/lua-${V}
++includedir=${prefix}/include/lua-${V}
+ 
+ Name: Lua
+ Description: An Extensible Extension Language
+ Version: ${R}
+ Requires: 
+-Libs: -L${libdir} -llua -lm
++Libs: -L${libdir} -llua-${R} -lm
+ Cflags: -I${includedir}
+ 
+ # (end of lua.pc)

Added: trunk/dports/lang/lua51/files/patch-src_Makefile.diff
===================================================================
--- trunk/dports/lang/lua51/files/patch-src_Makefile.diff	                        (rev 0)
+++ trunk/dports/lang/lua51/files/patch-src_Makefile.diff	2014-04-02 15:15:18 UTC (rev 118448)
@@ -0,0 +1,48 @@
+--- src/Makefile.orig	2014-04-02 16:52:31.000000000 +0200
++++ src/Makefile	2014-04-02 16:50:47.000000000 +0200
+@@ -22,7 +22,8 @@
+ 
+ PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
+ 
+-LUA_A=	liblua.a
++LUA_A=	liblua.${R}.a 
++LUA_DYLIB= liblua.${R}.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
+@@ -36,8 +37,8 @@
+ 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_A= $(LUA_A)
++ALL_T= $(LUA_A) $(LUA_DYLIB) $(LUA_T) $(LUAC_T)
++ALL_A= $(LUA_A) $(LUA_DYLIB)
+ 
+ default: $(PLAT)
+ 
+@@ -48,9 +49,15 @@
+ a:	$(ALL_A)
+ 
+ $(LUA_A): $(CORE_O) $(LIB_O)
++	@echo "Building static library"
+ 	$(AR) $@ $(CORE_O) $(LIB_O)	# DLL needs all object files
+ 	$(RANLIB) $@
+ 
++$(LUA_DYLIB): $(CORE_O) $(LIB_O)
++	@echo "Building dylib"
++	$(CC) -o $@ $(MYLDFLAGS) -dynamiclib -install_name ${INSTALL_LIB}/$@ \
++		-compatibility_version ${V} -current_version ${R} $^
++
+ $(LUA_T): $(LUA_O) $(LUA_A)
+ 	$(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
+ 
+@@ -99,7 +106,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: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140402/b695e779/attachment-0001.html>


More information about the macports-changes mailing list