homebrew-core/Formula/lablgtk.rb

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/1627/lablgtk-2.18.5.tar.gz"
sha256 "2bf251db21c077fdd26c035ea03edd8fe609187f908e520e87a8ffdd9c36d233"
bottle do
sha256 "5029b4d9053a5ad9d4b1164aaed7af7070deeca502e388f9973894c02ca018a5" => :sierra
sha256 "554cc4007e1c25cd775cffef9528baaddc0d5ea4752a387a236a23e9218e35bc" => :el_capitan
sha256 "9e9699be0f2b4b7038204422247418a1e7551bbf1372c114383fb05c1b600781" => :yosemite
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.deparallelize
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