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'
|
|
|
|
md5 '8e6e92b4596ea0eb75e16a57fc79efec'
|
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
|
|
|
|
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-03-11 19:58:21 +00:00
|
|
|
depends_on 'pango'
|
2010-03-23 10:58:39 +00:00
|
|
|
depends_on 'pdflib-lite' if ARGV.include? "--pdf"
|
2011-03-19 00:10:22 +00:00
|
|
|
depends_on 'lua' unless ARGV.include? '--nolua'
|
|
|
|
depends_on 'gd' unless ARGV.include? "--nogd"
|
2012-01-04 07:20:58 +00:00
|
|
|
depends_on 'wxmac' if ARGV.include? "--wx"
|
2009-09-20 16:51:35 +00:00
|
|
|
|
2012-02-29 01:44:13 +00:00
|
|
|
if ARGV.build_head? and MacOS.xcode_version >= "4.3"
|
|
|
|
depends_on "automake" => :build
|
|
|
|
depends_on "libtool" => :build
|
|
|
|
end
|
|
|
|
|
2010-08-10 20:05:20 +00:00
|
|
|
def options
|
|
|
|
[
|
2011-03-19 00:10:22 +00:00
|
|
|
["--pdf", "Build with pdflib-lite support."],
|
2012-01-04 07:20:58 +00:00
|
|
|
["--wx", "Build with wxWidgets support."],
|
2011-03-19 00:10:22 +00:00
|
|
|
["--nolua", "Build without lua support."],
|
2010-08-10 20:05:20 +00:00
|
|
|
["--nogd", "Build without gd support."]
|
|
|
|
]
|
|
|
|
end
|
|
|
|
|
2009-09-20 16:51:35 +00:00
|
|
|
def install
|
2011-03-19 00:10:22 +00:00
|
|
|
# Help configure find libraries
|
2010-03-15 12:10:07 +00:00
|
|
|
ENV.x11
|
2011-03-19 00:10:22 +00:00
|
|
|
readline = Formula.factory 'readline'
|
|
|
|
pdflib = Formula.factory 'pdflib-lite'
|
|
|
|
gd = Formula.factory 'gd'
|
|
|
|
|
2010-06-16 04:16:40 +00:00
|
|
|
args = ["--disable-debug", "--disable-dependency-tracking",
|
|
|
|
"--prefix=#{prefix}",
|
2012-01-04 07:20:58 +00:00
|
|
|
"--with-readline=#{readline.prefix}"]
|
|
|
|
|
|
|
|
args << "--disable-wxwidgets" unless ARGV.include? "--wx"
|
2011-03-19 00:10:22 +00:00
|
|
|
args << "--with-pdf=#{pdflib.prefix}" if ARGV.include? '--pdf'
|
|
|
|
args << "--without-lua" if ARGV.include? "--nolua"
|
2012-01-04 07:20:58 +00:00
|
|
|
|
2011-03-19 00:10:22 +00:00
|
|
|
if ARGV.include? '--nogd'
|
|
|
|
args << '--without-gd'
|
|
|
|
else
|
|
|
|
args << "--with-gd=#{gd.prefix}"
|
|
|
|
end
|
2010-06-16 04:16:40 +00:00
|
|
|
|
2012-01-04 07:20:58 +00:00
|
|
|
system "autoreconf" if ARGV.build_head?
|
|
|
|
|
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
|