class Lablgtk < Formula desc "Objective Caml interface to gtk+" homepage "http://lablgtk.forge.ocamlcore.org" url "https://forge.ocamlcore.org/frs/download.php/1479/lablgtk-2.18.3.tar.gz" sha256 "975bebf2f9ca74dc3bf7431ebb640ff6a924bb80c8ee5f4467c475a7e4b0cbaf" revision 2 bottle do sha256 "bef271a1a3f37813f42cfe6f8780aa8b0ebba4891b950d09c54abc98becaf086" => :el_capitan sha256 "02b8ccf9c645fb183d6baf80dec423aeff7e3bdc0d2aeccf0e1d88282cbd52f7" => :yosemite sha256 "0456edef7ebcd5d985520270c44102ce6e4550b10150ddb056a370771d17784d" => :mavericks end depends_on "pkg-config" => :build depends_on "camlp4" => :build depends_on "ocaml" depends_on "gtk+" depends_on "librsvg" depends_on "gtksourceview" def install system "./configure", "--bindir=#{bin}", "--libdir=#{lib}", "--mandir=#{man}", "--with-libdir=#{lib}/ocaml" ENV.j1 system "make", "world" system "make", "old-install" end test do (testpath/"test.ml").write <<-EOS.undent let _ = GtkMain.Main.init () EOS ENV["CAML_LD_LIBRARY_PATH"] = "#{lib}/ocaml/stublibs" system "ocamlc", "-I", "#{opt_lib}/ocaml/lablgtk2", "lablgtk.cma", "gtkInit.cmo", "test.ml", "-o", "test", "-cclib", "-latk-1.0", "-cclib", "-lcairo", "-cclib", "-lgdk-quartz-2.0", "-cclib", "-lgdk_pixbuf-2.0", "-cclib", "-lgio-2.0", "-cclib", "-lglib-2.0", "-cclib", "-lgobject-2.0", "-cclib", "-lgtk-quartz-2.0", "-cclib", "-lgtksourceview-2.0", "-cclib", "-lintl", "-cclib", "-lpango-1.0", "-cclib", "-lpangocairo-1.0" system "./test" end end