aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/gnuplot.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/Library/Formula/gnuplot.rb b/Library/Formula/gnuplot.rb
index 6e9f9786e..934a42224 100644
--- a/Library/Formula/gnuplot.rb
+++ b/Library/Formula/gnuplot.rb
@@ -30,6 +30,7 @@ class Gnuplot < Formula
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'
+ option 'without-aquaterm', 'Do not build AquaTerm support'
depends_on 'pkg-config' => :build
depends_on LuaRequirement unless build.include? 'nolua'
@@ -43,6 +44,26 @@ class Gnuplot < Formula
depends_on :tex if build.include? 'latex'
def install
+ 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
readline = Formula.factory 'readline'
pdflib = Formula.factory 'pdflib-lite'
@@ -61,6 +82,7 @@ class Gnuplot < Formula
args << '--enable-qt' if build.include? 'qt'
args << '--without-lua' if build.include? 'nolua'
args << '--without-lisp-files' if build.include? 'without-emacs'
+ args << build.with?('aquaterm') ? '--with-aquaterm' : '--without-aquaterm'
if build.include? 'latex'
args << '--with-latex'
@@ -81,4 +103,15 @@ class Gnuplot < Formula
def test
system "#{bin}/gnuplot", "--version"
end
+
+ 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