aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/luarocks.rb
blob: e136ad1cff4a48998a2c6d50e21b35eea0c74995 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
require 'formula'

class Luarocks <Formula
  url 'http://luarocks.org/releases/luarocks-2.0.2.tar.gz'
  homepage 'http://luarocks.org'
  md5 'f8b13b642f8bf16740cac009580cda48'

  depends_on 'lua'
  # wget or curl can be used as the downloader...
  # depends_on 'wget' => :optional

  def install
    # Install to the Cellar, but direct modules to HOMEBREW_PREFIX
    system "./configure", "--prefix=#{prefix}",
                          "--rocks-tree=#{HOMEBREW_PREFIX}/lib/luarocks",
                          "--sysconfdir=#{etc}/luarocks"
    system "make"
    system "make install"
  end

  def test
    opoo "Luarocks test script installs 'lpeg'"
    system "luarocks install lpeg"
    system "lua", "-lluarocks.loader", "-llpeg", "-e", 'print ("Hello World!")'
  end
end