From ec14c98f3d79ad90731483bfd02b20ab2d05ef7c Mon Sep 17 00:00:00 2001 From: Peter Aronoff Date: Fri, 23 Dec 2011 12:14:28 -0500 Subject: Add option for advanced readline support in Lua Lua can be patched to provide better readline support.[1] On OSX the patch will use libedit. I am new to Lua, so I can't say how popular this patch is, but it builds cleanly and easily with Homebrew, and I'm already finding that it makes Lua's REPL much more friendly. [1] See http://lua-users.org/wiki/LuaPowerPatches, under 'Advanced readline support'. Closes #9255. Signed-off-by: Misty De Meo --- Library/Formula/lua.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'Library/Formula') diff --git a/Library/Formula/lua.rb b/Library/Formula/lua.rb index 75e2a3818..0c7706656 100644 --- a/Library/Formula/lua.rb +++ b/Library/Formula/lua.rb @@ -14,9 +14,18 @@ class Lua < Formula # Be sure to build a dylib, or else runtime modules will pull in another static copy of liblua = crashy # See: https://github.com/mxcl/homebrew/pull/5043 def patches - DATA + # completion provided by advanced readline power patch from + # http://lua-users.org/wiki/LuaPowerPatches + if ARGV.include? '--completion' + [DATA, 'http://luajit.org/patches/lua-5.1.4-advanced_readline.patch'] + else + DATA + end end + def options + [['--completion', 'Enables advanced readline support']] + end def install # Apply patch-level 2 -- cgit v1.2.3