class Gnuplot < Formula desc "Command-driven, interactive function plotting" homepage "http://www.gnuplot.info/" url "https://downloads.sourceforge.net/project/gnuplot/gnuplot/5.2.6/gnuplot-5.2.6.tar.gz" sha256 "35dd8f013139e31b3028fac280ee12d4b1346d9bb5c501586d1b5a04ae7a94ee" revision 1 bottle do rebuild 1 sha256 "47903eca8637b8de9b803932795fe9dec4a45df4ea8ab61c51e2692501edce03" => :mojave sha256 "24a6c735fb69f8f7f016cf4ecadbe8d11022523c9d7160ef03160f41bf117aa7" => :high_sierra sha256 "5ef8fe2bebfcc2232f8ee414f0ce0c6b13482e212938d041dc55db7ea139eb10" => :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