aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/lua51.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Formula/lua51.rb')
-rw-r--r--Library/Formula/lua51.rb33
1 files changed, 16 insertions, 17 deletions
diff --git a/Library/Formula/lua51.rb b/Library/Formula/lua51.rb
index e20e9a952..eea99e023 100644
--- a/Library/Formula/lua51.rb
+++ b/Library/Formula/lua51.rb
@@ -1,11 +1,12 @@
-require 'formula'
+require "formula"
class Lua51 < Formula
# 5.2 is not fully backwards compatible so we must retain 2 Luas for now.
# The transition has begun. Lua will now become Lua51, and Lua52 will become Lua.
- homepage 'http://www.lua.org/'
- url 'http://www.lua.org/ftp/lua-5.1.5.tar.gz'
- sha1 'b3882111ad02ecc6b972f8c1241647905cb2e3fc'
+ homepage "http://www.lua.org/"
+ url "http://www.lua.org/ftp/lua-5.1.5.tar.gz"
+ mirror "https://mirrors.kernel.org/debian/pool/main/l/lua5.1/lua5.1_5.1.5.orig.tar.gz"
+ sha1 "b3882111ad02ecc6b972f8c1241647905cb2e3fc"
bottle do
sha1 "2b64683201c6ae570760a4b60406e6f3ab26d9df" => :mavericks
@@ -19,8 +20,8 @@ class Lua51 < Formula
end
option :universal
- option 'with-completion', 'Enables advanced readline support'
- option 'without-sigaction', 'Revert to ANSI signal instead of improved POSIX sigaction'
+ option "with-completion", "Enables advanced readline support"
+ option "without-sigaction", "Revert to ANSI signal instead of improved POSIX sigaction"
# Be sure to build a dylib, or else runtime modules will pull in another static copy of liblua = crashy
# See: https://github.com/Homebrew/homebrew/pull/5043
@@ -44,18 +45,18 @@ class Lua51 < Formula
ENV.universal_binary if build.universal?
# 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! 'MYLDFLAGS', ENV.ldflags
- s.sub! 'MYCFLAGS_VAL', "-fno-common -DLUA_USE_LINUX"
+ inreplace "src/Makefile" do |s|
+ s.remove_make_var! "CC"
+ s.change_make_var! "CFLAGS", "#{ENV.cflags} $(MYCFLAGS)"
+ s.change_make_var! "MYLDFLAGS", ENV.ldflags
+ s.sub! "MYCFLAGS_VAL", "-fno-common -DLUA_USE_LINUX"
end
# Fix path in the config header
- inreplace 'src/luaconf.h', '/usr/local', HOMEBREW_PREFIX
+ inreplace "src/luaconf.h", "/usr/local", HOMEBREW_PREFIX
# Fix paths in the .pc
- inreplace 'etc/lua.pc' do |s|
+ 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"
s.gsub! "INSTALL_INC= ${prefix}/include", "INSTALL_INC= ${prefix}/include/lua-5.1"
@@ -66,7 +67,7 @@ class Lua51 < Formula
system "make", "macosx", "INSTALL_TOP=#{prefix}", "INSTALL_MAN=#{man1}", "INSTALL_INC=#{include}/lua-5.1"
system "make", "install", "INSTALL_TOP=#{prefix}", "INSTALL_MAN=#{man1}", "INSTALL_INC=#{include}/lua-5.1"
- (lib+"pkgconfig").install 'etc/lua.pc'
+ (lib+"pkgconfig").install "etc/lua.pc"
# Renaming from Lua to Lua51.
# Note that the naming must be both lua-version & lua.version.
@@ -84,9 +85,7 @@ class Lua51 < Formula
end
test do
- output = `#{bin}/lua-5.1 -e "for i=0,9 do io.write(i) end"`
- assert_equal "0123456789", output
- assert_equal 0, $?.exitstatus
+ system "#{bin}/lua5.1", "-e", "print ('Ducks are cool')"
end
end