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 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