2015-01-10 14:44:59 +00:00
|
|
|
class Libepoxy < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Library for handling OpenGL function pointer management"
|
2015-01-10 14:44:59 +00:00
|
|
|
homepage "https://github.com/anholt/libepoxy"
|
2015-07-18 11:32:31 +00:00
|
|
|
url "https://github.com/anholt/libepoxy/archive/v1.3.1.tar.gz"
|
|
|
|
sha256 "6700ddedffb827b42c72cce1e0be6fba67b678b19bf256e1b5efd3ea38cc2bb4"
|
2015-01-10 14:44:59 +00:00
|
|
|
|
2015-02-18 20:31:49 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2015-07-18 12:14:24 +00:00
|
|
|
sha256 "4c4c34f77832f75974a9ce48020391a03830b5649a6759253ce208a6eca63074" => :yosemite
|
|
|
|
sha256 "edc04249dcc083ed487de29eb8401d788fbcfed58988ebe6a75e1cae5613831f" => :mavericks
|
|
|
|
sha256 "495b9da3d417b836eaf1cdd1aba41782d975d0b3d007e1f9c91fab7e57c2a197" => :mountain_lion
|
2015-02-18 20:31:49 +00:00
|
|
|
end
|
|
|
|
|
2015-01-10 14:44:59 +00:00
|
|
|
depends_on "pkg-config" => :build
|
|
|
|
depends_on "automake" => :build
|
|
|
|
depends_on "autoconf" => :build
|
|
|
|
depends_on "libtool" => :build
|
2015-05-21 15:41:15 +00:00
|
|
|
depends_on :python => :build if MacOS.version <= :snow_leopard
|
2015-01-10 14:44:59 +00:00
|
|
|
|
|
|
|
resource "xorg-macros" do
|
|
|
|
url "http://xorg.freedesktop.org/releases/individual/util/util-macros-1.19.0.tar.bz2"
|
|
|
|
sha256 "2835b11829ee634e19fa56517b4cfc52ef39acea0cd82e15f68096e27cbed0ba"
|
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
|
|
|
resource("xorg-macros").stage do
|
|
|
|
system "./configure", "--prefix=#{buildpath}/xorg-macros"
|
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
|
|
|
|
ENV.append_path "PKG_CONFIG_PATH", "#{buildpath}/xorg-macros/share/pkgconfig"
|
|
|
|
ENV.append_path "ACLOCAL_PATH", "#{buildpath}/xorg-macros/share/aclocal"
|
|
|
|
|
|
|
|
system "./autogen.sh", "--disable-dependency-tracking",
|
|
|
|
"--prefix=#{prefix}"
|
|
|
|
system "make"
|
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test.c").write <<-EOS.undent
|
|
|
|
|
|
|
|
#include <epoxy/gl.h>
|
|
|
|
#include <OpenGL/CGLContext.h>
|
|
|
|
#include <OpenGL/CGLTypes.h>
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
CGLPixelFormatAttribute attribs[] = {0};
|
|
|
|
CGLPixelFormatObj pix;
|
|
|
|
int npix;
|
|
|
|
CGLContextObj ctx;
|
|
|
|
|
|
|
|
CGLChoosePixelFormat( attribs, &pix, &npix );
|
|
|
|
CGLCreateContext(pix, (void*)0, &ctx);
|
|
|
|
|
|
|
|
glClear(GL_COLOR_BUFFER_BIT);
|
|
|
|
CGLReleasePixelFormat(pix);
|
|
|
|
CGLReleaseContext(pix);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOS
|
|
|
|
system ENV.cc, "test.c", "-lepoxy", "-framework", "OpenGL", "-o", "test"
|
|
|
|
system "ls", "-lh", "test"
|
|
|
|
system "file", "test"
|
|
|
|
system "./test"
|
|
|
|
end
|
|
|
|
end
|