homebrew-core/Formula/vala.rb
2019-04-08 21:04:33 -04:00

50 lines
1.5 KiB
Ruby

class Vala < Formula
desc "Compiler for the GObject type system"
homepage "https://wiki.gnome.org/Projects/Vala"
url "https://download.gnome.org/sources/vala/0.44/vala-0.44.3.tar.xz"
sha256 "8553b422484af88be1685d8b47f7b0df36ae4477c3e77e89ab22276ffed1eae9"
bottle do
sha256 "fe4f2494555fad61baa949f5c97c58a988a686ceab25608f30b671b882e190fd" => :mojave
sha256 "e34200e65bfe7f1dd39e1c6ab3ecb9a8577c6abbc17580f3f14fedc0e0b38004" => :high_sierra
sha256 "462cfe6ad15a8009b3a791ab9c795af805a702ac08d27115ac124e1735149317" => :sierra
end
depends_on "gettext"
depends_on "glib"
depends_on "graphviz"
depends_on "pkg-config"
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
ENV.prepend_path "PKG_CONFIG_PATH", Formula["libffi"].opt_lib/"pkgconfig"
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_predicate testpath/"hello.c", :exist?
assert_equal test_string, shell_output("#{testpath}/hello")
end
end