2011-03-10 05:11:03 +00:00
|
|
|
class Gnuplot < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Command-driven, interactive function plotting"
|
2015-01-08 15:20:40 +00:00
|
|
|
homepage "http://www.gnuplot.info"
|
2015-06-27 23:54:50 +00:00
|
|
|
url "https://downloads.sourceforge.net/project/gnuplot/gnuplot/5.0.1/gnuplot-5.0.1.tar.gz"
|
|
|
|
sha256 "7cbc557e71df581ea520123fb439dea5f073adcc9010a2885dc80d4ed28b3c47"
|
2012-07-07 18:08:22 +00:00
|
|
|
|
2014-07-03 17:36:37 +00:00
|
|
|
bottle do
|
2015-06-30 01:52:04 +00:00
|
|
|
revision 1
|
|
|
|
sha256 "083a5efbc783c1375d549c89a15c6ec77f6a319be8ec08b5217b368356ae8270" => :yosemite
|
|
|
|
sha256 "fa1003970c98d29f3c85cf646753603cfe89c428dba78b26733ae39a3bea4b99" => :mavericks
|
|
|
|
sha256 "e8b857d4951c4ceaae42d792be9685dfe4a33387e49a7e42987efb85d51d892a" => :mountain_lion
|
2014-07-03 17:36:37 +00:00
|
|
|
end
|
|
|
|
|
2013-09-20 15:15:54 +00:00
|
|
|
head do
|
2014-12-22 05:43:02 +00:00
|
|
|
url ":pserver:anonymous:@gnuplot.cvs.sourceforge.net:/cvsroot/gnuplot", :using => :cvs
|
2013-09-20 15:15:54 +00:00
|
|
|
|
2014-12-04 17:01:22 +00:00
|
|
|
depends_on "autoconf" => :build
|
|
|
|
depends_on "automake" => :build
|
|
|
|
depends_on "libtool" => :build
|
2013-09-20 15:15:54 +00:00
|
|
|
end
|
2010-03-15 12:10:07 +00:00
|
|
|
|
2015-01-08 15:20:40 +00:00
|
|
|
option "with-cairo", "Build the Cairo based terminals"
|
|
|
|
option "without-lua", "Build without the lua/TikZ terminal"
|
2015-01-13 19:10:44 +00:00
|
|
|
option "with-tests", "Verify the build with make check"
|
2015-01-08 15:20:40 +00:00
|
|
|
option "without-emacs", "Do not build Emacs lisp files"
|
2015-01-13 19:10:44 +00:00
|
|
|
option "with-wxmac", "Build wxmac support. Need with-cairo to build wxt terminal"
|
2015-01-08 15:20:40 +00:00
|
|
|
option "with-latex", "Build with LaTeX support"
|
|
|
|
option "with-aquaterm", "Build with AquaTerm support"
|
2012-09-20 16:56:53 +00:00
|
|
|
|
2014-11-13 18:08:06 +00:00
|
|
|
deprecated_option "with-x" => "with-x11"
|
2015-01-08 15:20:40 +00:00
|
|
|
deprecated_option "pdf" => "with-pdflib-lite"
|
|
|
|
deprecated_option "wx" => "with-wxmac"
|
|
|
|
deprecated_option "qt" => "with-qt"
|
|
|
|
deprecated_option "nogd" => "without-gd"
|
|
|
|
deprecated_option "cairo" => "with-cairo"
|
|
|
|
deprecated_option "nolua" => "without-lua"
|
|
|
|
deprecated_option "tests" => "with-tests"
|
|
|
|
deprecated_option "latex" => "with-latex"
|
|
|
|
|
|
|
|
depends_on "pkg-config" => :build
|
2015-06-27 23:54:50 +00:00
|
|
|
depends_on "fontconfig"
|
|
|
|
depends_on "gd" => :recommended
|
2015-06-30 01:35:02 +00:00
|
|
|
depends_on "lua" => :recommended
|
2014-05-07 00:46:43 +00:00
|
|
|
depends_on "jpeg"
|
2015-06-27 23:54:50 +00:00
|
|
|
depends_on "libpng"
|
2014-05-07 00:46:43 +00:00
|
|
|
depends_on "libtiff"
|
2015-06-30 01:35:02 +00:00
|
|
|
depends_on "readline"
|
2015-06-27 23:54:50 +00:00
|
|
|
depends_on "pango" if (build.with? "cairo") || (build.with? "wxmac")
|
2015-01-08 15:20:40 +00:00
|
|
|
depends_on "pdflib-lite" => :optional
|
|
|
|
depends_on "qt" => :optional
|
2015-06-27 23:54:50 +00:00
|
|
|
depends_on "wxmac" => :optional
|
|
|
|
depends_on :tex if build.with? "latex"
|
|
|
|
depends_on :x11 => :optional
|
2012-09-22 15:40:43 +00:00
|
|
|
|
2009-09-20 16:51:35 +00:00
|
|
|
def install
|
2014-02-05 14:50:59 +00:00
|
|
|
if build.with? "aquaterm"
|
|
|
|
# Add "/Library/Frameworks" to the default framework search path, so that an
|
|
|
|
# installed AquaTerm framework can be found. Brew does not add this path
|
|
|
|
# when building against an SDK (Nov 2013).
|
|
|
|
ENV.prepend "CPPFLAGS", "-F/Library/Frameworks"
|
|
|
|
ENV.prepend "LDFLAGS", "-F/Library/Frameworks"
|
|
|
|
end
|
|
|
|
|
2011-03-19 00:10:22 +00:00
|
|
|
# Help configure find libraries
|
2014-02-25 14:31:25 +00:00
|
|
|
pdflib = Formula["pdflib-lite"].opt_prefix
|
|
|
|
gd = Formula["gd"].opt_prefix
|
2011-03-19 00:10:22 +00:00
|
|
|
|
2012-09-22 15:40:43 +00:00
|
|
|
args = %W[
|
|
|
|
--disable-dependency-tracking
|
2014-04-04 00:52:10 +00:00
|
|
|
--disable-silent-rules
|
2012-09-22 15:40:43 +00:00
|
|
|
--prefix=#{prefix}
|
2015-01-13 19:10:44 +00:00
|
|
|
--with-readline=#{Formula["readline"].opt_prefix}
|
2012-09-22 15:40:43 +00:00
|
|
|
]
|
2012-01-04 07:20:58 +00:00
|
|
|
|
2015-01-08 15:20:40 +00:00
|
|
|
args << "--with-pdf=#{pdflib}" if build.with? "pdflib-lite"
|
|
|
|
args << ((build.with? "gd") ? "--with-gd=#{gd}" : "--without-gd")
|
2015-01-18 04:41:36 +00:00
|
|
|
|
|
|
|
if build.without? "wxmac"
|
|
|
|
args << "--disable-wxwidgets"
|
|
|
|
args << "--without-cairo" if build.without? "cairo"
|
|
|
|
end
|
|
|
|
|
2015-08-11 17:27:54 +00:00
|
|
|
if build.with? "qt"
|
|
|
|
args << "--with-qt"
|
|
|
|
else
|
|
|
|
args << "--with-qt=no"
|
|
|
|
end
|
|
|
|
|
2015-06-30 01:35:02 +00:00
|
|
|
args << "--without-lua" if build.without? "lua"
|
2015-01-08 15:20:40 +00:00
|
|
|
args << "--without-lisp-files" if build.without? "emacs"
|
|
|
|
args << ((build.with? "aquaterm") ? "--with-aquaterm" : "--without-aquaterm")
|
|
|
|
args << ((build.with? "x11") ? "--with-x" : "--without-x")
|
|
|
|
|
|
|
|
if build.with? "latex"
|
|
|
|
args << "--with-latex"
|
|
|
|
args << "--with-tutorial"
|
2012-12-29 00:39:20 +00:00
|
|
|
else
|
2015-01-08 15:20:40 +00:00
|
|
|
args << "--without-latex"
|
|
|
|
args << "--without-tutorial"
|
2012-12-29 00:39:20 +00:00
|
|
|
end
|
|
|
|
|
2015-01-08 15:20:40 +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
|
2015-01-08 15:20:40 +00:00
|
|
|
system "make"
|
2015-06-30 01:35:02 +00:00
|
|
|
system "make", "check" if build.with?("tests") || build.bottle?
|
2015-01-08 15:20:40 +00:00
|
|
|
system "make", "install"
|
2009-09-20 16:51:35 +00:00
|
|
|
end
|
2012-01-04 07:20:58 +00:00
|
|
|
|
2014-02-05 14:50:59 +00:00
|
|
|
def caveats
|
|
|
|
if build.with? "aquaterm"
|
|
|
|
<<-EOS.undent
|
|
|
|
AquaTerm support will only be built into Gnuplot if the standard AquaTerm
|
|
|
|
package from SourceForge has already been installed onto your system.
|
|
|
|
If you subsequently remove AquaTerm, you will need to uninstall and then
|
|
|
|
reinstall Gnuplot.
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|
2015-06-30 01:35:02 +00:00
|
|
|
|
2015-06-27 23:54:50 +00:00
|
|
|
test do
|
|
|
|
system "#{bin}/gnuplot", "-e", <<-EOS.undent
|
|
|
|
set terminal png;
|
|
|
|
set output "#{testpath}/image.png";
|
|
|
|
plot sin(x);
|
|
|
|
EOS
|
|
|
|
File.exist? testpath/"image.png"
|
|
|
|
end
|
2009-09-20 16:51:35 +00:00
|
|
|
end
|