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/'
|
2011-07-25 16:17:15 +00:00
|
|
|
url 'http://www.graphviz.org/pub/graphviz/stable/SOURCES/graphviz-2.28.0.tar.gz'
|
2012-08-04 01:14:13 +00:00
|
|
|
sha1 '4725d88a13e071ee22e632de551d4a55ca08ee7d'
|
2009-09-27 06:03:35 +00:00
|
|
|
|
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-08-24 23:00:07 +00:00
|
|
|
option 'with-app', 'Build GraphViz.app (requires full XCode install)'
|
2012-08-10 05:03:53 +00:00
|
|
|
|
2012-07-30 20:58:07 +00:00
|
|
|
depends_on :libpng
|
|
|
|
|
2010-09-19 17:21:57 +00:00
|
|
|
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'
|
2012-08-24 23:00:07 +00:00
|
|
|
depends_on :xcode if build.include? 'with-app'
|
2012-09-02 18:25:47 +00:00
|
|
|
depends_on 'gd'
|
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
|
|
|
|
2011-09-15 03:38:21 +00:00
|
|
|
def patches
|
2011-12-13 10:13:51 +00:00
|
|
|
{ :p0 => "https://trac.macports.org/export/78507/trunk/dports/graphics/graphviz-gui/files/patch-project.pbxproj.diff",
|
|
|
|
:p1 => DATA}
|
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}",
|
|
|
|
"--with-qt=no",
|
2012-08-23 15:36:22 +00:00
|
|
|
"--without-x",
|
2011-12-13 10:13:51 +00:00
|
|
|
"--with-quartz"]
|
2012-08-24 22:45:32 +00:00
|
|
|
args << "--disable-swig" unless build.include? 'with-bindings'
|
|
|
|
args << "--without-pangocairo" unless build.include? 'with-pangocairo'
|
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
|
|
|
|
2012-08-24 23:00:07 +00:00
|
|
|
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"
|
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
|
|
|
|
|
|
|
def test
|
|
|
|
mktemp do
|
2012-02-24 20:50:21 +00:00
|
|
|
(Pathname.pwd+'sample.dot').write <<-EOS.undent
|
2011-09-01 19:04:27 +00:00
|
|
|
digraph G {
|
|
|
|
a -> b
|
|
|
|
}
|
|
|
|
EOS
|
|
|
|
|
2012-05-06 05:45:18 +00:00
|
|
|
system "#{bin}/dot", "-Tpdf", "-o", "sample.pdf", "sample.dot"
|
2011-09-01 19:04:27 +00:00
|
|
|
end
|
|
|
|
end
|
2011-12-13 10:13:51 +00:00
|
|
|
|
2012-08-24 23:00:07 +00:00
|
|
|
def caveats
|
|
|
|
if build.include? 'with-app'
|
|
|
|
<<-EOS
|
|
|
|
Graphviz.app was installed in:
|
|
|
|
#{prefix}
|
2011-12-13 10:13:51 +00:00
|
|
|
|
2012-08-24 23:00:07 +00:00
|
|
|
To symlink into ~/Applications, you can do:
|
|
|
|
brew linkapps
|
|
|
|
EOS
|
|
|
|
end
|
2011-12-13 10:13:51 +00:00
|
|
|
end
|
2009-09-27 06:03:35 +00:00
|
|
|
end
|
2011-09-15 03:38:21 +00:00
|
|
|
|
2011-12-13 10:13:51 +00:00
|
|
|
# fix build on platforms without /usr/lib/libltdl.a (i.e., Lion)
|
|
|
|
# http://www.graphviz.org/mantisbt/view.php?id=2109
|
|
|
|
# fixed in upstream development version 2.29
|
|
|
|
# second part of DATA patch fixes quartz plugin build, may not be in upstream yet
|
2011-09-15 03:38:21 +00:00
|
|
|
__END__
|
|
|
|
diff --git a/lib/gvc/Makefile.in b/lib/gvc/Makefile.in
|
|
|
|
index 2d345a0..67183f2 100644
|
|
|
|
--- a/lib/gvc/Makefile.in
|
|
|
|
+++ b/lib/gvc/Makefile.in
|
|
|
|
@@ -41,8 +41,7 @@ host_triplet = @host@
|
|
|
|
@WITH_WIN32_TRUE@am__append_1 = -O0
|
|
|
|
@WITH_ORTHO_TRUE@am__append_2 = $(top_builddir)/lib/ortho/libortho_C.la
|
|
|
|
@WITH_ORTHO_TRUE@am__append_3 = $(top_builddir)/lib/ortho/libortho_C.la
|
|
|
|
-@ENABLE_LTDL_TRUE@am__append_4 = $(LIBLTDL) $(LIBLTDL_LDFLAGS)
|
|
|
|
-@ENABLE_LTDL_TRUE@am__append_5 = $(LIBLTDL)
|
|
|
|
+@ENABLE_LTDL_TRUE@am__append_4 = @LIBLTDL@ $(LIBLTDL_LDFLAGS)
|
|
|
|
subdir = lib/gvc
|
|
|
|
DIST_COMMON = $(noinst_HEADERS) $(pkginclude_HEADERS) \
|
|
|
|
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
|
|
|
@@ -87,8 +86,7 @@ am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man3dir)" \
|
|
|
|
"$(DESTDIR)$(pkgincludedir)"
|
|
|
|
LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
|
|
|
|
am__DEPENDENCIES_1 =
|
|
|
|
-@ENABLE_LTDL_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) \
|
|
|
|
-@ENABLE_LTDL_TRUE@ $(am__DEPENDENCIES_1)
|
|
|
|
+@ENABLE_LTDL_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1)
|
|
|
|
am__DEPENDENCIES_3 = $(top_builddir)/lib/pack/libpack_C.la \
|
|
|
|
$(top_builddir)/lib/xdot/libxdot_C.la \
|
|
|
|
$(top_builddir)/lib/common/libcommon_C.la $(am__append_2) \
|
2011-12-13 10:13:51 +00:00
|
|
|
diff --git a/plugin/quartz/Makefile.in b/plugin/quartz/Makefile.in
|
|
|
|
index 20ec9c6..dbeb46b 100644
|
|
|
|
--- a/plugin/quartz/Makefile.in
|
|
|
|
+++ b/plugin/quartz/Makefile.in
|
|
|
|
@@ -89,7 +89,7 @@ libgvplugin_quartz_la_OBJECTS = $(am_libgvplugin_quartz_la_OBJECTS)
|
|
|
|
AM_V_lt = $(am__v_lt_$(V))
|
|
|
|
am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
|
|
|
|
am__v_lt_0 = --silent
|
|
|
|
-libgvplugin_quartz_la_LINK = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \
|
|
|
|
+libgvplugin_quartz_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
|
|
|
$(LIBTOOLFLAGS) --mode=link $(OBJCLD) $(AM_OBJCFLAGS) \
|
|
|
|
$(OBJCFLAGS) $(libgvplugin_quartz_la_LDFLAGS) $(LDFLAGS) -o $@
|
|
|
|
@WITH_QUARTZ_TRUE@@WITH_WIN32_FALSE@am_libgvplugin_quartz_la_rpath = \
|
|
|
|
@@ -128,7 +128,7 @@ am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
|
|
|
|
am__v_CCLD_0 = @echo " CCLD " $@;
|
|
|
|
OBJCCOMPILE = $(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
|
|
|
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS)
|
|
|
|
-LTOBJCCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \
|
|
|
|
+LTOBJCCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
|
|
|
$(LIBTOOLFLAGS) --mode=compile $(OBJC) $(DEFS) \
|
|
|
|
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
|
|
|
$(AM_OBJCFLAGS) $(OBJCFLAGS)
|
|
|
|
@@ -136,7 +136,7 @@ AM_V_OBJC = $(am__v_OBJC_$(V))
|
|
|
|
am__v_OBJC_ = $(am__v_OBJC_$(AM_DEFAULT_VERBOSITY))
|
|
|
|
am__v_OBJC_0 = @echo " OBJC " $@;
|
|
|
|
OBJCLD = $(OBJC)
|
|
|
|
-OBJCLINK = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
|
|
|
+OBJCLINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
|
|
|
--mode=link $(OBJCLD) $(AM_OBJCFLAGS) $(OBJCFLAGS) \
|
|
|
|
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
|
|
|
AM_V_OBJCLD = $(am__v_OBJCLD_$(V))
|