lua51: rename to lua@5.1.

This commit is contained in:
Chongyu Zhu 2017-01-30 01:47:19 +08:00 committed by Mike McQuaid
parent e885e25f5d
commit ca934b5a53
2 changed files with 6 additions and 8 deletions

View file

@ -1,4 +1,4 @@
class Lua51 < Formula
class LuaAT51 < 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.
desc "Powerful, lightweight programming language (v5.1.5)"
@ -16,7 +16,6 @@ class Lua51 < Formula
sha256 "821a3e39854354505c4751ce8605b20f56e441c43b1d8464fe37e5301122e9c2" => :mavericks
end
option :universal
option "with-completion", "Enables advanced readline support"
option "without-sigaction", "Revert to ANSI signal instead of improved POSIX sigaction"
option "without-luarocks", "Don't build with Luarocks support embedded"
@ -49,8 +48,6 @@ class Lua51 < Formula
end
def install
ENV.universal_binary if build.universal?
# Use our CC/CFLAGS to compile.
inreplace "src/Makefile" do |s|
s.remove_make_var! "CC"
@ -68,7 +65,7 @@ class Lua51 < Formula
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"
s.gsub! "includedir=${prefix}/include", "includedir=${prefix}/include/lua-5.1"
s.gsub! "Libs: -L${libdir} -llua -lm", "Libs: -L${libdir} -llua5.1 -lm"
s.gsub! "Libs: -L${libdir} -llua -lm", "Libs: -L${libdir} -llua.5.1 -lm"
end
system "make", "macosx", "INSTALL_TOP=#{prefix}", "INSTALL_MAN=#{man1}", "INSTALL_INC=#{include}/lua-5.1"
@ -83,11 +80,11 @@ class Lua51 < Formula
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/lua5.1.pc"
(lib/"pkgconfig").install_symlink "lua5.1.pc" => "lua-5.1.pc"
include.install_symlink "lua-5.1" => "lua5.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"
(lib/"pkgconfig").install_symlink "lua-5.1.pc" => "lua5.1.pc"
# This resource must be handled after the main install, since there's a lua dep.
# Keeping it in install rather than postinstall means we can bottle.

View file

@ -50,6 +50,7 @@
"libmpc08": "libmpc@0.8",
"llvm37": "llvm@3.7",
"llvm38": "llvm@3.8",
"lua51": "lua@5.1",
"lua53": "lua@5.3",
"mongo-c": "mongo-c-driver",
"mpfr2": "mpfr@2",