class Vala < Formula desc "Compiler for the GObject type system" homepage "https://live.gnome.org/Vala" url "https://download.gnome.org/sources/vala/0.34/vala-0.34.0.tar.xz" sha256 "5d59e1ad4c59debc83687b593345a3cf9ef2e9020354145e59a188de4348f455" bottle do sha256 "416f4d34c98282fcf6fac874833d5eaffdbadd7935d9578fc9343ac2ca78a2c0" => :sierra sha256 "1911be89fea93b91a8924cb7a0273234048fa8581ea48fcd6abd09e50a5a87fb" => :el_capitan sha256 "0d48b61460d57206c5f8e5598d8208c6502c6ce971dcb3c9d84a68773cbb48c9" => :yosemite end depends_on "pkg-config" => :run depends_on "gettext" depends_on "glib" def install system "./configure", "--disable-dependency-tracking", "--disable-silent-rules", "--prefix=#{prefix}" system "make" # Fails to compile as a single step system "make", "install" end test do test_string = "Hello Homebrew\n" path = testpath/"hello.vala" path.write <<-EOS void main () { print ("#{test_string}"); } EOS valac_args = [ # Build with debugging symbols. "-g", # Use Homebrew's default C compiler. "--cc=#{ENV.cc}", # Save generated C source code. "--save-temps", # Vala source code path. path.to_s, ] system "#{bin}/valac", *valac_args assert File.exist?(testpath/"hello.c") assert_equal test_string, shell_output("#{testpath}/hello") end end