2011-03-10 05:11:03 +00:00
|
|
|
class Glew < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "OpenGL Extension Wrangler Library"
|
2014-08-17 03:26:35 +00:00
|
|
|
homepage "http://glew.sourceforge.net/"
|
2015-11-16 05:01:28 +00:00
|
|
|
url "https://downloads.sourceforge.net/project/glew/glew/1.13.0/glew-1.13.0.tgz"
|
|
|
|
mirror "https://mirrors.kernel.org/debian/pool/main/g/glew/glew_1.13.0.orig.tar.gz"
|
|
|
|
sha256 "aa25dc48ed84b0b64b8d41cdd42c8f40f149c37fa2ffa39cd97f42c78d128bc7"
|
|
|
|
head "https://github.com/nigels-com/glew.git"
|
2014-06-09 16:05:56 +00:00
|
|
|
|
2015-05-12 09:11:39 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2015-11-16 15:32:21 +00:00
|
|
|
sha256 "a0d99f5538ffc0a182f227934753b0129b5b6cdfdc790cf7ef208fb4d8b00845" => :el_capitan
|
|
|
|
sha256 "351ff9dbee1b1307720a2e3ad8e86c28975b3bc2614cfbc7ae45492cb3810062" => :yosemite
|
|
|
|
sha256 "a8d8c2095176c09b10667627de9861b0e35d310bcd860922a2be4037a3e6418c" => :mavericks
|
2015-05-12 09:11:39 +00:00
|
|
|
end
|
|
|
|
|
2014-10-30 02:11:59 +00:00
|
|
|
option :universal
|
|
|
|
|
2010-03-27 19:51:13 +00:00
|
|
|
def install
|
2014-08-17 03:26:35 +00:00
|
|
|
# Makefile directory race condition on lion
|
|
|
|
ENV.deparallelize
|
|
|
|
|
2014-10-30 18:29:11 +00:00
|
|
|
if build.universal?
|
|
|
|
ENV.universal_binary
|
|
|
|
|
|
|
|
# Do not strip resulting binaries; https://sourceforge.net/p/glew/bugs/259/
|
|
|
|
ENV["STRIP"] = ""
|
|
|
|
end
|
2014-10-30 02:11:59 +00:00
|
|
|
|
2014-08-17 03:26:35 +00:00
|
|
|
inreplace "glew.pc.in", "Requires: @requireslib@", ""
|
2014-09-02 14:26:06 +00:00
|
|
|
system "make", "GLEW_PREFIX=#{prefix}", "GLEW_DEST=#{prefix}", "all"
|
|
|
|
system "make", "GLEW_PREFIX=#{prefix}", "GLEW_DEST=#{prefix}", "install.all"
|
2015-11-16 05:01:28 +00:00
|
|
|
|
|
|
|
doc.install Dir["doc/*"]
|
2010-03-27 19:51:13 +00:00
|
|
|
end
|
2015-05-09 21:18:02 +00:00
|
|
|
|
|
|
|
test do
|
2015-11-16 05:01:28 +00:00
|
|
|
(testpath/"test.c").write <<-EOS.undent
|
|
|
|
#include <GL/glew.h>
|
|
|
|
#include <GLUT/glut.h>
|
|
|
|
|
|
|
|
int main(int argc, char** argv) {
|
|
|
|
glutInit(&argc, argv);
|
|
|
|
glutCreateWindow("GLEW Test");
|
|
|
|
GLenum err = glewInit();
|
|
|
|
if (GLEW_OK != err) {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOS
|
|
|
|
system ENV.cc, "-framework", "OpenGL", "-framework", "GLUT",
|
|
|
|
"-lglew", testpath/"test.c", "-o", "test"
|
|
|
|
system "./test"
|
2015-05-09 21:18:02 +00:00
|
|
|
end
|
2010-03-27 19:51:13 +00:00
|
|
|
end
|