2013-01-24 15:52:17 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Freeglut < Formula
|
|
|
|
homepage 'http://freeglut.sourceforge.net/'
|
2013-06-20 23:08:35 +00:00
|
|
|
url 'http://downloads.sourceforge.net/project/freeglut/freeglut/2.8.1/freeglut-2.8.1.tar.gz'
|
2013-06-26 16:48:28 +00:00
|
|
|
sha1 '7330b622481e2226c0c9f6d2e72febe96b03f9c4'
|
2013-01-24 15:52:17 +00:00
|
|
|
|
2013-06-27 03:43:49 +00:00
|
|
|
# Examples won't build on Snow Leopard as one of them requires
|
|
|
|
# a header the system provided X11 doesn't have.
|
|
|
|
option 'with-examples', "Build the examples."
|
2013-08-25 18:04:01 +00:00
|
|
|
option :universal
|
2013-06-27 03:43:49 +00:00
|
|
|
|
2013-01-24 15:52:17 +00:00
|
|
|
depends_on :x11
|
|
|
|
|
2013-06-26 16:48:28 +00:00
|
|
|
def patches
|
|
|
|
DATA if MacOS.version >= :lion
|
|
|
|
end
|
|
|
|
|
2013-01-24 15:52:17 +00:00
|
|
|
def install
|
2013-08-25 18:04:01 +00:00
|
|
|
ENV.universal_binary if build.universal?
|
2013-06-26 16:48:28 +00:00
|
|
|
system "./configure", "--disable-debug",
|
|
|
|
"--disable-dependency-tracking",
|
2013-01-24 15:52:17 +00:00
|
|
|
"--prefix=#{prefix}"
|
2013-06-27 03:43:49 +00:00
|
|
|
|
|
|
|
if build.without?('examples') || MacOS.version < :lion
|
|
|
|
inreplace 'Makefile' do |s|
|
|
|
|
s.change_make_var! 'SUBDIRS', 'src include doc'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-01-24 15:52:17 +00:00
|
|
|
system "make all"
|
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
end
|
2013-06-26 16:48:28 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
|
|
|
|
diff -ur org/freeglut-2.8.1/include/GL/freeglut_std.h freeglut-2.8.1/include/GL/freeglut_std.h
|
|
|
|
--- org/freeglut-2.8.1/include/GL/freeglut_std.h
|
|
|
|
+++ freeglut-2.8.1/include/GL/freeglut_std.h
|
|
|
|
@@ -122,7 +122,7 @@
|
|
|
|
* Always include OpenGL and GLU headers
|
|
|
|
*/
|
|
|
|
#if __APPLE__
|
|
|
|
-# include <OpenGL/gl.h>
|
|
|
|
+# include <OpenGL/gl3.h>
|
|
|
|
# include <OpenGL/glu.h>
|
|
|
|
#else
|
|
|
|
# include <GL/gl.h>
|