From 7af815c1238c349f6d17223dbe396ab3af9b5c5b Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Tue, 2 Jan 2018 23:00:36 +0000 Subject: [PATCH] lua@5.1: update luarocks to 2.4.4 Closes https://github.com/Homebrew/homebrew-core/issues/25597. --- Formula/lua@5.1.rb | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/Formula/lua@5.1.rb b/Formula/lua@5.1.rb index 22928e0467..b0a926978a 100644 --- a/Formula/lua@5.1.rb +++ b/Formula/lua@5.1.rb @@ -5,7 +5,7 @@ class LuaAT51 < Formula url "https://www.lua.org/ftp/lua-5.1.5.tar.gz" mirror "https://mirrors.ocf.berkeley.edu/debian/pool/main/l/lua5.1/lua5.1_5.1.5.orig.tar.gz" sha256 "2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333" - revision 5 + revision 6 bottle do cellar :any @@ -41,13 +41,14 @@ class LuaAT51 < Formula end resource "luarocks" do - url "https://keplerproject.github.io/luarocks/releases/luarocks-2.3.0.tar.gz" - sha256 "68e38feeb66052e29ad1935a71b875194ed8b9c67c2223af5f4d4e3e2464ed97" + url "https://luarocks.org/releases/luarocks-2.4.4.tar.gz" + sha256 "3938df33de33752ff2c526e604410af3dceb4b7ff06a770bc4a240de80a1f934" end def install # Use our CC/CFLAGS to compile. inreplace "src/Makefile" do |s| + s.gsub! HOMEBREW_PREFIX, prefix s.remove_make_var! "CC" s.change_make_var! "CFLAGS", "#{ENV.cflags} $(MYCFLAGS)" s.change_make_var! "MYLDFLAGS", ENV.ldflags @@ -74,11 +75,11 @@ class LuaAT51 < Formula # Renaming from Lua to Lua51. # Note that the naming must be both lua-version & lua.version. # Software can't find the libraries without supporting both the hyphen or full stop. - mv "#{bin}/lua", "#{bin}/lua-5.1" - mv "#{bin}/luac", "#{bin}/luac-5.1" - mv "#{man1}/lua.1", "#{man1}/lua-5.1.1" - mv "#{man1}/luac.1", "#{man1}/luac-5.1.1" - mv "#{lib}/pkgconfig/lua.pc", "#{lib}/pkgconfig/lua-5.1.pc" + mv bin/"lua", bin/"lua-5.1" + mv bin/"luac", bin/"luac-5.1" + mv man1/"lua.1", man1/"lua-5.1.1" + mv man1/"luac.1", man1/"luac-5.1.1" + mv lib/"pkgconfig/lua.pc", lib/"pkgconfig/lua-5.1.pc" bin.install_symlink "lua-5.1" => "lua5.1" bin.install_symlink "luac-5.1" => "luac5.1" include.install_symlink "lua-5.1" => "lua5.1" @@ -93,7 +94,8 @@ class LuaAT51 < Formula system "./configure", "--prefix=#{libexec}", "--rocks-tree=#{HOMEBREW_PREFIX}", "--sysconfdir=#{etc}/luarocks51", "--with-lua=#{prefix}", - "--lua-version=5.1", "--versioned-rocks-dir" + "--with-lua-include=#{include}/lua-5.1", "--lua-version=5.1", + "--versioned-rocks-dir" system "make", "build" system "make", "install" @@ -103,10 +105,10 @@ class LuaAT51 < Formula # This block ensures luarock exec scripts don't break across updates. inreplace libexec/"share/lua/5.1/luarocks/site_config.lua" do |s| - s.gsub! libexec.to_s, opt_libexec.to_s - s.gsub! include.to_s, "#{HOMEBREW_PREFIX}/include" - s.gsub! lib.to_s, "#{HOMEBREW_PREFIX}/lib" - s.gsub! bin.to_s, "#{HOMEBREW_PREFIX}/bin" + s.gsub! libexec, opt_libexec + s.gsub! include, HOMEBREW_PREFIX/"include" + s.gsub! lib, HOMEBREW_PREFIX/"lib" + s.gsub! bin, HOMEBREW_PREFIX/"bin" end end end