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-11-03 16:09:48 +00:00
|
|
|
url 'http://downloads.sourceforge.net/project/gnuplot/gnuplot/4.6.1/gnuplot-4.6.1.tar.gz'
|
|
|
|
sha1 '1ea21a628223159b0297ae65fe8293afd5aab3c0'
|
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-03 16:09:48 +00:00
|
|
|
option 'pdf', 'Build the PDF terminal using pdflib-lite'
|
|
|
|
option 'wx', 'Build the wxWidgets terminal using pango'
|
|
|
|
option 'with-x', 'Build the X11 terminal'
|
|
|
|
option 'qt', 'Build the Qt4 terminal'
|
2012-12-27 16:49:49 +00:00
|
|
|
option 'cairo', 'Build the Cairo based terminals'
|
2012-11-03 16:09:48 +00:00
|
|
|
option 'nolua', 'Build without the lua/TikZ terminal'
|
|
|
|
option 'nogd', 'Build without gd support'
|
|
|
|
option 'tests', 'Verify the build with make check (1 min)'
|
2012-11-01 14:53:41 +00:00
|
|
|
option 'without-emacs', 'Do not build Emacs lisp files'
|
2012-12-29 00:39:20 +00:00
|
|
|
option 'latex', 'Build with LaTeX support'
|
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
|
2012-11-11 03:12:26 +00:00
|
|
|
depends_on 'readline'
|
2012-11-03 16:09:48 +00:00
|
|
|
depends_on 'pango' if build.include? 'cairo' or build.include? 'wx'
|
|
|
|
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'
|
2012-11-03 16:09:48 +00:00
|
|
|
depends_on 'lua' unless build.include? 'nolua'
|
|
|
|
depends_on 'gd' unless build.include? 'nogd'
|
|
|
|
depends_on 'wxmac' if build.include? 'wx'
|
|
|
|
depends_on 'qt' if build.include? 'qt'
|
2012-12-29 00:39:20 +00:00
|
|
|
depends_on :tex if build.include? 'latex'
|
2012-09-22 15:40:43 +00:00
|
|
|
|
2009-09-20 16:51:35 +00:00
|
|
|
def install
|
2011-03-19 00:10:22 +00:00
|
|
|
# Help configure find libraries
|
2012-11-11 03:12:26 +00:00
|
|
|
readline = Formula.factory 'readline'
|
2011-03-19 00:10:22 +00:00
|
|
|
pdflib = Formula.factory 'pdflib-lite'
|
|
|
|
gd = Formula.factory 'gd'
|
|
|
|
|
2012-09-22 15:40:43 +00:00
|
|
|
args = %W[
|
|
|
|
--disable-dependency-tracking
|
|
|
|
--prefix=#{prefix}
|
2012-12-14 06:03:30 +00:00
|
|
|
--with-readline=#{readline.opt_prefix}
|
2012-09-22 15:40:43 +00:00
|
|
|
]
|
2012-01-04 07:20:58 +00:00
|
|
|
|
2012-12-14 06:03:30 +00:00
|
|
|
args << "--with-pdf=#{pdflib.opt_prefix}" if build.include? 'pdf'
|
|
|
|
args << '--with' + ((build.include? 'nogd') ? 'out-gd' : "-gd=#{gd.opt_prefix}")
|
2012-11-03 16:09:48 +00:00
|
|
|
args << '--disable-wxwidgets' unless build.include? 'wx'
|
|
|
|
args << '--without-cairo' unless build.include? 'cairo'
|
|
|
|
args << '--enable-qt' if build.include? 'qt'
|
|
|
|
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-12-29 00:39:20 +00:00
|
|
|
if build.include? 'latex'
|
|
|
|
args << '--with-latex'
|
|
|
|
args << '--with-tutorial'
|
|
|
|
else
|
|
|
|
args << '--without-latex'
|
|
|
|
args << '--without-tutorial'
|
|
|
|
end
|
|
|
|
|
2012-11-03 16:09:48 +00:00
|
|
|
system './prepare' if build.head?
|
2010-06-16 04:16:40 +00:00
|
|
|
system "./configure", *args
|
2012-11-03 16:09:48 +00:00
|
|
|
ENV.j1 # or else emacs tries to edit the same file with two threads
|
|
|
|
system 'make'
|
|
|
|
system 'make check' if build.include? 'tests' # Awesome testsuite
|
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
|