homebrew-core/Formula/gnuplot.rb
2019-12-03 20:36:15 -05:00

59 lines
1.6 KiB
Ruby

class Gnuplot < Formula
desc "Command-driven, interactive function plotting"
homepage "http://www.gnuplot.info/"
url "https://downloads.sourceforge.net/project/gnuplot/gnuplot/5.2.8/gnuplot-5.2.8.tar.gz"
sha256 "60a6764ccf404a1668c140f11cc1f699290ab70daa1151bb58fed6139a28ac37"
bottle do
sha256 "752b5a6f7e93af1e2a23e8ab27c6d19d286f50b054eb0b7accdfa5765c69b3b0" => :catalina
sha256 "645bff55538d6610cf93539dbeec5067a750a6edc0fbbbab6e34710c16db10ef" => :mojave
sha256 "36f2d97fbf5772eef3cd0f1988997848e7367ab7943a2542ea15d93bbfd083ce" => :high_sierra
end
head do
url "https://git.code.sf.net/p/gnuplot/gnuplot-main.git"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
end
depends_on "pkg-config" => :build
depends_on "gd"
depends_on "libcerf"
depends_on "lua"
depends_on "pango"
depends_on "qt"
depends_on "readline"
def install
# Qt5 requires c++11 (and the other backends do not care)
ENV.cxx11
args = %W[
--disable-dependency-tracking
--disable-silent-rules
--prefix=#{prefix}
--with-readline=#{Formula["readline"].opt_prefix}
--without-tutorial
--disable-wxwidgets
--with-qt
--without-x
]
system "./prepare" if build.head?
system "./configure", *args
ENV.deparallelize # or else emacs tries to edit the same file with two threads
system "make"
system "make", "install"
end
test do
system "#{bin}/gnuplot", "-e", <<~EOS
set terminal dumb;
set output "#{testpath}/graph.txt";
plot sin(x);
EOS
assert_predicate testpath/"graph.txt", :exist?
end
end