homebrew-core/Formula/lablgtk.rb
2018-11-21 18:18:52 -05:00

52 lines
1.7 KiB
Ruby

class Lablgtk < Formula
desc "Objective Caml interface to gtk+"
homepage "http://lablgtk.forge.ocamlcore.org"
url "https://forge.ocamlcore.org/frs/download.php/1726/lablgtk-2.18.6.tar.gz"
sha256 "4ddca243066418e2a88ac49ebf2d846fac4b667b1b1753efadd078ae777368f8"
revision 3
bottle do
sha256 "e1de84a04e013f1e02a6e72397bc3d0a51f972661260e232c64bdab1e6f5fa34" => :mojave
sha256 "1edc1b76a28384340a571a9238a22ebe65abd569defc1346ab0ba923305b8733" => :high_sierra
sha256 "dbdeb42914d089ba2844d92de8802714b5c31fb82dbe2f1f2bb96da49776dea2" => :sierra
end
depends_on "camlp4" => :build
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