homebrew-core/Formula/gnuplot.rb

63 lines
1.7 KiB
Ruby
Raw Normal View History

require 'formula'
2011-03-10 05:11:03 +00:00
class Gnuplot < Formula
2010-05-10 04:18:50 +00:00
homepage 'http://www.gnuplot.info'
url 'http://downloads.sourceforge.net/project/gnuplot/gnuplot/4.6.0/gnuplot-4.6.0.tar.gz'
sha1 '9a43ae13546d97d4b174533ddac31a14e0edc9b2'
2012-07-07 18:08:22 +00:00
head 'cvs://:pserver:anonymous@gnuplot.cvs.sourceforge.net:/cvsroot/gnuplot:gnuplot', :using => :cvs
2012-07-07 18:08:22 +00:00
if ARGV.build_head?
depends_on :automake
depends_on :libtool
end
depends_on 'pkg-config' => :build
depends_on 'readline'
2012-03-11 19:58:21 +00:00
depends_on 'pango'
depends_on :x11
depends_on 'pdflib-lite' if ARGV.include? "--pdf"
depends_on 'lua' unless ARGV.include? '--nolua'
depends_on 'gd' unless ARGV.include? "--nogd"
depends_on 'wxmac' if ARGV.include? "--wx"
2010-08-10 20:05:20 +00:00
def options
[
["--pdf", "Build with pdflib-lite support."],
["--wx", "Build with wxWidgets support."],
["--nolua", "Build without lua support."],
2010-08-10 20:05:20 +00:00
["--nogd", "Build without gd support."]
]
end
def install
# Help configure find libraries
readline = Formula.factory 'readline'
pdflib = Formula.factory 'pdflib-lite'
gd = Formula.factory 'gd'
args = ["--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--with-readline=#{readline.prefix}"]
args << "--disable-wxwidgets" unless ARGV.include? "--wx"
args << "--with-pdf=#{pdflib.prefix}" if ARGV.include? '--pdf'
args << "--without-lua" if ARGV.include? "--nolua"
if ARGV.include? '--nogd'
args << '--without-gd'
else
args << "--with-gd=#{gd.prefix}"
end
system "autoreconf" if ARGV.build_head?
system "./configure", *args
system "make install"
end
def test
system "#{bin}/gnuplot", "--version"
end
end