2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-09-15 09:23:45 +00:00
|
|
|
|
|
|
|
class Luarocks <Formula
|
2010-06-23 19:30:26 +00:00
|
|
|
url 'http://luarocks.org/releases/luarocks-2.0.2.tar.gz'
|
|
|
|
homepage 'http://luarocks.org'
|
|
|
|
md5 'f8b13b642f8bf16740cac009580cda48'
|
2009-09-15 09:23:45 +00:00
|
|
|
|
|
|
|
depends_on 'lua'
|
|
|
|
|
|
|
|
def install
|
2010-06-23 19:30:23 +00:00
|
|
|
# Install to the Cellar, but direct modules to HOMEBREW_PREFIX
|
2010-09-13 22:16:09 +00:00
|
|
|
# Configure can detect 'wget' to use as a downloader, but we don't
|
|
|
|
# require it since curl works too and comes with OS X.
|
2010-06-23 19:30:23 +00:00
|
|
|
system "./configure", "--prefix=#{prefix}",
|
|
|
|
"--rocks-tree=#{HOMEBREW_PREFIX}/lib/luarocks",
|
|
|
|
"--sysconfdir=#{etc}/luarocks"
|
2009-09-15 09:23:45 +00:00
|
|
|
system "make"
|
|
|
|
system "make install"
|
|
|
|
end
|
2010-06-30 17:03:22 +00:00
|
|
|
|
|
|
|
def test
|
|
|
|
opoo "Luarocks test script installs 'lpeg'"
|
|
|
|
system "luarocks install lpeg"
|
|
|
|
system "lua", "-lluarocks.loader", "-llpeg", "-e", 'print ("Hello World!")'
|
|
|
|
end
|
2009-09-15 09:23:45 +00:00
|
|
|
end
|