homebrew-core/Formula/lua.rb
Adam Vandenberg 7bd947eb0b Update formulae for version 0.7
* Use new "url" features
* Use keg_only DSL
* Use "skip_clean :all" DSL
* Whitespace and style cleanups
* Make bash invocations less silly
* Use new man2-man8 helpers
* Remove "FileUtils." since it is included in Formula
* Use real names for deps instead of aliases
* ENV.x11 now updates path, so remove that from individual brews
2010-08-07 18:08:53 -07:00

38 lines
1.1 KiB
Ruby

require 'formula'
class Lua <Formula
url 'http://www.lua.org/ftp/lua-5.1.4.tar.gz'
homepage 'http://www.lua.org/'
md5 'd0870f2de55d59c1c8419f36e8fac150'
# Skip cleaning both empty folders and bin/libs so external symbols still work.
skip_clean :all
def install
# Apply patch-level 2
cd 'src' do
curl "http://www.lua.org/ftp/patch-lua-5.1.4-2", "-O"
`patch < patch-lua-5.1.4-2`
end
# Use our CC/CFLAGS to compile.
inreplace 'src/Makefile' do |s|
s.remove_make_var! 'CC'
s.change_make_var! 'CFLAGS', "#{ENV['CFLAGS']} $(MYCFLAGS)"
end
# Fix path in the config header
inreplace 'src/luaconf.h', '/usr/local', HOMEBREW_PREFIX
# Fix paths in the .pc
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"
end
system "make", "macosx", "INSTALL_TOP=#{prefix}", "INSTALL_MAN=#{man1}"
system "make", "install", "INSTALL_TOP=#{prefix}", "INSTALL_MAN=#{man1}"
(lib+"pkgconfig").install 'etc/lua.pc'
end
end