homebrew-core/Formula/graphviz.rb
2019-06-18 08:24:31 +02:00

73 lines
2.2 KiB
Ruby

class Graphviz < Formula
desc "Graph visualization software from AT&T and Bell Labs"
homepage "https://www.graphviz.org/"
# versioned URLs are missing upstream as of 16 Dec 2017
url "https://www.mirrorservice.org/sites/distfiles.macports.org/graphviz/graphviz-2.40.1.tar.gz"
mirror "https://fossies.org/linux/misc/graphviz-2.40.1.tar.gz"
sha256 "ca5218fade0204d59947126c38439f432853543b0818d9d728c589dfe7f3a421"
revision 1
version_scheme 1
bottle do
sha256 "c3e2b2f06d1a2190405ccb16cde3cbddb8bf0be080fb84448a0c43f473eef39f" => :mojave
sha256 "2972d06c626e9a7d39c06d0376b1b425cae55d0e5d5a56d6f1440783d7e76890" => :high_sierra
sha256 "3336446bf3ad335583744a88549b19a0bae2fd427270863476c2590a575ff021" => :sierra
end
head do
url "https://gitlab.com/graphviz/graphviz.git"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
end
depends_on "pkg-config" => :build
depends_on "gd"
depends_on "gts"
depends_on "libpng"
depends_on "libtool"
def install
# Only needed when using superenv, which causes qfrexp and qldexp to be
# falsely detected as available. The problem is triggered by
# args << "-#{ENV["HOMEBREW_OPTIMIZATION_LEVEL"]}"
# during argument refurbishment of cflags.
# https://github.com/Homebrew/brew/blob/ab060c9/Library/Homebrew/shims/super/cc#L241
# https://github.com/Homebrew/legacy-homebrew/issues/14566
# Alternative fixes include using stdenv or using "xcrun make"
inreplace "lib/sfio/features/sfio", "lib qfrexp\nlib qldexp\n", "" unless build.head?
args = %W[
--disable-debug
--disable-dependency-tracking
--prefix=#{prefix}
--disable-php
--disable-swig
--with-quartz
--without-freetype2
--without-qt
--without-x
--with-gts
]
if build.head?
system "./autogen.sh", *args
else
system "./configure", *args
end
system "make", "install"
(bin/"gvmap.sh").unlink
end
test do
(testpath/"sample.dot").write <<~EOS
digraph G {
a -> b
}
EOS
system "#{bin}/dot", "-Tpdf", "-o", "sample.pdf", "sample.dot"
end
end