Revision
112730
Author
and.damore@macports.org
Date
2013-10-30 01:08:58 -0700 (Wed, 30 Oct 2013)

Log Message

port luash: fixes for lua 5.2 changes in API, ticket #40552

Modified Paths

Added Paths

Diff

Modified: trunk/dports/shells/luash/Portfile (112729 => 112730)


--- trunk/dports/shells/luash/Portfile	2013-10-30 06:22:17 UTC (rev 112729)
+++ trunk/dports/shells/luash/Portfile	2013-10-30 08:08:58 UTC (rev 112730)
@@ -5,7 +5,7 @@
 
 name                    luash
 version                 0.9
-revision                1
+revision                2
 license                 AGPL-3+
 categories              shells lua
 maintainers             and.damore openmaintainer
@@ -21,7 +21,12 @@
                         rmd160  165d88850e8d068d7586f1785b36dd20c9c8ce37
 
 use_bzip2               yes
-patchfiles              patch-makefile.diff
+# patch for luash.lua addresses a change in API for os.execute() in 5.2
+# remove it if a lua51 port is introduced and used to compile luash
+patchfiles              patch-makefile.diff \
+                        patch-luash_lua.diff
+
+
 use_configure           no
 
 variant universal {}
@@ -29,6 +34,10 @@
 depends_lib             port:lua \
                         port:lua-luafilesystem
 
+post-patch {
+    reinplace "s|lua_open|luaL_newstate|" ${worksrcpath}/luash.cpp
+}
+
 build.args-append       CXX=${configure.cxx} \
                         CXX_FLAGS="${configure.cxxflags} [get_canonical_archflags cxx]"
 

Added: trunk/dports/shells/luash/files/patch-luash_lua.diff (0 => 112730)


--- trunk/dports/shells/luash/files/patch-luash_lua.diff	                        (rev 0)
+++ trunk/dports/shells/luash/files/patch-luash_lua.diff	2013-10-30 08:08:58 UTC (rev 112730)
@@ -0,0 +1,11 @@
+--- luash.lua.orig	2013-10-30 09:02:38.000000000 +0100
++++ luash.lua	2013-10-30 09:02:58.000000000 +0100
+@@ -58,7 +58,7 @@
+ 				  if h ~= nil then
+ 				    return h
+ 				  end
+-				  if os.execute("which " .. key .. " &> /dev/null") == 0 then
++				  if os.execute("which " .. key .. " &> /dev/null") then
+ 				    return  function(...)
+ 					      if #{...} == 0 then
+ 						return runner(key)