2011-06-18 15:36:44 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class MesalibGlw < Formula
|
|
|
|
homepage 'http://www.mesa3d.org'
|
2012-09-04 03:22:58 +00:00
|
|
|
url 'http://downloads.sourceforge.net/project/mesa3d/MesaLib/7.2/MesaLib-7.2.tar.gz'
|
2012-09-03 18:33:56 +00:00
|
|
|
sha1 '6390ece818ec6fecacaafe3618ae844cf5f92b92'
|
2011-06-18 15:36:44 +00:00
|
|
|
|
2012-06-07 01:35:12 +00:00
|
|
|
depends_on :x11
|
|
|
|
|
2012-09-04 03:25:23 +00:00
|
|
|
option 'enable-static', "Build static library"
|
2011-06-18 15:36:44 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
args = ["--disable-debug", "--disable-dependency-tracking",
|
|
|
|
"--prefix=#{prefix}"]
|
|
|
|
args << "--with-driver=xlib"
|
|
|
|
args << "--disable-gl-osmesa"
|
|
|
|
args << "--disable-glu"
|
|
|
|
args << "--disable-glut"
|
|
|
|
|
2012-09-04 03:22:58 +00:00
|
|
|
if build.include? 'enable-static'
|
2011-06-18 15:36:44 +00:00
|
|
|
args << "--enable-static"
|
|
|
|
end
|
|
|
|
|
|
|
|
system "./configure", *args
|
|
|
|
|
|
|
|
inreplace 'configs/autoconf' do |s|
|
|
|
|
s.gsub! /.so/, '.dylib'
|
|
|
|
s.gsub! /SRC_DIRS = mesa glw/, 'SRC_DIRS = glw'
|
2012-08-06 05:33:36 +00:00
|
|
|
s.gsub! /-L\$\(TOP\)\/\$\(LIB_DIR\)/, "-L#{MacOS::X11.lib}"
|
2011-06-18 15:36:44 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
inreplace 'src/glw/Makefile' do |s|
|
|
|
|
s.gsub! /-I\$\(TOP\)\/include /, ''
|
|
|
|
end
|
|
|
|
|
|
|
|
system "make"
|
|
|
|
|
|
|
|
(include+'GL').mkpath
|
|
|
|
(include+'GL').install Dir['src/glw/*.h']
|
|
|
|
lib.install Dir['lib/*']
|
|
|
|
end
|
|
|
|
end
|