Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lua 5.4.1 #65993

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e8cf4da
lua 5.4.1
carlocab Dec 1, 2020
b3a5730
Rename `[email protected]` alias
carlocab Dec 1, 2020
7bbf9cc
Add [email protected]
carlocab Dec 1, 2020
327a828
Remove renamed formula
carlocab Dec 1, 2020
9e3b9e6
clingo revision bump (lua 5.4.1)
carlocab Dec 1, 2020
e77d267
corsixth revision bump (lua 5.4.1)
carlocab Dec 1, 2020
ccceb8d
freeswitch revision bump (lua 5.4.1)
carlocab Dec 1, 2020
f6f7acb
gnuplot revision bump (lua 5.4.1)
carlocab Dec 2, 2020
c5cfc99
highlight revision bump (lua 5.4.1)
carlocab Dec 1, 2020
37ef9fe
imapfilter revision bump (lua 5.4.1)
carlocab Dec 1, 2020
bfbb8f3
instead revision bump (lua 5.4.1)
carlocab Dec 1, 2020
dd254ee
kyua revision bump (lua 5.4.1)
carlocab Dec 1, 2020
ae2af8c
lcm revision bump (lua 5.4.1)
carlocab Dec 1, 2020
e80d2c9
lsyncd revision bump (lua 5.4.1)
carlocab Dec 1, 2020
7c73af2
lutok revision bump (lua 5.4.1)
carlocab Dec 1, 2020
beeb261
macvim revision bump (lua 5.4.1)
carlocab Dec 1, 2020
12f9bd4
neomutt revision bump (lua 5.4.1)
carlocab Dec 1, 2020
405b0cd
onscripter revision bump (lua 5.4.1)
carlocab Dec 1, 2020
078ce34
osrm-backend revision bump (lua 5.4.1)
carlocab Dec 1, 2020
5668497
pdns revision bump (lua 5.4.1)
carlocab Dec 1, 2020
800721b
pdnsrec revision bump (lua 5.4.1)
carlocab Dec 1, 2020
df74ea8
rpm revision bump (lua 5.4.1)
carlocab Dec 1, 2020
21e8c79
sile revision bump (lua 5.4.1)
carlocab Dec 1, 2020
f8afe31
tracebox revision bump (lua 5.4.1)
carlocab Dec 1, 2020
c484133
vim revision bump (lua 5.4.1)
carlocab Dec 1, 2020
f8119b0
vis revision bump (lua 5.4.1)
carlocab Dec 1, 2020
54b5098
weechat revision bump (lua 5.4.1)
carlocab Dec 1, 2020
28cb03d
luarocks: fix test + revision bump (lua 5.4.1)
carlocab Dec 1, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
2 changes: 1 addition & 1 deletion Formula/clingo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Clingo < Formula
url "https://github.com/potassco/clingo/archive/v5.4.0.tar.gz"
sha256 "e2de331ee0a6d254193aab5995338a621372517adcf91568092be8ac511c18f3"
license "MIT"
revision 2
revision 3

livecheck do
url "https://github.com/potassco/clingo/releases/latest"
Expand Down
23 changes: 18 additions & 5 deletions Formula/corsixth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Corsixth < Formula
url "https://github.com/CorsixTH/CorsixTH/archive/v0.64.tar.gz"
sha256 "12389a95de0031baec1a3fc77208d44228177f49564f1c79ae763ab4aeeafa98"
license "MIT"
revision 1
head "https://github.com/CorsixTH/CorsixTH.git"

bottle do
Expand All @@ -18,7 +19,13 @@ class Corsixth < Formula
depends_on xcode: :build
depends_on "ffmpeg"
depends_on "freetype"
depends_on "lua"

# This PR implements a limited form of lua 5.4 support:
# https://github.com/CorsixTH/CorsixTH/pull/1686
# It breaks some features. Maintainer does not appear to have intentions of
# supporting lua 5.4.
depends_on "[email protected]"

depends_on "sdl2"
depends_on "sdl2_mixer"

Expand All @@ -34,6 +41,9 @@ class Corsixth < Formula
end

def install
# Make sure I point to the right version!
lua = Formula["[email protected]"]

ENV["TARGET_BUILD_DIR"] = "."
ENV["FULL_PRODUCT_NAME"] = "CorsixTH.app"

Expand All @@ -47,9 +57,9 @@ def install
end
end

system "cmake", ".", "-DLUA_INCLUDE_DIR=#{Formula["lua"].opt_include}/lua",
"-DLUA_LIBRARY=#{Formula["lua"].opt_lib}/liblua.dylib",
"-DLUA_PROGRAM_PATH=#{Formula["lua"].opt_bin}/lua",
system "cmake", ".", "-DLUA_INCLUDE_DIR=#{lua.opt_include}/lua",
"-DLUA_LIBRARY=#{lua.opt_lib}/liblua.dylib",
"-DLUA_PROGRAM_PATH=#{lua.opt_bin}/lua",
"-DCORSIX_TH_DATADIR=#{prefix}/CorsixTH.app/Contents/Resources/",
*std_cmake_args
system "make"
Expand All @@ -62,8 +72,11 @@ def install
end

test do
# Make sure I point to the right version!
lua = Formula["[email protected]"]

app = prefix/"CorsixTH.app/Contents/MacOS/CorsixTH"
assert_includes MachO::Tools.dylibs(app),
"#{Formula["lua"].opt_lib}/liblua.5.3.dylib"
"#{lua.opt_lib}/liblua.#{lua.version.major_minor}.dylib"
end
end
2 changes: 1 addition & 1 deletion Formula/freeswitch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class Freeswitch < Formula
desc "Telephony platform to route various communication protocols"
homepage "https://freeswitch.org"
license "MPL-1.1"
revision 2
revision 3
head "https://github.com/signalwire/freeswitch.git"

stable do
Expand Down
1 change: 1 addition & 0 deletions Formula/gnuplot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Gnuplot < Formula
url "https://downloads.sourceforge.net/project/gnuplot/gnuplot/5.4.1/gnuplot-5.4.1.tar.gz"
sha256 "6b690485567eaeb938c26936e5e0681cf70c856d273cc2c45fabf64d8bc6590e"
license "gnuplot"
revision 1

livecheck do
url :stable
Expand Down
1 change: 1 addition & 0 deletions Formula/highlight.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Highlight < Formula
url "http://www.andre-simon.de/zip/highlight-3.59.tar.bz2"
sha256 "85926ca8e08e69b497fa4a0c93bec595e15c1ca18c4ee494ea3f1c9a78c249a2"
license "GPL-3.0-or-later"
revision 1
head "https://gitlab.com/saalen/highlight.git"

bottle do
Expand Down
1 change: 1 addition & 0 deletions Formula/imapfilter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Imapfilter < Formula
url "https://github.com/lefcha/imapfilter/archive/v2.6.16.tar.gz"
sha256 "90af9bc9875e03fb5a09a3233287b74dd817867cb18ec9ff52fead615755563e"
license "MIT"
revision 1

bottle do
sha256 "95cacc31b13fbd4a1435be7cf18e0dd87ca8ec0d9f51a944d1734c19bbea83cc" => :big_sur
Expand Down
17 changes: 14 additions & 3 deletions Formula/instead.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Instead < Formula
url "https://github.com/instead-hub/instead/archive/3.3.2.tar.gz"
sha256 "bdb827f36e693dc7b443e69d4678d24f1ccc20dc093c22f58b8d78192da15f2e"
license "MIT"
revision 1

bottle do
sha256 "4279441d1a315d876f9646a284ac3beefd109e7fa7c4ebce2fb8549bf0947d94" => :big_sur
Expand All @@ -13,17 +14,27 @@ class Instead < Formula
end

depends_on "cmake" => :build
depends_on "lua"

# Possible patch for lua 5.4 support:
# https://github.com/instead-hub/instead/commit/ea4f0e81c6859b0aadde582f47ffd7850f54a264
# Alternatively, this dependency may be replaced with luajit, which is the
# package's preferred version of lua:
# https://github.com/instead-hub/instead/blob/master/INSTALL
depends_on "[email protected]"

depends_on "sdl2"
depends_on "sdl2_image"
depends_on "sdl2_mixer"
depends_on "sdl2_ttf"

def install
# Make sure I point to the correct lua version!
lua = Formula["[email protected]"]

mkdir "build" do
system "cmake", "..", "-DWITH_GTK2=OFF",
"-DLUA_INCLUDE_DIR=#{Formula["lua"].opt_include}/lua",
"-DLUA_LIBRARY=#{Formula["lua"].opt_lib}/liblua.dylib",
"-DLUA_INCLUDE_DIR=#{lua.opt_include}/lua",
"-DLUA_LIBRARY=#{lua.opt_lib}/liblua.dylib",
*std_cmake_args
system "make", "install"
end
Expand Down
2 changes: 1 addition & 1 deletion Formula/kyua.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Kyua < Formula
url "https://github.com/jmmv/kyua/releases/download/kyua-0.13/kyua-0.13.tar.gz"
sha256 "db6e5d341d5cf7e49e50aa361243e19087a00ba33742b0855d2685c0b8e721d6"
license "BSD-3-Clause"
revision 1
revision 2

bottle do
sha256 "888d669ac50da9075895a0702e7b119fa00a5822e9ce57afe3216c00659fe339" => :big_sur
Expand Down
2 changes: 1 addition & 1 deletion Formula/lcm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Lcm < Formula
url "https://github.com/lcm-proj/lcm/releases/download/v1.4.0/lcm-1.4.0.zip"
sha256 "e249d7be0b8da35df8931899c4a332231aedaeb43238741ae66dc9baf4c3d186"
license "LGPL-2.1"
revision 5
revision 6
head "https://github.com/lcm-proj/lcm.git"

bottle do
Expand Down
6 changes: 5 additions & 1 deletion Formula/lsyncd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Lsyncd < Formula
url "https://github.com/axkibe/lsyncd/archive/release-2.2.3.tar.gz"
sha256 "7bcd0f4ae126040bb078c482ff856c87e61c22472c23fa3071798dcb1dc388dd"
license "GPL-2.0"
revision 1

bottle do
cellar :any
Expand All @@ -15,7 +16,10 @@ class Lsyncd < Formula
end

depends_on "cmake" => :build
depends_on "lua"

# lua 5.4 support tracking issue:
# https://github.com/axkibe/lsyncd/issues/621
depends_on "[email protected]"

xnu_headers = {
"10.7" => ["xnu-1699.22.73.tar.gz", "c9d24560af543e6099b6248bdbcef3581e7ba4af3afd92974719f7c5a8db5bd2"],
Expand Down
85 changes: 42 additions & 43 deletions Formula/lua.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
class Lua < Formula
desc "Powerful, lightweight programming language"
homepage "https://www.lua.org/"
url "https://www.lua.org/ftp/lua-5.3.5.tar.gz"
sha256 "0c2eed3f960446e1a3e4b9a1ca2f3ff893b6ce41942cf54d5dd59ab4b3b058ac"
url "https://www.lua.org/ftp/lua-5.4.1.tar.gz"
sha256 "4ba786c3705eb9db6567af29c91a01b81f1c0ac3124fdbf6cd94bdd9e53cca7d"
license "MIT"
revision 1

livecheck do
url "https://www.lua.org/ftp/"
Expand Down Expand Up @@ -38,7 +37,7 @@ def install
inreplace "src/Makefile" do |s|
s.gsub! "@LUA_PREFIX@", prefix
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
end

Expand All @@ -51,19 +50,19 @@ def install
(lib/"pkgconfig/lua.pc").write pc_file

# Fix some software potentially hunting for different pc names.
bin.install_symlink "lua" => "lua5.3"
bin.install_symlink "lua" => "lua-5.3"
bin.install_symlink "luac" => "luac5.3"
bin.install_symlink "luac" => "luac-5.3"
(include/"lua5.3").install_symlink Dir[include/"lua/*"]
lib.install_symlink "liblua.5.3.dylib" => "liblua5.3.dylib"
(lib/"pkgconfig").install_symlink "lua.pc" => "lua5.3.pc"
(lib/"pkgconfig").install_symlink "lua.pc" => "lua-5.3.pc"
bin.install_symlink "lua" => "lua#{version.major_minor}"
bin.install_symlink "lua" => "lua-#{version.major_minor}"
bin.install_symlink "luac" => "luac#{version.major_minor}"
bin.install_symlink "luac" => "luac-#{version.major_minor}"
(include/"lua#{version.major_minor}").install_symlink Dir[include/"lua/*"]
lib.install_symlink "liblua.#{version.major_minor}.dylib" => "liblua#{version.major_minor}.dylib"
(lib/"pkgconfig").install_symlink "lua.pc" => "lua#{version.major_minor}.pc"
(lib/"pkgconfig").install_symlink "lua.pc" => "lua-#{version.major_minor}.pc"
end

def pc_file
<<~EOS
V= 5.3
V= #{version.major_minor}
R= #{version}
prefix=#{HOMEBREW_PREFIX}
INSTALL_BIN= ${prefix}/bin
Expand Down Expand Up @@ -93,68 +92,68 @@ def caveats
end

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__
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like this patch will be around for a while, is it submitted upstream already? And/or can we migrate it to Homebrew/formula-patches?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This patch has been around for quite a while: Homebrew/legacy-homebrew#5043

I think it's somewhat unique to the way Homebrew packages things? Though I don't see how it could hurt upstream, and probably only helps.

I don't mind migrating it to Homebrew/formula-patches. Do you mind if I pursue that in a separate PR, if (fingers crossed) this one gets merged?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only just realised exactly how old this patch is. It's really alarming.

I'm going to try to see if I can track down someone familiar with lua internals who can have a look at the patch.

diff --git a/Makefile b/Makefile
index 7fa91c8..a825198 100644
index 1797df9..2f80d16 100644
--- a/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.
TO_BIN= lua luac
TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
-TO_LIB= liblua.a
+TO_LIB= liblua.5.3.5.dylib
+TO_LIB= liblua.5.4.1.dylib
TO_MAN= lua.1 luac.1

# Lua version and release.
@@ -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.3.5.dylib $(INSTALL_LIB)/liblua.5.3.dylib
+ ln -s -f liblua.5.3.dylib $(INSTALL_LIB)/liblua.dylib
@@ -60,6 +60,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.4.1.dylib $(INSTALL_LIB)/liblua.5.4.dylib
+ ln -s -f liblua.5.4.dylib $(INSTALL_LIB)/liblua.dylib

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
index 2e7a412..d0c4898 100644
index 514593d..90c78b8 100644
--- a/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.5.3.5.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)
+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 lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.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
BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
@@ -57,11 +57,12 @@ o: $(ALL_O)
a: $(ALL_A)

$(LUA_A): $(BASE_O)
- $(AR) $@ $(BASE_O)
- $(RANLIB) $@
+ $(CC) -dynamiclib -install_name @LUA_PREFIX@/lib/liblua.5.3.dylib \
+ -compatibility_version 5.3 -current_version 5.3.5 \
+ -o liblua.5.3.5.dylib $^
+ $(CC) -dynamiclib -install_name @LUA_PREFIX@/lib/liblua.5.4.dylib \
+ -compatibility_version 5.4 -current_version 5.4.1 \
+ -o liblua.5.4.1.dylib $^

$(LUA_T): $(LUA_O) $(LUA_A)
- $(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)
$(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
@@ -110,7 +111,7 @@ linux:
$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline"
$(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
@@ -124,7 +125,7 @@ linux-readline:
$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -DLUA_USE_READLINE" SYSLIBS="-Wl,-E -ldl -lreadline"

macosx:
- $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline"
+ $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX -fno-common" SYSLIBS="-lreadline"
Darwin macos macosx:
- $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX -DLUA_USE_READLINE" SYSLIBS="-lreadline"
+ $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX -DLUA_USE_READLINE -fno-common" SYSLIBS="-lreadline"

mingw:
$(MAKE) "LUA_A=lua53.dll" "LUA_T=lua.exe" \
$(MAKE) "LUA_A=lua54.dll" "LUA_T=lua.exe" \
Loading