blob: 375ec8e6a01e0acef76785a98292b1acbb805123 (
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
36
37
38
39
40
41
42
43
44
45
46
47
 | require "formula"
class GameMusicEmu < Formula
  homepage "https://code.google.com/p/game-music-emu/"
  url "https://game-music-emu.googlecode.com/files/game-music-emu-0.6.0.tar.bz2"
  sha1 "53f9af30dc1c8110135207c9ca35c1fa6716ddcf"
  head "http://game-music-emu.googlecode.com/svn/trunk/"
  bottle do
    cellar :any
    sha1 "ceef76e75ac6ba2cc10f3d909fa42884a54a7833" => :yosemite
    sha1 "bc298aea7a024e60411c1cb2f6f778656dad7bc1" => :mavericks
    sha1 "5f5ceca1e279614d32a06134d0f35585fd0d2446" => :mountain_lion
  end
  depends_on "cmake" => :build
  def install
    system "cmake", ".", *std_cmake_args
    system "make", "install"
  end
  test do
    (testpath/"test.c").write <<-EOS.undent
      #include <gme/gme.h>
      int main(void)
      {
        Music_Emu* emu;
        gme_err_t error;
        error = gme_open_data((void*)0, 0, &emu, 44100);
        if (error == gme_wrong_file_type) {
          return 0;
        } else {
          return -1;
        }
      }
    EOS
    system ENV.cc, "test.c", "-I#{include}", "-L#{lib}",
                   "-lgme", "-o", "test", *ENV.cflags.to_s.split
    system "./test"
  end
end
 |