homebrew-core/Formula/gnuplot.rb

118 lines
4.2 KiB
Ruby
Raw Normal View History

require 'formula'
class LuaRequirement < Requirement
fatal true
default_formula 'lua'
2013-07-25 17:20:34 +00:00
satisfy { which 'lua' }
end
2011-03-10 05:11:03 +00:00
class Gnuplot < Formula
2010-05-10 04:18:50 +00:00
homepage 'http://www.gnuplot.info'
2014-03-15 20:24:27 +00:00
url 'https://downloads.sourceforge.net/project/gnuplot/gnuplot/4.6.5/gnuplot-4.6.5.tar.gz'
sha256 'e550f030c7d04570e89c3d4e3f6e82296816508419c86ab46c4dd73156519a2d'
2012-07-07 18:08:22 +00:00
2013-09-20 15:15:54 +00:00
head do
url 'cvs://:pserver:anonymous:@gnuplot.cvs.sourceforge.net:/cvsroot/gnuplot:gnuplot'
2013-09-20 15:15:54 +00:00
2013-11-13 17:01:29 +00:00
depends_on :autoconf
2013-09-20 15:15:54 +00:00
depends_on :automake
depends_on :libtool
end
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'
option 'cairo', 'Build the Cairo based terminals'
option 'nolua', 'Build without the lua/TikZ terminal'
option 'nogd', 'Build without gd support'
option 'tests', 'Verify the build with make check (1 min)'
option 'without-emacs', 'Do not build Emacs lisp files'
option 'latex', 'Build with LaTeX support'
gnuplot: fix AquaTerm 1.1.1 library detection Gnuplot supports use of AquaTerm as an output device on OSX, provided it detects an installed AquaTerm at build time. AquaTerm provides its support through a framework named 'AquaTerm', which is installed in the standard location '/Library/Frameworks'. Gnuplot v4.6.3 does not detect the current version of AquaTerm, v1.1.1, which was released in July 2012. This is due to a small change to the standard AquaTerm installation, which is designed to encourage client software to link to the framework using '-framework' style compiler options, in place of the traditional library style options. Gnuplot's trunk (v4.7) does now use this '-framework' style. References: https://github.com/AquaTerm/AquaTerm/blob/v1.1.1/aquaterm/ReleaseNotes#L1-11 https://github.com/AquaTerm/AquaTerm/blob/v1.1.1/aquaterm/INSTALL#L7-15 This formula change modifies Gnuplot 4.6.x's configure script to generate '-framework' style options, thereby allowing a standard installation of AquaTerm v1.1.1 to be detected. It also makes a minor modification to an 'import' specification, which is probably only of relevance on a case sensitive file system. Gnuplot trunk now includes a '--with-aquaterm' configure option, which is required before it will attempt to detect AquaTerm. This change adds a 'noaquaterm' option to the formula to support this (so we default to --with-aquaterm). The option will also be effective with Gnuplot v4.6.x. Closes Homebrew/homebrew#25121. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2014-02-05 14:50:59 +00:00
option 'without-aquaterm', 'Do not build AquaTerm support'
2012-09-20 16:56:53 +00:00
depends_on 'pkg-config' => :build
depends_on LuaRequirement unless build.include? 'nolua'
depends_on 'readline'
depends_on 'pango' if build.include? 'cairo' or build.include? 'wx'
depends_on :x11 if build.with? "x" or MacOS::X11.installed?
2012-09-20 16:56:53 +00:00
depends_on 'pdflib-lite' if build.include? 'pdf'
depends_on 'gd' unless build.include? 'nogd'
depends_on 'wxmac' if build.include? 'wx'
depends_on 'qt' if build.include? 'qt'
depends_on :tex if build.include? 'latex'
def install
gnuplot: fix AquaTerm 1.1.1 library detection Gnuplot supports use of AquaTerm as an output device on OSX, provided it detects an installed AquaTerm at build time. AquaTerm provides its support through a framework named 'AquaTerm', which is installed in the standard location '/Library/Frameworks'. Gnuplot v4.6.3 does not detect the current version of AquaTerm, v1.1.1, which was released in July 2012. This is due to a small change to the standard AquaTerm installation, which is designed to encourage client software to link to the framework using '-framework' style compiler options, in place of the traditional library style options. Gnuplot's trunk (v4.7) does now use this '-framework' style. References: https://github.com/AquaTerm/AquaTerm/blob/v1.1.1/aquaterm/ReleaseNotes#L1-11 https://github.com/AquaTerm/AquaTerm/blob/v1.1.1/aquaterm/INSTALL#L7-15 This formula change modifies Gnuplot 4.6.x's configure script to generate '-framework' style options, thereby allowing a standard installation of AquaTerm v1.1.1 to be detected. It also makes a minor modification to an 'import' specification, which is probably only of relevance on a case sensitive file system. Gnuplot trunk now includes a '--with-aquaterm' configure option, which is required before it will attempt to detect AquaTerm. This change adds a 'noaquaterm' option to the formula to support this (so we default to --with-aquaterm). The option will also be effective with Gnuplot v4.6.x. Closes Homebrew/homebrew#25121. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
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"
unless build.head?
# Fix up Gnuplot v4.6.x to accommodate framework style linking. This is
# required with a standard install of AquaTerm 1.1.1 and is supported under
# earlier versions of AquaTerm. Refer:
# https://github.com/AquaTerm/AquaTerm/blob/v1.1.1/aquaterm/ReleaseNotes#L1-11
# https://github.com/AquaTerm/AquaTerm/blob/v1.1.1/aquaterm/INSTALL#L7-15
inreplace "configure", "-laquaterm", "-framework AquaTerm"
inreplace "term/aquaterm.trm", "<aquaterm/AQTAdapter.h>", "<AquaTerm/AQTAdapter.h>"
end
elsif !build.head?
inreplace "configure", "-laquaterm", ""
end
# Help configure find libraries
2014-02-25 14:31:25 +00:00
readline = Formula["readline"].opt_prefix
pdflib = Formula["pdflib-lite"].opt_prefix
gd = Formula["gd"].opt_prefix
args = %W[
--disable-dependency-tracking
--prefix=#{prefix}
2014-02-25 14:31:25 +00:00
--with-readline=#{readline}
]
2014-02-25 14:31:25 +00:00
args << "--with-pdf=#{pdflib}" if build.include? 'pdf'
args << '--with' + ((build.include? 'nogd') ? 'out-gd' : "-gd=#{gd}")
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.without? "emacs"
args << (build.with?('aquaterm') ? '--with-aquaterm' : '--without-aquaterm')
if build.include? 'latex'
args << '--with-latex'
args << '--with-tutorial'
else
args << '--without-latex'
args << '--without-tutorial'
end
system './prepare' if build.head?
system "./configure", *args
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
system "make install"
end
test do
system "#{bin}/gnuplot", "--version"
end
gnuplot: fix AquaTerm 1.1.1 library detection Gnuplot supports use of AquaTerm as an output device on OSX, provided it detects an installed AquaTerm at build time. AquaTerm provides its support through a framework named 'AquaTerm', which is installed in the standard location '/Library/Frameworks'. Gnuplot v4.6.3 does not detect the current version of AquaTerm, v1.1.1, which was released in July 2012. This is due to a small change to the standard AquaTerm installation, which is designed to encourage client software to link to the framework using '-framework' style compiler options, in place of the traditional library style options. Gnuplot's trunk (v4.7) does now use this '-framework' style. References: https://github.com/AquaTerm/AquaTerm/blob/v1.1.1/aquaterm/ReleaseNotes#L1-11 https://github.com/AquaTerm/AquaTerm/blob/v1.1.1/aquaterm/INSTALL#L7-15 This formula change modifies Gnuplot 4.6.x's configure script to generate '-framework' style options, thereby allowing a standard installation of AquaTerm v1.1.1 to be detected. It also makes a minor modification to an 'import' specification, which is probably only of relevance on a case sensitive file system. Gnuplot trunk now includes a '--with-aquaterm' configure option, which is required before it will attempt to detect AquaTerm. This change adds a 'noaquaterm' option to the formula to support this (so we default to --with-aquaterm). The option will also be effective with Gnuplot v4.6.x. Closes Homebrew/homebrew#25121. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
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
end