class Lablgtk < Formula desc "Objective Caml interface to gtk+" homepage "http://lablgtk.forge.ocamlcore.org" url "https://github.com/garrigue/lablgtk/archive/2.18.11.tar.gz" sha256 "ff3c551df4e220b0c0fb9a3da6429413bff14f8fc93f4dd6807a35463982c863" license "LGPL-2.1" bottle do cellar :any sha256 "5b78b8453ba24346aa344c059f2fecf115818e84c61d688164d423de5b0351be" => :catalina sha256 "2e0cfbc7bbb653c2f757de7847712a0fb334f404225f1c1836266ae67c253844" => :mojave sha256 "1d8a6f6da14b92e38b4fe9c999c43ae05ee3d355c58d77ef6ad04161004a7880" => :high_sierra end depends_on "pkg-config" => :build depends_on "gtk+" depends_on "gtksourceview" depends_on "librsvg" depends_on "ocaml" def install system "./configure", "--bindir=#{bin}", "--libdir=#{lib}", "--mandir=#{man}", "--with-libdir=#{lib}/ocaml" ENV.deparallelize system "make", "world" system "make", "old-install" end test do (testpath/"test.ml").write <<~EOS 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