aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authornibbles 2bits2012-09-07 17:07:31 -0700
committerMike McQuaid2013-01-31 19:35:06 -0800
commit1c201c26ef77a702360303f5334e71e7399472a8 (patch)
treee86725e5442a0d7ab720760ad329ebe1dfc5da28 /Library/Formula
parentdb801bf1e659bbabe7629c5a1300cc1803e0b322 (diff)
downloadhomebrew-1c201c26ef77a702360303f5334e71e7399472a8.tar.bz2
mathgl 2.0.3 plus options
MathGL gets a major overhaul because it can do a lot more. - Upgrade to 2.0.3 - By default enable glut, gsl, jpeg, png, pthread, pdf - Disable python (refuses to find numpy) - Disable octave interface (installs a tarball to ~/ocatave) - Add a dep on jpeg to support our default image capability - Add a dep on libharu to support our default pdf capability. - Add a dep on cmake because it's the only builder now. - Add an option to enable fltk widget and mglview using X11. - Add an option to enable qt4 widget, udav, and mglview using Qt4. - Add an option to enable wxWidgets widget - Add an option to enable GIF support. - Add an option to enable hdf5 support. - Add optional deps for the above options. - Remove a symlink in the source, ChangeLog, to fix install errors. - Build OOS. - Install the `mgl_example` files manually. - Works well with superenv. Closes #14799. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/mathgl.rb53
1 files changed, 41 insertions, 12 deletions
diff --git a/Library/Formula/mathgl.rb b/Library/Formula/mathgl.rb
index 809b1bda9..54def0cd2 100644
--- a/Library/Formula/mathgl.rb
+++ b/Library/Formula/mathgl.rb
@@ -2,23 +2,52 @@ require 'formula'
class Mathgl < Formula
homepage 'http://mathgl.sourceforge.net/'
- url 'http://downloads.sourceforge.net/mathgl/mathgl-1.11.2.tar.gz'
- sha1 '16b9ab58e654c5b91374f8a35eafc33630d7f5c0'
+ url 'http://sourceforge.net/projects/mathgl/files/mathgl/mathgl%202.0.3/mathgl-2.0.3.tar.gz'
+ sha1 'c032cf53de3f6d3d5e45f6ff9e26889617770f02'
- depends_on 'gsl'
- depends_on :libpng
+ option 'fltk', 'Build the fltk widget and mglview using X11'
+ option 'qt4', 'Build the Qt widget, the udav gui, and mglview using Qt4'
+ option 'wx', 'Build the wxWidget widget'
+ option 'gif', 'Build support for GIF'
+ option 'hdf5', 'Build support for hdf5'
+
+ depends_on 'cmake' => :build
+ depends_on 'gsl' => :recommended
+ depends_on 'jpeg' => :recommended
+ depends_on 'libharu' => :recommended
+ depends_on :libpng => :recommended
+ depends_on 'hdf5' if build.include? 'hdf5'
+ depends_on 'fltk' if build.include? 'fltk'
+ depends_on 'qt' if build.include? 'qt4'
+ depends_on 'wxmac' if build.include? 'wx'
+ depends_on 'giflib' if build.include? 'gif'
+ depends_on :x11 if build.include? 'fltk'
def install
- ENV['LIBS'] = '-lz'
+ args = std_cmake_args + %w[
+ -Denable-glut=ON
+ -Denable-gsl=ON
+ -Denable-jpeg=ON
+ -Denable-pthread=ON
+ -Denable-pdf=ON
+ -Denable-python=OFF
+ -Denable-octave=OFF
+ ]
- # Fixed upstream: this line can be removed when v2 is released
- inreplace ["mgl/mgl_export.cpp", "mgl/mgl_data_png.cpp"] do |s|
- s.gsub! /#include <png.h>/, "#include <zlib.h>\n#include <png.h>"
+ args << '-Denable-qt=ON' if build.include? 'qt4'
+ args << '-Denable-gif=ON' if build.include? 'gif'
+ args << '-Denable-hdf5_18=ON' if build.include? 'hdf5'
+ args << '-Denable-fltk=ON' if build.include? 'fltk'
+ args << '-Denable-wx=ON' if build.include? 'wx'
+ args << '..'
+ rm 'ChangeLog' if File.exist? 'ChangeLog' # rm this problematic symlink.
+ mkdir 'brewery' do
+ system 'cmake', *args
+ system 'make install'
+ cd 'examples' do
+ bin.install Dir['mgl*_example']
+ end
end
-
- system "./configure", "--prefix=#{prefix}"
- system "make"
- system "make install"
end
def test