aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/bam.rb
blob: 32cfd127c0085580a42bfdf5eb1e602d056e47f9 (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
27
28
29
30
31
32
33
34
35
class Bam < Formula
  homepage "http://matricks.github.io/bam/"
  url "https://github.com/downloads/matricks/bam/bam-0.4.0.tar.gz"
  sha1 "c0f32ff9272d5552e02a9d68fbdd72106437ee69"

  head "https://github.com/matricks/bam.git"

  bottle do
    cellar :any
    sha1 "7ec0b273b35f7e543cc6a1810a14e14062f81639" => :yosemite
    sha1 "6b531fb8df899d603f93262f87cfdcb8001b8436" => :mavericks
    sha1 "dce2512abc5625827a16becba635941b007c16dd" => :mountain_lion
  end

  def install
    system "./make_unix.sh"
    bin.install "bam"
  end

  test do
    (testpath/"hello.c").write <<-EOS.undent
      #include <stdio.h>
      int main(void) { printf("hello\\n"); return 0; }
    EOS

    (testpath/"bam.lua").write <<-EOS.undent
      settings = NewSettings()
      objs = Compile(settings, Collect("*.c"))
      exe = Link(settings, "hello", objs)
    EOS

    system "bam", "-v"
    assert_equal "hello\n", shell_output("./hello")
  end
end