homebrew-core/Formula/csfml.rb

30 lines
739 B
Ruby
Raw Normal View History

require "formula"
class Csfml < Formula
homepage "http://www.sfml-dev.org/"
url "http://www.sfml-dev.org/download/csfml/CSFML-2.2-sources.zip"
sha1 "1dc3d2dadef6e6daa05b0dd868367ad5f02419e4"
depends_on "cmake" => :build
depends_on "sfml"
def install
system "cmake", ".", "-DCMAKE_MODULE_PATH=#{Formula["sfml"].share}/SFML/cmake/Modules/", *std_cmake_args
system "make", "install"
end
test do
2014-08-30 07:16:04 +00:00
(testpath/"test.c").write <<-EOS.undent
#include <SFML/Window.h>
int main (void)
{
sfWindow * w = sfWindow_create (sfVideoMode_getDesktopMode (), "Test", 0, NULL);
return 0;
}
EOS
2014-08-30 07:16:04 +00:00
system ENV.cc, "test.c", "-lcsfml-window", "-o", "test"
system "./test"
end
end