2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-09-27 06:03:35 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Graphviz < Formula
|
2012-03-15 00:29:05 +00:00
|
|
|
homepage 'http://graphviz.org/'
|
2014-04-16 00:37:18 +00:00
|
|
|
url 'http://graphviz.org/pub/graphviz/stable/SOURCES/graphviz-2.38.0.tar.gz'
|
|
|
|
sha1 '053c771278909160916ca5464a0a98ebf034c6ef'
|
2013-02-17 07:05:49 +00:00
|
|
|
|
2014-03-21 12:42:01 +00:00
|
|
|
bottle do
|
2014-04-16 01:21:32 +00:00
|
|
|
sha1 "112471c5d0e25a953ae64c09db48f434e744f558" => :mavericks
|
|
|
|
sha1 "7dcc9f76ce2b8978a77d114354471c7c931a4b54" => :mountain_lion
|
|
|
|
sha1 "9effcb470b301098a54566f6d335f2eee6491d71" => :lion
|
2014-03-21 12:42:01 +00:00
|
|
|
end
|
|
|
|
|
2013-01-21 09:33:56 +00:00
|
|
|
# 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'
|
2012-10-19 17:59:10 +00:00
|
|
|
option 'with-x', 'Build with X11 support'
|
2012-08-24 23:00:07 +00:00
|
|
|
option 'with-app', 'Build GraphViz.app (requires full XCode install)'
|
2012-11-13 09:03:03 +00:00
|
|
|
option 'with-gts', 'Build with GNU GTS support (required by prism)'
|
2012-08-10 05:03:53 +00:00
|
|
|
|
2014-03-23 02:34:27 +00:00
|
|
|
depends_on "libpng"
|
2012-07-30 20:58:07 +00:00
|
|
|
|
2010-09-19 17:21:57 +00:00
|
|
|
depends_on 'pkg-config' => :build
|
2014-03-06 20:40:26 +00:00
|
|
|
depends_on 'pango' if build.with? "pangocairo"
|
|
|
|
depends_on 'swig' if build.with? "bindings"
|
2013-06-27 00:08:49 +00:00
|
|
|
depends_on 'gts' => :optional
|
2014-02-10 23:33:40 +00:00
|
|
|
depends_on "librsvg" => :optional
|
2014-04-03 14:14:06 +00:00
|
|
|
depends_on "freetype" => :optional
|
|
|
|
depends_on :x11 if build.with? "x"
|
2014-05-30 20:35:03 +00:00
|
|
|
depends_on :xcode => :build if build.with? "app"
|
2011-12-13 10:13:51 +00:00
|
|
|
|
2012-03-18 20:33:24 +00:00
|
|
|
fails_with :clang do
|
|
|
|
build 318
|
|
|
|
end
|
2012-03-15 00:29:05 +00:00
|
|
|
|
2014-03-17 00:35:08 +00:00
|
|
|
patch :p0 do
|
|
|
|
url "https://trac.macports.org/export/103168/trunk/dports/graphics/graphviz/files/patch-project.pbxproj.diff"
|
|
|
|
sha1 "b242fb8fa81489dd16830e5df6bbf5448a3874d5"
|
2011-09-15 03:38:21 +00:00
|
|
|
end
|
|
|
|
|
2009-09-27 06:03:35 +00:00
|
|
|
def install
|
2012-08-10 05:03:53 +00:00
|
|
|
ENV.universal_binary if build.universal?
|
2011-12-13 10:13:51 +00:00
|
|
|
args = ["--disable-debug",
|
|
|
|
"--disable-dependency-tracking",
|
|
|
|
"--prefix=#{prefix}",
|
2012-09-27 19:52:54 +00:00
|
|
|
"--without-qt",
|
2011-12-13 10:13:51 +00:00
|
|
|
"--with-quartz"]
|
2013-06-27 00:08:49 +00:00
|
|
|
args << "--with-gts" if build.with? 'gts'
|
2014-03-06 20:40:26 +00:00
|
|
|
args << "--disable-swig" if build.without? "bindings"
|
|
|
|
args << "--without-pangocairo" if build.without? "pangocairo"
|
2014-04-03 14:14:06 +00:00
|
|
|
args << "--without-freetype2" if build.without? "freetype"
|
|
|
|
args << "--without-x" if build.without? "x"
|
2014-02-10 23:33:40 +00:00
|
|
|
args << "--without-rsvg" if build.without? "librsvg"
|
2011-12-13 10:13:51 +00:00
|
|
|
|
|
|
|
system "./configure", *args
|
2009-09-27 06:03:35 +00:00
|
|
|
system "make install"
|
2011-12-13 10:13:51 +00:00
|
|
|
|
2014-03-06 20:40:26 +00:00
|
|
|
if build.with? "app"
|
2012-08-24 23:00:07 +00:00
|
|
|
cd "macosx" do
|
2014-02-28 03:47:38 +00:00
|
|
|
xcodebuild "-configuration", "Release", "SYMROOT=build", "PREFIX=#{prefix}", "ONLY_ACTIVE_ARCH=YES"
|
2012-08-24 23:00:07 +00:00
|
|
|
end
|
|
|
|
prefix.install "macosx/build/Release/Graphviz.app"
|
2011-12-13 10:13:51 +00:00
|
|
|
end
|
2012-08-24 23:00:07 +00:00
|
|
|
|
2012-08-04 09:35:16 +00:00
|
|
|
(bin+'gvmap.sh').unlink
|
2009-09-27 06:03:35 +00:00
|
|
|
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
|
2009-09-27 06:03:35 +00:00
|
|
|
end
|