aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorDouglas Creager2011-03-31 23:23:19 -0400
committerAdam Vandenberg2011-04-01 12:57:26 -0700
commit5b33e079f620ffeb403355e3f1b6ed72d1ff5cba (patch)
tree1acf254d211e8901c619872e5cf2df0d2ea2159a /Library
parente41b01353b66306c96d7b373ce8ff0a98501e203 (diff)
downloadhomebrew-5b33e079f620ffeb403355e3f1b6ed72d1ff5cba.tar.bz2
LuaRocks 2.0.4.1
Also allow use with either Lua or LuaJIT This patch lets you install luarocks against either the original Lua interpreter, or against LuaJIT. Lua and LuaJIT are ABI-compatible, so the rocks that you install should be compatible with both interpreters. So we we can use the same path for installed rocks, regardless of which interpreter we build luarocks against. This just affects which interpreter is used to run luarocks itself. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/luarocks.rb31
1 files changed, 21 insertions, 10 deletions
diff --git a/Library/Formula/luarocks.rb b/Library/Formula/luarocks.rb
index e272341ff..3f7e5dabd 100644
--- a/Library/Formula/luarocks.rb
+++ b/Library/Formula/luarocks.rb
@@ -1,21 +1,32 @@
require 'formula'
+def use_luajit?; ARGV.include? '--with-luajit'; end
+
class Luarocks < Formula
- url 'http://luarocks.org/releases/luarocks-2.0.2.tar.gz'
+ url 'http://luarocks.org/releases/luarocks-2.0.4.1.tar.gz'
homepage 'http://luarocks.org'
- md5 'f8b13b642f8bf16740cac009580cda48'
+ md5 '2c7caccce3cdf236e6f9aca7bec9bdea'
- depends_on 'lua'
+ depends_on use_luajit? ? 'luajit' : 'lua'
- def install
- fails_with_llvm "Lua itself compiles with llvm, but may fail when other software trys to link."
+ fails_with_llvm "Lua itself compiles with llvm, but may fail when other software trys to link."
+
+ def options
+ [['--with-luajit', 'Use LuaJIT instead of the stock Lua.']]
+ end
+ def install
# Install to the Cellar, but direct modules to HOMEBREW_PREFIX
- # Configure can detect 'wget' to use as a downloader, but we don't
- # require it since curl works too and comes with OS X.
- system "./configure", "--prefix=#{prefix}",
- "--rocks-tree=#{HOMEBREW_PREFIX}/lib/luarocks",
- "--sysconfdir=#{etc}/luarocks"
+ args = ["--prefix=#{prefix}",
+ "--rocks-tree=#{HOMEBREW_PREFIX}/lib/luarocks",
+ "--sysconfdir=#{etc}/luarocks"]
+
+ if use_luajit?
+ args << "--with-lua-include=#{HOMEBREW_PREFIX}/include/luajit-2.0"
+ args << "--lua-suffix=jit"
+ end
+
+ system "./configure", *args
system "make"
system "make install"
end