homebrew-core/Formula/graphviz.rb

94 lines
2.8 KiB
Ruby
Raw Normal View History

require 'formula'
2011-03-10 05:11:03 +00:00
class Graphviz < Formula
2012-03-15 00:29:05 +00:00
homepage 'http://graphviz.org/'
2013-08-05 04:42:17 +00:00
url 'http://graphviz.org/pub/graphviz/stable/SOURCES/graphviz-2.32.0.tar.gz'
sha1 'a64f4a409012d13d18338ecb8bd7253083ebc35e'
devel do
2013-08-05 04:42:17 +00:00
url 'http://graphviz.org/pub/graphviz/development/SOURCES/graphviz-2.33.20130804.0447.tar.gz'
sha1 'f76db7f31dc3dd76bc6ba946c0dd90376dfb6cfa'
end
# To find Ruby and Co.
2012-09-14 16:07:47 +00:00
env :std
2012-08-10 05:03:53 +00:00
option :universal
2012-08-24 22:45:32 +00:00
option 'with-bindings', 'Build Perl/Python/Ruby/etc. bindings'
option 'with-pangocairo', 'Build with Pango/Cairo for alternate PDF output'
option 'with-freetype', 'Build with FreeType support'
option 'with-x', 'Build with X11 support'
option 'with-app', 'Build GraphViz.app (requires full XCode install)'
option 'with-gts', 'Build with GNU GTS support (required by prism)'
2012-08-10 05:03:53 +00:00
depends_on :libpng
depends_on 'pkg-config' => :build
2012-08-24 22:45:32 +00:00
depends_on 'pango' if build.include? 'with-pangocairo'
depends_on 'swig' if build.include? 'with-bindings'
depends_on :python if build.include? 'with-bindings' # this will set up python
2013-06-27 00:08:49 +00:00
depends_on 'gts' => :optional
depends_on :freetype if build.include? 'with-freetype' or MacOS::X11.installed?
depends_on :x11 if build.include? 'with-x' or MacOS::X11.installed?
depends_on :xcode if build.include? 'with-app'
fails_with :clang do
build 318
end
2012-03-15 00:29:05 +00:00
def patches
{:p0 =>
"https://trac.macports.org/export/103168/trunk/dports/graphics/graphviz/files/patch-project.pbxproj.diff",
}
end
def install
2012-08-10 05:03:53 +00:00
ENV.universal_binary if build.universal?
args = ["--disable-debug",
"--disable-dependency-tracking",
"--prefix=#{prefix}",
"--without-qt",
"--with-quartz"]
2013-06-27 00:08:49 +00:00
args << "--with-gts" if build.with? 'gts'
2012-08-24 22:45:32 +00:00
args << "--disable-swig" unless build.include? 'with-bindings'
args << "--without-pangocairo" unless build.include? 'with-pangocairo'
args << "--without-freetype2" unless build.include? 'with-freetype' or MacOS::X11.installed?
args << "--without-x" unless build.include? 'with-x' or MacOS::X11.installed?
system "./configure", *args
system "make install"
if build.include? 'with-app'
# build Graphviz.app
cd "macosx" do
system "xcodebuild", "-configuration", "Release", "SYMROOT=build", "PREFIX=#{prefix}", "ONLY_ACTIVE_ARCH=YES"
end
prefix.install "macosx/build/Release/Graphviz.app"
end
(bin+'gvmap.sh').unlink
end
2011-09-01 19:04:27 +00:00
2013-02-02 05:12:37 +00:00
test do
(testpath/'sample.dot').write <<-EOS.undent
digraph G {
a -> b
}
EOS
2011-09-01 19:04:27 +00:00
2013-02-02 05:12:37 +00:00
system "#{bin}/dot", "-Tpdf", "-o", "sample.pdf", "sample.dot"
2011-09-01 19:04:27 +00:00
end
def caveats
if build.include? 'with-app'
<<-EOS
Graphviz.app was installed in:
#{prefix}
To symlink into ~/Applications, you can do:
brew linkapps
EOS
end
end
end