aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2012-09-02 11:53:18 -0700
committerAdam Vandenberg2012-09-02 11:53:18 -0700
commitebd4a3d1c3e79a7b36512902f44632807a41241d (patch)
treec2f6269fb8a57ad56fee1f02ec9caa1cc0fb418c /Library
parent9c2b9e729b6cc7c6a9c00644a14641293383ec8e (diff)
downloadhomebrew-ebd4a3d1c3e79a7b36512902f44632807a41241d.tar.bz2
luarocks: use new dsl
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/luarocks.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/Library/Formula/luarocks.rb b/Library/Formula/luarocks.rb
index b0327183f..c817d4634 100644
--- a/Library/Formula/luarocks.rb
+++ b/Library/Formula/luarocks.rb
@@ -1,13 +1,17 @@
require 'formula'
-def use_luajit?; ARGV.include? '--with-luajit'; end
-
class Luarocks < Formula
homepage 'http://luarocks.org'
url 'http://luarocks.org/releases/luarocks-2.0.10.tar.gz'
sha1 '90db1c46940816ae82a8037e585769e3e8845f66'
- depends_on use_luajit? ? 'luajit' : 'lua'
+ option 'with-luajit', 'Use LuaJIT instead of the stock Lua'
+
+ if build.include? 'with-luajit'
+ depends_on 'luajit'
+ else
+ depends_on 'lua'
+ end
fails_with :llvm do
cause "Lua itself compiles with llvm, but may fail when other software tries to link."
@@ -18,17 +22,13 @@ class Luarocks < Formula
DATA if HOMEBREW_PREFIX.to_s == '/usr/local'
end
- def options
- [['--with-luajit', 'Use LuaJIT instead of the stock Lua.']]
- end
-
def install
# Install to the Cellar, but direct modules to HOMEBREW_PREFIX
args = ["--prefix=#{prefix}",
"--rocks-tree=#{HOMEBREW_PREFIX}",
"--sysconfdir=#{etc}/luarocks"]
- if use_luajit?
+ if build.include? 'with-luajit'
args << "--with-lua-include=#{HOMEBREW_PREFIX}/include/luajit-2.0"
args << "--lua-suffix=jit"
end