diff options
| author | John Calsbeek | 2012-08-28 22:30:38 -0700 |
|---|---|---|
| committer | Jack Nagel | 2012-08-29 09:47:54 -0500 |
| commit | 894f668a85a7eff094fab51c927f31f4eb256acf (patch) | |
| tree | b88121d9e73f88fa452995b298f99c574d095cf5 /Library/Formula | |
| parent | 44ab88f76d7ec4df52bb625a3759362d3eddaed6 (diff) | |
| download | homebrew-894f668a85a7eff094fab51c927f31f4eb256acf.tar.bz2 | |
Lua 5.2.1
Closes #14512.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/lua.rb | 84 |
1 files changed, 35 insertions, 49 deletions
diff --git a/Library/Formula/lua.rb b/Library/Formula/lua.rb index 32b8d261e..20b196e5d 100644 --- a/Library/Formula/lua.rb +++ b/Library/Formula/lua.rb @@ -2,8 +2,8 @@ require 'formula' class Lua < Formula homepage 'http://www.lua.org/' - url 'http://www.lua.org/ftp/lua-5.1.4.tar.gz' - md5 'd0870f2de55d59c1c8419f36e8fac150' + url 'http://www.lua.org/ftp/lua-5.2.1.tar.gz' + sha1 '6bb1b0a39b6a5484b71a83323c690154f86b2021' fails_with :llvm do build 2326 @@ -22,103 +22,89 @@ class Lua < Formula # completion provided by advanced readline power patch from # http://lua-users.org/wiki/LuaPowerPatches if build.include? 'completion' - p << 'http://luajit.org/patches/lua-5.1.4-advanced_readline.patch' + p << 'http://luajit.org/patches/lua-5.2.0-advanced_readline.patch' end p end def install - # Apply patch-level 2 - 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) - # Use our CC/CFLAGS to compile. inreplace 'src/Makefile' do |s| s.remove_make_var! 'CC' - s.change_make_var! 'CFLAGS', "#{ENV.cflags} $(MYCFLAGS)" + s.change_make_var! 'CFLAGS', "#{ENV.cflags} -DLUA_COMPAT_ALL $(SYSCFLAGS) $(MYCFLAGS)" s.change_make_var! 'MYLDFLAGS', ENV.ldflags end # Fix path in the config header inreplace 'src/luaconf.h', '/usr/local', HOMEBREW_PREFIX - # Fix paths in the .pc - inreplace 'etc/lua.pc' do |s| - s.gsub! "prefix= /usr/local", "prefix=#{HOMEBREW_PREFIX}" - s.gsub! "INSTALL_MAN= ${prefix}/man/man1", "INSTALL_MAN= ${prefix}/share/man/man1" - end - - # this ensures that this symlinking for lua starts at lib/lua/5.1 and not + # this ensures that this symlinking for lua starts at lib/lua/5.2 and not # below that, thus making luarocks work (HOMEBREW_PREFIX/"lib/lua"/version.to_s.split('.')[0..1].join('.')).mkpath system "make", "macosx", "INSTALL_TOP=#{prefix}", "INSTALL_MAN=#{man1}" system "make", "install", "INSTALL_TOP=#{prefix}", "INSTALL_MAN=#{man1}" - - (lib+"pkgconfig").install 'etc/lua.pc' end end __END__ diff --git a/Makefile b/Makefile -index 6e78f66..6b48d2b 100644 +index bd9515f..5940ba9 100644 --- a/Makefile +++ b/Makefile -@@ -43,7 +43,7 @@ PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris +@@ -41,7 +41,7 @@ PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris # What to install. TO_BIN= lua luac - TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp + TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp -TO_LIB= liblua.a -+TO_LIB= liblua.5.1.4.dylib ++TO_LIB= liblua.5.2.1.dylib TO_MAN= lua.1 luac.1 # Lua version and release. -@@ -64,6 +64,8 @@ install: dummy +@@ -63,6 +63,8 @@ install: dummy cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC) cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB) cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN) -+ ln -s -f liblua.5.1.4.dylib $(INSTALL_LIB)/liblua.5.1.dylib -+ ln -s -f liblua.5.1.dylib $(INSTALL_LIB)/liblua.dylib ++ ln -s -f liblua.5.2.1.dylib $(INSTALL_LIB)/liblua.5.2.dylib ++ ln -s -f liblua.5.2.dylib $(INSTALL_LIB)/liblua.dylib - ranlib: - cd src && cd $(INSTALL_LIB) && $(RANLIB) $(TO_LIB) + uninstall: + cd src && cd $(INSTALL_BIN) && $(RM) $(TO_BIN) diff --git a/src/Makefile b/src/Makefile -index e4a3cd6..e35a1b5 100644 +index 8c9ee67..7f92407 100644 --- a/src/Makefile +++ b/src/Makefile -@@ -22,7 +22,7 @@ MYLIBS= +@@ -28,7 +28,7 @@ MYOBJS= PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris -LUA_A= liblua.a -+LUA_A= liblua.5.1.4.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 -@@ -48,11 +48,13 @@ o: $(ALL_O) ++LUA_A= liblua.5.2.1.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 +@@ -56,11 +56,12 @@ o: $(ALL_O) a: $(ALL_A) - $(LUA_A): $(CORE_O) $(LIB_O) -- $(AR) $@ $? + $(LUA_A): $(BASE_O) +- $(AR) $@ $(BASE_O) - $(RANLIB) $@ -+ $(CC) -dynamiclib -install_name HOMEBREW_PREFIX/lib/liblua.5.1.dylib \ -+ -compatibility_version 5.1 -current_version 5.1.4 \ -+ -o liblua.5.1.4.dylib $^ ++ $(CC) -dynamiclib -install_name HOMEBREW_PREFIX/lib/liblua.5.2.dylib \ ++ -compatibility_version 5.2 -current_version 5.2.1 \ ++ -o liblua.5.2.1.dylib $^ $(LUA_T): $(LUA_O) $(LUA_A) -- $(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) -+ $(CC) -fno-common $(MYLDFLAGS) \ -+ -o $@ $(LUA_O) $(LUA_A) -L. -llua.5.1.4 $(LIBS) +- $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) ++ $(CC) -fno-common $(MYLDFLAGS) -o $@ $(LUA_O) $(LUA_A) -L. -llua.5.2.1 $(LIBS) $(LUAC_T): $(LUAC_O) $(LUA_A) - $(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS) -@@ -99,7 +101,7 @@ linux: - $(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses" + $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS) +@@ -106,7 +107,7 @@ linux: + $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline -lncurses" macosx: -- $(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-lreadline" -+ $(MAKE) all MYCFLAGS="-DLUA_USE_LINUX -fno-common" MYLIBS="-lreadline" - # use this on Mac OS X 10.3- - # $(MAKE) all MYCFLAGS=-DLUA_USE_MACOSX +- $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline" ++ $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX -fno-common" SYSLIBS="-lreadline" + mingw: + $(MAKE) "LUA_A=lua52.dll" "LUA_T=lua.exe" \ |
