[140262] trunk/dports/lang/lua
mojca at macports.org
mojca at macports.org
Tue Sep 15 09:48:10 PDT 2015
Revision: 140262
https://trac.macports.org/changeset/140262
Author: mojca at macports.org
Date: 2015-09-15 09:48:10 -0700 (Tue, 15 Sep 2015)
Log Message:
-----------
lua52: a new subport of lua
Modified Paths:
--------------
trunk/dports/lang/lua/Portfile
trunk/dports/lang/lua/files/patch-Makefile.diff
trunk/dports/lang/lua/files/patch-src-Makefile.diff
trunk/dports/lang/lua/files/patch-src-luaconf.h.diff
Added Paths:
-----------
trunk/dports/lang/lua/files/5.2/
trunk/dports/lang/lua/files/5.2/COPYRIGHT
trunk/dports/lang/lua/files/5.2/lua.pc
trunk/dports/lang/lua/files/patch-Makefile-52.diff
trunk/dports/lang/lua/files/patch-src-Makefile-52.diff
trunk/dports/lang/lua/files/patch-src-luaconf.h-52.diff
Modified: trunk/dports/lang/lua/Portfile
===================================================================
--- trunk/dports/lang/lua/Portfile 2015-09-15 12:03:36 UTC (rev 140261)
+++ trunk/dports/lang/lua/Portfile 2015-09-15 16:48:10 UTC (rev 140262)
@@ -6,17 +6,15 @@
name lua
conflicts lua50
version 5.3.1
-revision 1
-set branch [join [lrange [split ${version} .] 0 1] .]
+revision 2
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.
+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/
master_sites ${homepage}ftp/
@@ -24,24 +22,34 @@
checksums rmd160 01fcb542ea0a69246c0594bb2578dc108547a49a \
sha256 072767aad6cc2e62044a66e8562f51770d941e972dc1e4068ba719cd8bffac17
+patchfiles patch-Makefile.diff \
+ patch-src-Makefile.diff \
+ patch-src-luaconf.h.diff
+
+# TODO: also add lua50 and lua51 here
+subport lua52 {
+ version 5.2.3
+ revision 0
+ checksums rmd160 b8714669c8c0f8272104effd8a9675921ddb2fa5 \
+ sha256 13c2fb97961381f7d06d5b5cea55b743c163800896fd5c5e2356201d3619002d
+
+ patchfiles patch-Makefile-52.diff \
+ patch-src-Makefile-52.diff \
+ patch-src-luaconf.h-52.diff
+}
+
+set branch [join [lrange [split ${version} .] 0 1] .]
+
depends_lib port:readline
build.target macosx
test.run yes
test.env DYLD_LIBRARY_PATH=./lib
-post-extract {
- xinstall -m 0644 -W ${filespath} COPYRIGHT lua.pc ${worksrcpath}
-}
-
-patchfiles patch-Makefile.diff \
- patch-src-Makefile.diff \
- patch-src-luaconf.h.diff
-
post-patch {
- reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/Makefile ${worksrcpath}/lua.pc ${worksrcpath}/src/Makefile ${worksrcpath}/src/luaconf.h
- reinplace "s|@VERSION@|${version}|g" ${worksrcpath}/Makefile ${worksrcpath}/lua.pc ${worksrcpath}/src/Makefile
- reinplace "s|@BRANCH@|${branch}|g" ${worksrcpath}/Makefile ${worksrcpath}/lua.pc ${worksrcpath}/src/Makefile
+ reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/lua.pc ${worksrcpath}/Makefile ${worksrcpath}/src/Makefile ${worksrcpath}/src/luaconf.h
+ reinplace "s|@VERSION@|${version}|g" ${worksrcpath}/lua.pc ${worksrcpath}/Makefile ${worksrcpath}/src/Makefile
+ reinplace "s|@BRANCH@|${branch}|g" ${worksrcpath}/lua.pc ${worksrcpath}/Makefile ${worksrcpath}/src/Makefile
}
configure {
@@ -54,15 +62,44 @@
destroot.target install INSTALL_TOP=${destroot}${prefix}
post-destroot {
+ # documentation
set docdir ${prefix}/share/doc/${subport}
xinstall -d -m 0755 ${destroot}${docdir}/html
xinstall -m 0644 -W ${worksrcpath} COPYRIGHT README ${destroot}${docdir}
- foreach html [glob ${worksrcpath}/doc/*.html ${worksrcpath}/doc/*.gif] {
+ foreach html [glob ${worksrcpath}/doc/*.html ${worksrcpath}/doc/*.css ${worksrcpath}/doc/*.gif ${worksrcpath}/doc/*.png] {
xinstall -m 0644 ${html} ${destroot}${docdir}/html
}
- xinstall -W ${worksrcpath} -m 0644 lua.pc ${destroot}${prefix}/lib/pkgconfig/
}
+if {$subport eq $name} {
+ post-extract {
+ xinstall -m 0644 -W ${filespath} COPYRIGHT lua.pc ${worksrcpath}
+ }
+
+ post-destroot {
+ xinstall -W ${worksrcpath} -m 0644 lua.pc ${destroot}${prefix}/lib/pkgconfig/
+ }
+} else {
+ post-extract {
+ xinstall -m 0644 -W ${filespath}/${branch} COPYRIGHT lua.pc ${worksrcpath}
+ }
+
+ post-destroot {
+ # version executable and man pages files
+ foreach f [glob ${destroot}${prefix}/bin/*] {
+ move $f ${f}${branch}
+ }
+ foreach f [glob ${destroot}${prefix}/share/man/man1/*] {
+ move $f [file rootname $f]-${branch}[file extension $f]
+ }
+
+ # install versioned pkgconfig file
+ xinstall -d -m 0755 ${destroot}${prefix}/lib/pkgconfig
+ xinstall -m 0644 ${worksrcpath}/lua.pc ${destroot}${prefix}/lib/pkgconfig/lua-${branch}.pc
+ }
+}
+
+# TODO: fixme (a different livecheck is needed for different subports)
livecheck.type regex
livecheck.url ${master_sites}
livecheck.regex {lua-(\d+(?:\.\d+)*)}
Added: trunk/dports/lang/lua/files/5.2/COPYRIGHT
===================================================================
--- trunk/dports/lang/lua/files/5.2/COPYRIGHT (rev 0)
+++ trunk/dports/lang/lua/files/5.2/COPYRIGHT 2015-09-15 16:48:10 UTC (rev 140262)
@@ -0,0 +1,32 @@
+Lua License
+-----------
+
+Lua is licensed under the terms of the MIT license reproduced below.
+This means that Lua is free software and can be used for both academic
+and commercial purposes at absolutely no cost.
+
+For details and rationale, see http://www.lua.org/license.html .
+
+===============================================================================
+
+Copyright (C) 1994-2013 Lua.org, PUC-Rio.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+===============================================================================
Added: trunk/dports/lang/lua/files/5.2/lua.pc
===================================================================
--- trunk/dports/lang/lua/files/5.2/lua.pc (rev 0)
+++ trunk/dports/lang/lua/files/5.2/lua.pc 2015-09-15 16:48:10 UTC (rev 140262)
@@ -0,0 +1,25 @@
+# lua.pc -- pkg-config data for Lua
+
+V= @BRANCH@
+R= @VERSION@
+
+# grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/'
+prefix= @PREFIX@
+INSTALL_BIN= ${prefix}/bin
+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/lua-${V}
+includedir=${prefix}/include/lua-${V}
+
+Name: Lua
+Description: An Extensible Extension Language
+Version: ${R}
+Requires:
+Libs: -L${libdir} -llua-${V} -lm
+Cflags: -I${includedir}
Added: trunk/dports/lang/lua/files/patch-Makefile-52.diff
===================================================================
--- trunk/dports/lang/lua/files/patch-Makefile-52.diff (rev 0)
+++ trunk/dports/lang/lua/files/patch-Makefile-52.diff 2015-09-15 16:48:10 UTC (rev 140262)
@@ -0,0 +1,27 @@
+--- Makefile.orig
++++ Makefile
+@@ -10,11 +10,11 @@
+ # so take care if INSTALL_TOP is not an absolute path. See the local target.
+ # You may want to make INSTALL_LMOD and INSTALL_CMOD consistent with
+ # LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h.
+-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- at BRANCH@
++INSTALL_LIB= $(INSTALL_TOP)/lib/lua- at BRANCH@
++INSTALL_MAN= $(INSTALL_TOP)/share/man/man1
+ INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
+ INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V
+
+@@ -41,7 +41,7 @@
+ # What to install.
+ TO_BIN= lua luac
+ TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
+-TO_LIB= liblua.a
++TO_LIB= liblua- at BRANCH@.a liblua- at BRANCH@.dylib
+ TO_MAN= lua.1 luac.1
+
+ # Lua version and release.
Modified: trunk/dports/lang/lua/files/patch-Makefile.diff
===================================================================
--- trunk/dports/lang/lua/files/patch-Makefile.diff 2015-09-15 12:03:36 UTC (rev 140261)
+++ trunk/dports/lang/lua/files/patch-Makefile.diff 2015-09-15 16:48:10 UTC (rev 140262)
@@ -1,5 +1,5 @@
---- Makefile.orig 2013-11-09 18:49:35.000000000 -0600
-+++ Makefile 2014-03-17 16:17:56.000000000 -0500
+--- Makefile.orig
++++ Makefile
@@ -10,11 +10,11 @@
# so take care if INSTALL_TOP is not an absolute path. See the local target.
# You may want to make INSTALL_LMOD and INSTALL_CMOD consistent with
Added: trunk/dports/lang/lua/files/patch-src-Makefile-52.diff
===================================================================
--- trunk/dports/lang/lua/files/patch-src-Makefile-52.diff (rev 0)
+++ trunk/dports/lang/lua/files/patch-src-Makefile-52.diff 2015-09-15 16:48:10 UTC (rev 140262)
@@ -0,0 +1,55 @@
+--- src/Makefile.orig
++++ src/Makefile
+@@ -28,7 +28,8 @@
+
+ PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
+
+-LUA_A= liblua.a
++LUA_A= liblua- at BRANCH@.a
++LUA_DYLIB= liblua- at BRANCH@.dylib
+ CORE_O= lapi.o lcode.o lctype.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
+@@ -43,8 +44,8 @@
+ LUAC_O= luac.o
+
+ ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
+-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
+-ALL_A= $(LUA_A)
++ALL_T= $(LUA_DYLIB) $(LUA_A) $(LUA_T) $(LUAC_T)
++ALL_A= $(LUA_DYLIB) $(LUA_A)
+
+ # Targets start here.
+ default: $(PLAT)
+@@ -56,14 +57,20 @@
+ a: $(ALL_A)
+
+ $(LUA_A): $(BASE_O)
++ @echo "Building static library"
+ $(AR) $@ $(BASE_O)
+ $(RANLIB) $@
+
++$(LUA_DYLIB): $(BASE_O)
++ @echo "Building dynamic library (dylib)"
++ $(CC) -o $@ $(MYLDFLAGS) -dynamiclib -install_name @PREFIX@/lib/lua- at BRANCH@/liblua- at BRANCH@.dylib \
++ -compatibility_version @BRANCH@ -current_version @VERSION@ $^
++
+ $(LUA_T): $(LUA_O) $(LUA_A)
+- $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
++ $(CC) -o $@ -L. $(MYLDFLAGS) $(MYCFLAGS) $(LIBS) -llua- at BRANCH@ lua.c
+
+ $(LUAC_T): $(LUAC_O) $(LUA_A)
+- $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
++ $(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_DYLIB) $(LIBS)
+
+ clean:
+ $(RM) $(ALL_T) $(ALL_O)
+@@ -106,7 +113,7 @@
+ $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline"
+
+ macosx:
+- $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline" CC=cc
++ $(MAKE) $(ALL) SYSCFLAGS="-fno-common -DLUA_USE_MACOSX" SYSLIBS="-lreadline"
+
+ mingw:
+ $(MAKE) "LUA_A=lua52.dll" "LUA_T=lua.exe" \
Modified: trunk/dports/lang/lua/files/patch-src-Makefile.diff
===================================================================
--- trunk/dports/lang/lua/files/patch-src-Makefile.diff 2015-09-15 12:03:36 UTC (rev 140261)
+++ trunk/dports/lang/lua/files/patch-src-Makefile.diff 2015-09-15 16:48:10 UTC (rev 140262)
@@ -1,5 +1,5 @@
---- src/Makefile.orig 2015-05-27 04:10:11.000000000 -0700
-+++ src/Makefile 2015-09-13 07:24:00.000000000 -0700
+--- src/Makefile.orig
++++ src/Makefile
@@ -7,7 +7,7 @@
PLAT= none
Added: trunk/dports/lang/lua/files/patch-src-luaconf.h-52.diff
===================================================================
--- trunk/dports/lang/lua/files/patch-src-luaconf.h-52.diff (rev 0)
+++ trunk/dports/lang/lua/files/patch-src-luaconf.h-52.diff 2015-09-15 16:48:10 UTC (rev 140262)
@@ -0,0 +1,11 @@
+--- src/luaconf.h.orig
++++ src/luaconf.h
+@@ -100,7 +100,7 @@
+ #else /* }{ */
+
+ #define LUA_VDIR LUA_VERSION_MAJOR "." LUA_VERSION_MINOR "/"
+-#define LUA_ROOT "/usr/local/"
++#define LUA_ROOT "@PREFIX@/"
+ #define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR
+ #define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR
+ #define LUA_PATH_DEFAULT \
Modified: trunk/dports/lang/lua/files/patch-src-luaconf.h.diff
===================================================================
--- trunk/dports/lang/lua/files/patch-src-luaconf.h.diff 2015-09-15 12:03:36 UTC (rev 140261)
+++ trunk/dports/lang/lua/files/patch-src-luaconf.h.diff 2015-09-15 16:48:10 UTC (rev 140262)
@@ -1,5 +1,5 @@
---- src/luaconf.h.orig 2015-05-21 02:39:23.000000000 +0900
-+++ src/luaconf.h 2015-09-11 08:34:44.000000000 +0900
+--- src/luaconf.h.orig
++++ src/luaconf.h
@@ -188,7 +188,7 @@
#else /* }{ */
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150915/86b3cf6f/attachment.html>
More information about the macports-changes
mailing list