class Rethinkdb < Formula desc "Distributed database" homepage "http://www.rethinkdb.com/" url "http://download.rethinkdb.com/dist/rethinkdb-2.0.2.tgz" sha1 "8f5b6d30fb5608d726b10b6f1256228c0cd940f0" bottle do cellar :any sha256 "4fe0d45f38398110a1935801dc4383af7f5c4d5d91322927a9a79a6510729921" => :yosemite sha256 "d4affc88c4fbe3498d376e2026cedafa4c645d4ba46935586b5dfc1607f2686c" => :mavericks sha256 "09b1a3120e07943de1220a55f3ba7c4c8df1a1a57199d640e0924cd85c9f0489" => :mountain_lion end depends_on :macos => :lion depends_on "boost" => :build depends_on "openssl" depends_on "icu4c" fails_with :gcc do build 5666 # GCC 4.2.1 cause "RethinkDB uses C++0x" end def install args = ["--prefix=#{prefix}"] # rethinkdb requires that protobuf be linked against libc++ # but brew's protobuf is sometimes linked against libstdc++ args += ["--fetch", "protobuf"] system "./configure", *args system "make" system "make", "install-osx" mkdir_p "#{var}/log/rethinkdb" end def plist; <<-EOS.undent Label #{plist_name} ProgramArguments #{opt_bin}/rethinkdb -d #{var}/rethinkdb WorkingDirectory #{HOMEBREW_PREFIX} StandardOutPath #{var}/log/rethinkdb/rethinkdb.log StandardErrorPath #{var}/log/rethinkdb/rethinkdb.log RunAtLoad KeepAlive EOS end test do shell_output("#{bin}/rethinkdb create -d test") assert File.read("test/metadata").start_with?("RethinkDB") end end