class Meson < Formula desc "Fast and user friendly build system" homepage "http://mesonbuild.com/" url "https://github.com/mesonbuild/meson/releases/download/0.45.1/meson-0.45.1.tar.gz" sha256 "4d0bb0dbb1bb556cb7a4092fdfea3d6e76606bd739a4bc97481c2d7bc6200afb" head "https://github.com/mesonbuild/meson.git" bottle do cellar :any_skip_relocation sha256 "8733949b21cb602a00e60222757c8c07e110f2aa23b8ef162b59a94c97318bb9" => :high_sierra sha256 "8733949b21cb602a00e60222757c8c07e110f2aa23b8ef162b59a94c97318bb9" => :sierra sha256 "8733949b21cb602a00e60222757c8c07e110f2aa23b8ef162b59a94c97318bb9" => :el_capitan end depends_on "python" depends_on "ninja" def install version = Language::Python.major_minor_version("python3") ENV["PYTHONPATH"] = lib/"python#{version}/site-packages" system "python3", *Language::Python.setup_install_args(prefix) bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"]) end test do (testpath/"helloworld.c").write <<~EOS main() { puts("hi"); return 0; } EOS (testpath/"meson.build").write <<~EOS project('hello', 'c') executable('hello', 'helloworld.c') EOS mkdir testpath/"build" do system "#{bin}/meson", ".." assert_predicate testpath/"build/build.ninja", :exist? end end end