# Documentation: https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Formula-Cookbook.md
#                /usr/local/Library/Contributions/example-formula.rb
# PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!

class Gtkglextmm < Formula
  homepage ""
  url "http://downloads.sourceforge.net/gtkglext/gtkglextmm-1.2.0.tar.gz"
  version "1.2.0"
  sha256 "8f499c1f95678c56cce908c10bf2c1d0f2267b87e0c480385fa4b128c75bdf7b"

  # depends_on "cmake" => :build
  depends_on 'pkg-config' => :build
  depends_on 'glibmm'
  depends_on 'gtkmm'
  depends_on 'gtkglext'
  depends_on :x11 # if your formula requires any X11/XQuartz components

  # Fixes header include order, using patch from macports: https://trac.macports.org/ticket/27059
  # Upstream bug report: https://bugzilla.gnome.org/show_bug.cgi?id=636831
  def patches
    { :p0 => "https://trac.macports.org/export/89836/trunk/dports/devel/gtkglextmm/files/patch-gtkglext_gtkmm_gl-widget.cc.diff" }
  end

  def install
    # ENV.deparallelize  # if your formula fails when building in parallel

    # Remove unrecognized options if warned by configure
    system "./configure", "--disable-debug",
                          "--disable-dependency-tracking",
                          "--disable-silent-rules",
                          "--prefix=#{prefix}"
    # system "cmake", ".", *std_cmake_args
    system "make", "install" # if this fails, try separate make/make install steps
  end

  test do
    # `test do` will create, run in and delete a temporary directory.
    #
    # This test will fail and we won't accept that! It's enough to just replace
    # "false" with the main program this formula installs, but it'd be nice if you
    # were more thorough. Run the test with `brew test gtkglextmm`. Options passed
    # to `brew install` such as `--HEAD` also need to be provided to `brew test`.
    #
    # The installed folder is not in the path, so use the entire path to any
    # executables being tested: `system "#{bin}/program", "do", "something"`.
    system "false"
  end
end
