class Qcachegrind < Formula
  desc "Visualize data generated by Cachegrind and Calltree"
  homepage "http://kcachegrind.sourceforge.net/html/Home.html"
  url "https://kcachegrind.github.io/files/kcachegrind-0.7.4.tar.gz"
  mirror "http://kcachegrind.sourceforge.net/kcachegrind-0.7.4.tar.gz"
  sha256 "0bf6efb647d500bf09bbbab617d30a8a2a0a2cbf87fd1f2a1375d774c005b379"

  bottle do
    cellar :any
    sha256 "084e512f593f3656a053d34eef5ec79065d7e4d3a394a6b6b26b02b50aff1ddd" => :yosemite
    sha256 "c31b8eaef2e375d28f343186710480c73faf65719ca013164b1a0983c7622112" => :mavericks
    sha256 "37441c27aa9dafa08648a1035220e98cfd4e9493ba60c354f4ac5d61ab294201" => :mountain_lion
  end

  depends_on "graphviz" => :optional
  depends_on "qt"

  def install
    cd "qcachegrind"
    system "qmake", "-spec", "macx-g++", "-config", "release"
    system "make"
    # Install app
    prefix.install "qcachegrind.app"
    # Symlink in the command-line version
    bin.install_symlink prefix/"qcachegrind.app/Contents/MacOS/qcachegrind"
  end
end
