2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-09-20 16:51:35 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Gnuplot < Formula
|
2010-05-10 04:18:50 +00:00
|
|
|
homepage 'http://www.gnuplot.info'
|
2012-03-14 06:37:41 +00:00
|
|
|
url 'http://downloads.sourceforge.net/project/gnuplot/gnuplot/4.6.0/gnuplot-4.6.0.tar.gz'
|
2012-09-03 18:33:56 +00:00
|
|
|
sha1 '9a43ae13546d97d4b174533ddac31a14e0edc9b2'
|
2012-07-07 18:08:22 +00:00
|
|
|
|
2012-01-04 07:20:58 +00:00
|
|
|
head 'cvs://:pserver:anonymous@gnuplot.cvs.sourceforge.net:/cvsroot/gnuplot:gnuplot', :using => :cvs
|
2010-03-15 12:10:07 +00:00
|
|
|
|
2012-11-01 14:53:41 +00:00
|
|
|
option 'pdf', 'Build with pdflib-lite support'
|
|
|
|
option 'wx', 'Build with wxWidgets support'
|
|
|
|
option 'nolua', 'Build without lua support'
|
|
|
|
option 'nogd', 'Build without gd support'
|
|
|
|
option 'with-x', 'Build with X support'
|
|
|
|
option 'without-emacs', 'Do not build Emacs lisp files'
|
2012-09-20 16:56:53 +00:00
|
|
|
|
|
|
|
if build.head?
|
2012-07-07 18:08:22 +00:00
|
|
|
depends_on :automake
|
|
|
|
depends_on :libtool
|
|
|
|
end
|
|
|
|
|
2010-09-19 17:21:57 +00:00
|
|
|
depends_on 'pkg-config' => :build
|
2009-09-20 16:51:35 +00:00
|
|
|
depends_on 'readline'
|
2012-10-21 16:49:24 +00:00
|
|
|
depends_on 'pango' unless build.include? 'with-x' or MacOS::X11.installed?
|
|
|
|
depends_on :x11 if build.include? 'with-x' or MacOS::X11.installed?
|
2012-09-20 16:56:53 +00:00
|
|
|
depends_on 'pdflib-lite' if build.include? 'pdf'
|
|
|
|
depends_on 'lua' unless build.include? 'nolua'
|
|
|
|
depends_on 'gd' unless build.include? 'nogd'
|
|
|
|
depends_on 'wxmac' if build.include? 'wx'
|
2010-08-10 20:05:20 +00:00
|
|
|
|
2012-09-22 15:40:43 +00:00
|
|
|
def patches
|
|
|
|
# MacPorts patch --without-aquaterm as a configuration option. Submitted
|
|
|
|
# upstream:
|
|
|
|
# http://sourceforge.net/tracker/?func=detail&aid=3476165&group_id=2055&atid=302055
|
|
|
|
{:p0 => 'https://trac.macports.org/export/96897/trunk/dports/math/gnuplot/files/patch-configure-aquaterm.diff'}
|
|
|
|
end
|
|
|
|
|
2009-09-20 16:51:35 +00:00
|
|
|
def install
|
2011-03-19 00:10:22 +00:00
|
|
|
# Help configure find libraries
|
|
|
|
readline = Formula.factory 'readline'
|
|
|
|
pdflib = Formula.factory 'pdflib-lite'
|
|
|
|
gd = Formula.factory 'gd'
|
|
|
|
|
2012-09-22 15:40:43 +00:00
|
|
|
# Aquaterm disabled due to breakage. See:
|
2012-11-01 14:53:41 +00:00
|
|
|
# https://github.com/mxcl/homebrew/issues/14647
|
2012-09-22 15:40:43 +00:00
|
|
|
args = %W[
|
|
|
|
--disable-debug
|
|
|
|
--disable-dependency-tracking
|
|
|
|
--prefix=#{prefix}
|
|
|
|
--with-readline=#{readline.prefix}
|
|
|
|
--without-aquaterm
|
|
|
|
]
|
2012-01-04 07:20:58 +00:00
|
|
|
|
2012-11-01 14:53:41 +00:00
|
|
|
args << "--disable-wxwidgets" unless build.include? 'wx'
|
2012-09-20 16:56:53 +00:00
|
|
|
args << "--with-pdf=#{pdflib.prefix}" if build.include? 'pdf'
|
2012-11-01 14:53:41 +00:00
|
|
|
args << "--without-lua" if build.include? 'nolua'
|
|
|
|
args << "--without-lisp-files" if build.include? 'without-emacs'
|
2012-01-04 07:20:58 +00:00
|
|
|
|
2012-09-20 16:56:53 +00:00
|
|
|
if build.include? 'nogd'
|
2011-03-19 00:10:22 +00:00
|
|
|
args << '--without-gd'
|
|
|
|
else
|
|
|
|
args << "--with-gd=#{gd.prefix}"
|
|
|
|
end
|
2010-06-16 04:16:40 +00:00
|
|
|
|
2012-09-20 16:56:53 +00:00
|
|
|
system 'autoreconf' if build.head?
|
2012-01-04 07:20:58 +00:00
|
|
|
|
2010-06-16 04:16:40 +00:00
|
|
|
system "./configure", *args
|
2009-09-20 16:51:35 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
2012-01-04 07:20:58 +00:00
|
|
|
|
|
|
|
def test
|
2012-05-15 21:36:45 +00:00
|
|
|
system "#{bin}/gnuplot", "--version"
|
2012-01-04 07:20:58 +00:00
|
|
|
end
|
2009-09-20 16:51:35 +00:00
|
|
|
end
|