homebrew-core/Formula/luajit.rb

38 lines
1.2 KiB
Ruby
Raw Normal View History

require 'formula'
2011-03-10 05:11:03 +00:00
class Luajit < Formula
homepage 'http://luajit.org/luajit.html'
url 'http://luajit.org/download/LuaJIT-2.0.0-rc1.tar.gz'
sha1 '54a5c85307e815fff16b33b28f103c40e65a39df'
2012-04-19 02:37:43 +00:00
head 'http://luajit.org/git/luajit-2.0.git'
2012-10-21 20:03:46 +00:00
skip_clean 'lib/lua/5.1', 'share/lua/5.1'
2012-08-28 05:07:27 +00:00
option "enable-debug", "Build with debugging symbols"
def install
# 1 - Remove the '-O2' so we can set Og if needed. Leave the -fomit part.
# 2 - Override the hardcoded gcc.
# 3 - Remove the '-march=i686' so we can set the march in cflags.
# All three changes should persist and were discussed upstream.
inreplace 'src/Makefile' do |f|
f.change_make_var! 'CCOPT', '-fomit-frame-pointer'
f.change_make_var! 'CC', ENV.cc
f.change_make_var! 'CCOPT_x86', ''
end
ENV.O2 # Respect the developer's choice.
2012-10-21 20:03:46 +00:00
args = ["PREFIX=#{prefix}"]
2012-08-28 05:07:27 +00:00
if build.include? 'enable-debug' then
ENV.Og if ENV.compiler == :clang
args << 'CCDEBUG=-g'
end
bldargs = args
bldargs << 'amalg'
system 'make', *bldargs
args << 'install'
system 'make', *args # Build requires args during install
end
end