homebrew-core/Formula/gnuplot.rb
2019-06-18 08:24:15 +02:00

60 lines
1.7 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.7/gnuplot-5.2.7.tar.gz"
sha256 "97fe503ff3b2e356fe2ae32203fc7fd2cf9cef1f46b60fe46dc501a228b9f4ed"
revision 1
bottle do
sha256 "898bad3f2b5161f8d76dc5b5534d11c0cf4daddf34ab6e7653ca7ca43302adee" => :mojave
sha256 "b9f2ff9e6fcab512608d1e534051993d23c6ed98dcc6c0dd053b6aa5f6023ee0" => :high_sierra
sha256 "7089dbaa82335746fe44f60d3b4d522d7f68b56370676ad44236742654127980" => :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