class Glibmm < Formula desc "C++ interface to glib" homepage "http://www.gtkmm.org/" url "https://download.gnome.org/sources/glibmm/2.46/glibmm-2.46.2.tar.xz" sha256 "7221a01a768c1cce2bb994cb6ebfe634246dba4788f910484d04e3b0d903a3c8" bottle do cellar :any sha256 "23d3f8ebbf05a14400d2c979618746083ead086dd711845d160f0205392dd186" => :el_capitan sha256 "232f007e86a6cc5262f2c3febaf64442e4506230300346e74c795cfad1b5cccd" => :yosemite sha256 "57c1d139cd13f56646ad49a8c223d2e9bb3501166c7a41730ea7834c6a7e735e" => :mavericks end depends_on "pkg-config" => :build depends_on "libsigc++" depends_on "glib" needs :cxx11 def install ENV.cxx11 system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}" system "make", "install" end test do (testpath/"test.cpp").write <<-EOS.undent #include int main(int argc, char *argv[]) { Glib::ustring my_string("testing"); return 0; } EOS gettext = Formula["gettext"] glib = Formula["glib"] libsigcxx = Formula["libsigc++"] flags = (ENV.cflags || "").split + (ENV.cppflags || "").split + (ENV.ldflags || "").split flags += %W[ -I#{gettext.opt_include} -I#{glib.opt_include}/glib-2.0 -I#{glib.opt_lib}/glib-2.0/include -I#{include}/glibmm-2.4 -I#{libsigcxx.opt_include}/sigc++-2.0 -I#{libsigcxx.opt_lib}/sigc++-2.0/include -I#{lib}/glibmm-2.4/include -L#{gettext.opt_lib} -L#{glib.opt_lib} -L#{libsigcxx.opt_lib} -L#{lib} -lglib-2.0 -lglibmm-2.4 -lgobject-2.0 -lintl -lsigc-2.0 ] system ENV.cxx, "-std=c++11", "test.cpp", "-o", "test", *flags system "./test" end end