diff options
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/graphviz.rb | 93 |
1 files changed, 71 insertions, 22 deletions
diff --git a/Library/Formula/graphviz.rb b/Library/Formula/graphviz.rb index ffed3670d..8c83f13b8 100644 --- a/Library/Formula/graphviz.rb +++ b/Library/Formula/graphviz.rb @@ -1,5 +1,9 @@ require 'formula' +def build_bindings? + ARGV.include? '--with-bindings' or (MacOS.lion? and not ARGV.include? '--without-bindings') +end + class Graphviz < Formula url 'http://www.graphviz.org/pub/graphviz/stable/SOURCES/graphviz-2.28.0.tar.gz' md5 '8d26c1171f30ca3b1dc1b429f7937e58' @@ -7,40 +11,41 @@ class Graphviz < Formula depends_on 'pkg-config' => :build - if ARGV.include? '--with-pdf' + if ARGV.include? '--with-pangocairo' depends_on 'pango' - depends_on 'cairo' if MacOS.leopard? or MacOS.lion? - depends_on 'gd' if MacOS.lion? + depends_on 'cairo' if MacOS.leopard? end + depends_on 'swig' if build_bindings? + def options - [["--with-pdf", "Build with Pango/Cairo to support native PDF output"]] + [["--with-pangocairo", "Build with Pango/Cairo for alternate PDF output"], + ["--with[out]-bindings", "Build Perl/Python/Ruby/etc. bindings (default on Lion; may not work on earlier systems)"]] end def patches - # 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 - DATA if MacOS.lion? + { :p0 => "https://trac.macports.org/export/78507/trunk/dports/graphics/graphviz-gui/files/patch-project.pbxproj.diff", + :p1 => DATA} end def install ENV.x11 - # Various language bindings fail with 32/64 issues. - system "./configure", "--disable-debug", "--disable-dependency-tracking", - "--prefix=#{prefix}", - "--with-qt=no", - "--disable-quartz", - "--disable-java", - "--disable-ocaml", - "--disable-perl", - "--disable-php", - "--disable-python", - "--disable-r", - "--disable-ruby", - "--disable-sharp", - "--disable-swig" + args = ["--disable-debug", + "--disable-dependency-tracking", + "--prefix=#{prefix}", + "--with-qt=no", + "--with-quartz"] + args << "--disable-swig" unless build_bindings? + args << "--without-pangocairo" unless ARGV.include? '--with-pangocairo' + + system "./configure", *args system "make install" + + # build GraphViz.app + Dir.chdir "macosx" do + system "xcodebuild", "-configuration", "Release", "SYMROOT=build", "PREFIX=#{prefix}", "ONLY_ACTIVE_ARCH=YES" + end + prefix.install "macosx/build/Release/GraphViz.app" end def test @@ -55,8 +60,21 @@ class Graphviz < Formula system "#{bin}/dot -Tpdf -o sample.pdf sample.dot && /usr/bin/open ./sample.pdf && /bin/sleep 3" end end + + def caveats; <<-EOS + GraphViz.app was installed in: + #{prefix} + + To symlink into ~/Applications, you can do: + brew linkapps + EOS + end end +# 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 __END__ diff --git a/lib/gvc/Makefile.in b/lib/gvc/Makefile.in index 2d345a0..67183f2 100644 @@ -82,3 +100,34 @@ index 2d345a0..67183f2 100644 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) \ +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)) |
