2010-03-08 12:22:58 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Luajit < Formula
|
2011-06-25 18:00:57 +00:00
|
|
|
url 'http://luajit.org/download/LuaJIT-2.0.0-beta8.tar.gz'
|
2010-03-08 12:22:58 +00:00
|
|
|
head 'http://luajit.org/git/luajit-2.0.git', :using => :git
|
2010-09-10 05:37:52 +00:00
|
|
|
homepage 'http://luajit.org/luajit.html'
|
2011-06-25 18:00:57 +00:00
|
|
|
md5 'f0748a73ae268d49b1d01f56c4fe3e61'
|
2010-03-08 12:22:58 +00:00
|
|
|
|
2011-04-01 12:57:51 +00:00
|
|
|
# Skip cleaning both empty folders and bin/libs so external symbols still work.
|
|
|
|
skip_clean :all
|
2010-03-08 12:22:58 +00:00
|
|
|
|
2011-06-09 19:23:07 +00:00
|
|
|
def options
|
|
|
|
[["--debug", "Build with debugging symbols."]]
|
|
|
|
end
|
|
|
|
|
2011-06-29 03:41:11 +00:00
|
|
|
# Apply beta8 hotfix #1
|
|
|
|
def patches
|
2011-08-24 04:31:05 +00:00
|
|
|
if not ARGV.build_head?
|
|
|
|
{ :p1 => "http://luajit.org/download/beta8_hotfix1.patch" }
|
|
|
|
end
|
2011-06-29 03:41:11 +00:00
|
|
|
end
|
|
|
|
|
2010-03-08 12:22:58 +00:00
|
|
|
def install
|
2011-06-09 19:23:07 +00:00
|
|
|
if ARGV.include? '--debug'
|
2011-07-01 04:19:24 +00:00
|
|
|
system "make", "CCDEBUG=-g", "PREFIX=#{prefix}", "amalg"
|
2011-06-09 19:23:07 +00:00
|
|
|
system "make", "CCDEBUG=-g", "PREFIX=#{prefix}", "install"
|
|
|
|
else
|
2011-07-01 04:19:24 +00:00
|
|
|
system "make", "PREFIX=#{prefix}", "amalg"
|
2011-06-09 19:23:07 +00:00
|
|
|
system "make", "PREFIX=#{prefix}", "install"
|
|
|
|
end
|
2011-08-24 04:31:05 +00:00
|
|
|
|
2011-04-01 12:57:51 +00:00
|
|
|
# Non-versioned symlink
|
2011-08-24 04:31:05 +00:00
|
|
|
if ARGV.build_head?
|
|
|
|
version = "2.0.0-beta8"
|
|
|
|
else
|
|
|
|
version = @version
|
|
|
|
end
|
2011-04-01 12:57:51 +00:00
|
|
|
ln_s bin+"luajit-#{version}", bin+"luajit"
|
2010-03-08 12:22:58 +00:00
|
|
|
end
|
|
|
|
end
|