lua 5.4.1

master
carlocab 2020-12-01 12:26:44 +00:00 committed by Francois-Xavier Coudert
parent 88132eb4a1
commit 7f73e7947a
3 changed files with 42 additions and 44 deletions

View File

@ -1,10 +1,9 @@
class Lua < Formula class Lua < Formula
desc "Powerful, lightweight programming language" desc "Powerful, lightweight programming language"
homepage "https://www.lua.org/" homepage "https://www.lua.org/"
url "https://www.lua.org/ftp/lua-5.3.5.tar.gz" url "https://www.lua.org/ftp/lua-5.4.1.tar.gz"
sha256 "0c2eed3f960446e1a3e4b9a1ca2f3ff893b6ce41942cf54d5dd59ab4b3b058ac" sha256 "4ba786c3705eb9db6567af29c91a01b81f1c0ac3124fdbf6cd94bdd9e53cca7d"
license "MIT" license "MIT"
revision 1
livecheck do livecheck do
url "https://www.lua.org/ftp/" url "https://www.lua.org/ftp/"
@ -38,7 +37,7 @@ class Lua < Formula
inreplace "src/Makefile" do |s| inreplace "src/Makefile" do |s|
s.gsub! "@LUA_PREFIX@", prefix s.gsub! "@LUA_PREFIX@", prefix
s.remove_make_var! "CC" s.remove_make_var! "CC"
s.change_make_var! "CFLAGS", "#{ENV.cflags} -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS)" s.change_make_var! "CFLAGS", "#{ENV.cflags} -DLUA_COMPAT_5_3 $(SYSCFLAGS) $(MYCFLAGS)"
s.change_make_var! "MYLDFLAGS", ENV.ldflags s.change_make_var! "MYLDFLAGS", ENV.ldflags
end end
@ -51,19 +50,19 @@ class Lua < Formula
(lib/"pkgconfig/lua.pc").write pc_file (lib/"pkgconfig/lua.pc").write pc_file
# Fix some software potentially hunting for different pc names. # Fix some software potentially hunting for different pc names.
bin.install_symlink "lua" => "lua5.3" bin.install_symlink "lua" => "lua#{version.major_minor}"
bin.install_symlink "lua" => "lua-5.3" bin.install_symlink "lua" => "lua-#{version.major_minor}"
bin.install_symlink "luac" => "luac5.3" bin.install_symlink "luac" => "luac#{version.major_minor}"
bin.install_symlink "luac" => "luac-5.3" bin.install_symlink "luac" => "luac-#{version.major_minor}"
(include/"lua5.3").install_symlink Dir[include/"lua/*"] (include/"lua#{version.major_minor}").install_symlink Dir[include/"lua/*"]
lib.install_symlink "liblua.5.3.dylib" => "liblua5.3.dylib" lib.install_symlink "liblua.#{version.major_minor}.dylib" => "liblua#{version.major_minor}.dylib"
(lib/"pkgconfig").install_symlink "lua.pc" => "lua5.3.pc" (lib/"pkgconfig").install_symlink "lua.pc" => "lua#{version.major_minor}.pc"
(lib/"pkgconfig").install_symlink "lua.pc" => "lua-5.3.pc" (lib/"pkgconfig").install_symlink "lua.pc" => "lua-#{version.major_minor}.pc"
end end
def pc_file def pc_file
<<~EOS <<~EOS
V= 5.3 V= #{version.major_minor}
R= #{version} R= #{version}
prefix=#{HOMEBREW_PREFIX} prefix=#{HOMEBREW_PREFIX}
INSTALL_BIN= ${prefix}/bin INSTALL_BIN= ${prefix}/bin
@ -93,68 +92,68 @@ class Lua < Formula
end end
test do test do
system "#{bin}/lua", "-e", "print ('Ducks are cool')" assert_match "Homebrew is awesome!", shell_output("#{bin}/lua -e \"print ('Homebrew is awesome!')\"")
end end
end end
__END__ __END__
diff --git a/Makefile b/Makefile diff --git a/Makefile b/Makefile
index 7fa91c8..a825198 100644 index 1797df9..2f80d16 100644
--- a/Makefile --- a/Makefile
+++ b/Makefile +++ b/Makefile
@@ -41,7 +41,7 @@ PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris @@ -41,7 +41,7 @@ PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix
# What to install. # What to install.
TO_BIN= lua luac TO_BIN= lua luac
TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
-TO_LIB= liblua.a -TO_LIB= liblua.a
+TO_LIB= liblua.5.3.5.dylib +TO_LIB= liblua.5.4.1.dylib
TO_MAN= lua.1 luac.1 TO_MAN= lua.1 luac.1
# Lua version and release. # Lua version and release.
@@ -63,6 +63,8 @@ install: dummy @@ -60,6 +60,8 @@ install: dummy
cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC) cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB) cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN) cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
+ ln -s -f liblua.5.3.5.dylib $(INSTALL_LIB)/liblua.5.3.dylib + ln -s -f liblua.5.4.1.dylib $(INSTALL_LIB)/liblua.5.4.dylib
+ ln -s -f liblua.5.3.dylib $(INSTALL_LIB)/liblua.dylib + ln -s -f liblua.5.4.dylib $(INSTALL_LIB)/liblua.dylib
uninstall: uninstall:
cd src && cd $(INSTALL_BIN) && $(RM) $(TO_BIN) cd src && cd $(INSTALL_BIN) && $(RM) $(TO_BIN)
diff --git a/src/Makefile b/src/Makefile diff --git a/src/Makefile b/src/Makefile
index 2e7a412..d0c4898 100644 index 514593d..90c78b8 100644
--- a/src/Makefile --- a/src/Makefile
+++ b/src/Makefile +++ b/src/Makefile
@@ -28,7 +28,7 @@ MYOBJS= @@ -32,7 +32,7 @@ CMCFLAGS= -Os
PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix solaris
-LUA_A= liblua.a -LUA_A= liblua.a
+LUA_A= liblua.5.3.5.dylib +LUA_A= liblua.5.4.1.dylib
CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \ 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
lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o \ LIB_O= lauxlib.o lbaselib.o lcorolib.o ldblib.o liolib.o lmathlib.o loadlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o linit.o
ltm.o lundump.o lvm.o lzio.o BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
@@ -56,11 +56,12 @@ o: $(ALL_O) @@ -57,11 +57,12 @@ o: $(ALL_O)
a: $(ALL_A) a: $(ALL_A)
$(LUA_A): $(BASE_O) $(LUA_A): $(BASE_O)
- $(AR) $@ $(BASE_O) - $(AR) $@ $(BASE_O)
- $(RANLIB) $@ - $(RANLIB) $@
+ $(CC) -dynamiclib -install_name @LUA_PREFIX@/lib/liblua.5.3.dylib \ + $(CC) -dynamiclib -install_name @LUA_PREFIX@/lib/liblua.5.4.dylib \
+ -compatibility_version 5.3 -current_version 5.3.5 \ + -compatibility_version 5.4 -current_version 5.4.1 \
+ -o liblua.5.3.5.dylib $^ + -o liblua.5.4.1.dylib $^
$(LUA_T): $(LUA_O) $(LUA_A) $(LUA_T): $(LUA_O) $(LUA_A)
- $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) - $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
+ $(CC) -fno-common $(MYLDFLAGS) -o $@ $(LUA_O) $(LUA_A) -L. -llua.5.3.5 $(LIBS) + $(CC) -fno-common $(MYLDFLAGS) -o $@ $(LUA_O) $(LUA_A) -L. -llua.5.4.1 $(LIBS)
$(LUAC_T): $(LUAC_O) $(LUA_A) $(LUAC_T): $(LUAC_O) $(LUA_A)
$(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS) $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
@@ -110,7 +111,7 @@ linux: @@ -124,7 +125,7 @@ linux-readline:
$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline" $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -DLUA_USE_READLINE" SYSLIBS="-Wl,-E -ldl -lreadline"
macosx: Darwin macos macosx:
- $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline" - $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX -DLUA_USE_READLINE" SYSLIBS="-lreadline"
+ $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX -fno-common" SYSLIBS="-lreadline" + $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX -DLUA_USE_READLINE -fno-common" SYSLIBS="-lreadline"
mingw: mingw:
$(MAKE) "LUA_A=lua53.dll" "LUA_T=lua.exe" \ $(MAKE) "LUA_A=lua54.dll" "LUA_T=lua.exe" \

View File

@ -75,7 +75,6 @@
"libcppa": "caf", "libcppa": "caf",
"libmongoclient": "mongo-cxx-driver", "libmongoclient": "mongo-cxx-driver",
"lua51": "lua@5.1", "lua51": "lua@5.1",
"lua@5.3": "lua",
"mat": "mat2", "mat": "mat2",
"maven32": "maven@3.2", "maven32": "maven@3.2",
"mkl-dnn": "onednn", "mkl-dnn": "onednn",