homebrew-core/Formula/meson.rb

47 lines
1.7 KiB
Ruby

class Meson < Formula
desc "Fast and user friendly build system"
homepage "https://mesonbuild.com/"
url "https://github.com/mesonbuild/meson/releases/download/0.59.2/meson-0.59.2.tar.gz"
sha256 "13dee549a7ba758b7e33ce7719f28d1d337a98d10d378a4779ccc996f5a2fc49"
license "Apache-2.0"
head "https://github.com/mesonbuild/meson.git"
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "591cda9c80329d71ce918e7994a4d5d135ed69ef48ac049a9bb94429d25d59f0"
sha256 cellar: :any_skip_relocation, big_sur: "3172bfe6cd74d86311d96c561ff66c0bb7bd3ddc51111728e9d5a83734366acd"
sha256 cellar: :any_skip_relocation, catalina: "3172bfe6cd74d86311d96c561ff66c0bb7bd3ddc51111728e9d5a83734366acd"
sha256 cellar: :any_skip_relocation, mojave: "3172bfe6cd74d86311d96c561ff66c0bb7bd3ddc51111728e9d5a83734366acd"
sha256 cellar: :any_skip_relocation, x86_64_linux: "591cda9c80329d71ce918e7994a4d5d135ed69ef48ac049a9bb94429d25d59f0"
end
depends_on "ninja"
depends_on "python@3.9"
def install
version = Language::Python.major_minor_version Formula["python@3.9"].bin/"python3"
ENV["PYTHONPATH"] = lib/"python#{version}/site-packages"
system Formula["python@3.9"].bin/"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