aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/glbinding.rb
blob: d643cce3b67c4eae57390f768659ad7b548862b8 (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
class Glbinding < Formula
  homepage "https://github.com/hpicgs/glbinding"
  url "https://github.com/hpicgs/glbinding/archive/v1.0.4.tar.gz"
  sha1 "1f371b40f6c9c42807aa14d9ef9e1153c95472bf"

  bottle do
    cellar :any
    sha1 "5d2c6520ef505da92d44b9bafad53b032b6796e2" => :yosemite
    sha1 "4659c4bcc97959b40cbbc9212a3ff3b91b2df4eb" => :mavericks
    sha1 "0f3d59555b51ee9202a7d32a42e6f1aff3e9297d" => :mountain_lion
  end

  depends_on "cmake" => :build
  needs :cxx11

  def install
    ENV.cxx11
    system "cmake", ".", *std_cmake_args
    system "make", "install"
  end

  test do
    (testpath/"test.cpp").write <<-EOS.undent
      #include <glbinding/gl/gl.h>
      #include <glbinding/Binding.h>
      int main(void)
      {
        glbinding::Binding::initialize();
      }
      EOS
    system ENV.cxx, "-o", "test", "test.cpp", "-std=c++11", "-stdlib=libc++",
                    "-I#{include}/glbinding", "-I#{lib}/glbinding",
                    "-lglbinding", *ENV.cflags.to_s.split
    system "./test"
  end
end