<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[118448] trunk/dports/lang</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/118448">118448</a></dd>
<dt>Author</dt> <dd>and.damore@macports.org</dd>
<dt>Date</dt> <dd>2014-04-02 08:15:18 -0700 (Wed, 02 Apr 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>port lua51: add new versioned lua 5.1 branch for those libraries relying on 5.1 API</pre>

<h3>Added Paths</h3>
<ul>
<li>trunk/dports/lang/lua51/</li>
<li><a href="#trunkdportslanglua51Portfile">trunk/dports/lang/lua51/Portfile</a></li>
<li>trunk/dports/lang/lua51/files/</li>
<li><a href="#trunkdportslanglua51filespatchMakefilediff">trunk/dports/lang/lua51/files/patch-Makefile.diff</a></li>
<li><a href="#trunkdportslanglua51filespatchetc_luapcdiff">trunk/dports/lang/lua51/files/patch-etc_lua.pc.diff</a></li>
<li><a href="#trunkdportslanglua51filespatchsrc_Makefilediff">trunk/dports/lang/lua51/files/patch-src_Makefile.diff</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportslanglua51Portfile"></a>
<div class="addfile"><h4>Added: trunk/dports/lang/lua51/Portfile (0 => 118448)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/lang/lua51/Portfile                                (rev 0)
+++ trunk/dports/lang/lua51/Portfile        2014-04-02 15:15:18 UTC (rev 118448)
</span><span class="lines">@@ -0,0 +1,85 @@
</span><ins>+# $Id$
+
+PortSystem          1.0
+
+name                lua51
+version             5.1.5
+set abi             [join [lrange [split $version &quot;.&quot;] 0 end-1] &quot;.&quot;]
+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 &quot;s|/usr/local|${prefix}|g&quot; ${worksrcpath}/src/luaconf.h
+    
+    # reinplace %PREFIX% to fix @executable_path, cf. ticket no. 28726
+    reinplace &quot;s|%PREFIX%|${prefix}|g&quot; \
+        ${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=&quot;${configure.cc}&quot; \
+                    LDFLAGS=&quot;${configure.ldflags} [get_canonical_archflags ld]&quot; \
+                    CFLAGS=&quot;${configure.cflags} ${configure.cppflags} [get_canonical_archflags cc]&quot;
+
+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+)*)}
</ins><span class="cx">Property changes on: trunk/dports/lang/lua51/Portfile
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkdportslanglua51filespatchMakefilediff"></a>
<div class="addfile"><h4>Added: trunk/dports/lang/lua51/files/patch-Makefile.diff (0 => 118448)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+--- 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 &amp;&amp; $(MAKE) $@
++        cd src &amp;&amp; $(MAKE) $@ V=${V} R=${R} INSTALL_LIB=${INSTALL_LIB}

+ test:        dummy
+         src/lua test/hello.lua
</ins></span></pre></div>
<a id="trunkdportslanglua51filespatchetc_luapcdiff"></a>
<div class="addfile"><h4>Added: trunk/dports/lang/lua51/files/patch-etc_lua.pc.diff (0 => 118448)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+--- 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)
</ins></span></pre></div>
<a id="trunkdportslanglua51filespatchsrc_Makefilediff"></a>
<div class="addfile"><h4>Added: trunk/dports/lang/lua51/files/patch-src_Makefile.diff (0 => 118448)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+--- 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 &quot;Building static library&quot;
+         $(AR) $@ $(CORE_O) $(LIB_O)        # DLL needs all object files
+         $(RANLIB) $@

++$(LUA_DYLIB): $(CORE_O) $(LIB_O)
++        @echo &quot;Building dylib&quot;
++        $(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=&quot;-Wl,-E -ldl -lreadline -lhistory -lncurses&quot;

+ macosx:
+-        $(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS=&quot;-lreadline&quot;
++        $(MAKE) all MYCFLAGS=&quot;-fno-common -DLUA_USE_LINUX&quot; MYLIBS=&quot;-lreadline&quot;
+ # use this on Mac OS X 10.3-
+ #        $(MAKE) all MYCFLAGS=-DLUA_USE_MACOSX

</ins></span></pre>
</div>
</div>

</body>
</html>