Lua: take 5.1.4-3 patch from MacPorts

Closes Homebrew/homebrew#10790.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
This commit is contained in:
Luke Campbell 2012-03-08 09:09:30 -05:00 committed by Adam Vandenberg
parent 0838e01321
commit 29a9135a58

View file

@ -1,8 +1,8 @@
require 'formula'
class Lua < Formula
url 'http://www.lua.org/ftp/lua-5.1.4.tar.gz'
homepage 'http://www.lua.org/'
url 'http://www.lua.org/ftp/lua-5.1.4.tar.gz'
md5 'd0870f2de55d59c1c8419f36e8fac150'
fails_with_llvm "Lua itself compiles with LLVM, but may fail when other software tries to link.",
@ -11,25 +11,25 @@ class Lua < Formula
# Skip cleaning both empty folders and bin/libs so external symbols still work.
skip_clean :all
# 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
# 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
# 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
p = [DATA]
# completion provided by advanced readline power patch from
# http://lua-users.org/wiki/LuaPowerPatches
if ARGV.include? '--completion'
p << 'http://luajit.org/patches/lua-5.1.4-advanced_readline.patch'
end
p
end
def install
# Apply patch-level 2
curl "http://www.lua.org/ftp/patch-lua-5.1.4-3", "-O"
curl "https://trac.macports.org/export/90538/trunk/dports/lang/lua/files/patch-lua-5.1.4-3", "-O"
safe_system '/usr/bin/patch', '-d', 'src', '-i', '../patch-lua-5.1.4-3'
# we could use the patches method if it supported additional arguments (-d in our case)