aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/csfml.rb
blob: 64bf239d5ae5ca4d4be6a3557e9130b5fa16c3fb (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
require "formula"

class Csfml < Formula
  homepage "http://www.sfml-dev.org/"
  url "http://www.sfml-dev.org/download/csfml/CSFML-2.0-sources.zip"
  sha1 "6d831634a558593580296209af278322523f1e43"

  bottle do
    cellar :any
    sha1 "cd9aa7a1b25776c479b28d590a47faeef3d9c998" => :mavericks
    sha1 "bbebd99be16cf18fb2d4c298148fd6b4a49d2d99" => :mountain_lion
    sha1 "5671fb2cd53398283e45761a101099dcbbe81a17" => :lion
  end

  depends_on "cmake" => :build
  depends_on "sfml"

  def install
    cp_r "#{Formula["sfml"].share}/SFML/cmake/Modules/", "cmake"
    system "cmake", ".", *std_cmake_args
    system "make", "install"
  end

  test do
    (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
    system ENV.cc, "test.c", "-lcsfml-window", "-o", "test"
    system "./test"
  end
end