2012-08-09 18:20:02 +00:00
|
|
|
class Ninja < Formula
|
2014-07-06 22:58:33 +00:00
|
|
|
homepage "https://martine.github.io/ninja/"
|
2014-11-25 17:42:59 +00:00
|
|
|
url "https://github.com/martine/ninja/archive/v1.5.3.tar.gz"
|
2015-03-25 12:48:51 +00:00
|
|
|
sha256 "7c953b5a7c26cfcd082882e3f3e2cd08fee8848ad228bb47223b18ea18777ec0"
|
2014-07-06 22:58:33 +00:00
|
|
|
head "https://github.com/martine/ninja.git"
|
2013-01-21 09:33:56 +00:00
|
|
|
|
2014-11-19 09:16:11 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2014-11-25 18:11:38 +00:00
|
|
|
sha1 "e82dc5e952531ce5a586275c1078e3c35a15246b" => :yosemite
|
|
|
|
sha1 "04e4fc5a7ee416e248fd42eab9fe04a26f79fc96" => :mavericks
|
|
|
|
sha1 "553fca852991a02ed526d4a37f79aa60c50f23ee" => :mountain_lion
|
2014-11-19 09:16:11 +00:00
|
|
|
end
|
|
|
|
|
2014-11-19 03:27:49 +00:00
|
|
|
option "without-tests", "Run build-time tests"
|
|
|
|
|
|
|
|
resource "gtest" do
|
|
|
|
url "https://googletest.googlecode.com/files/gtest-1.7.0.zip"
|
2015-03-25 12:48:51 +00:00
|
|
|
sha256 "247ca18dd83f53deb1328be17e4b1be31514cedfc1e3424f672bf11fd7e0d60d"
|
2014-11-19 03:27:49 +00:00
|
|
|
end
|
|
|
|
|
2012-08-09 18:20:02 +00:00
|
|
|
def install
|
2014-11-25 17:42:59 +00:00
|
|
|
system "python", "configure.py", "--bootstrap"
|
2014-11-19 03:27:49 +00:00
|
|
|
|
|
|
|
if build.with? "tests"
|
|
|
|
(buildpath/"gtest").install resource("gtest")
|
|
|
|
system buildpath/"configure.py", "--with-gtest=gtest"
|
|
|
|
system buildpath/"ninja", "ninja_test"
|
|
|
|
system buildpath/"ninja_test", "--gtest_filter=-SubprocessTest.SetWithLots"
|
|
|
|
end
|
|
|
|
|
2012-08-09 18:20:02 +00:00
|
|
|
bin.install "ninja"
|
2014-07-06 22:58:33 +00:00
|
|
|
bash_completion.install "misc/bash-completion" => "ninja-completion.sh"
|
|
|
|
zsh_completion.install "misc/zsh-completion" => "_ninja"
|
2012-08-09 18:20:02 +00:00
|
|
|
end
|
2015-03-25 12:48:51 +00:00
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"build.ninja").write <<-EOS.undent
|
|
|
|
cflags = -Wall
|
|
|
|
|
|
|
|
rule cc
|
|
|
|
command = gcc $cflags -c $in -o $out
|
|
|
|
|
|
|
|
build foo.o: cc foo.c
|
|
|
|
EOS
|
|
|
|
system bin/"ninja", "-t", "targets"
|
|
|
|
end
|
2012-08-09 18:20:02 +00:00
|
|
|
end
|