class Rethinkdb < Formula desc "The open-source database for the realtime web" homepage "https://www.rethinkdb.com/" url "https://download.rethinkdb.com/dist/rethinkdb-2.4.0.tgz" sha256 "bfb0708710595c6762f42e25613adec692cf568201cd61da74c254f49fa9ee4c" revision 1 bottle do cellar :any sha256 "ce3f886f880a43649c486fcc6c467e3ca44f526f06c4abeb7509e949b43b600e" => :catalina sha256 "7ecafe14d01b8289df21dae7cc8f6d6313bd2adb0e690be386d3bb09cf0efae8" => :mojave sha256 "fcec71e74c936790031c212773b91aea4c62fb80c0e25207c1162c3a486bf2da" => :high_sierra end depends_on "boost" => :build depends_on "openssl@1.1" 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" (var/"log/rethinkdb").mkpath inreplace "packaging/assets/config/default.conf.sample", /^# directory=.*/, "directory=#{var}/rethinkdb" etc.install "packaging/assets/config/default.conf.sample" => "rethinkdb.conf" end plist_options :manual => "rethinkdb" def plist; <<~EOS Label #{plist_name} ProgramArguments #{opt_bin}/rethinkdb --config-file #{etc}/rethinkdb.conf 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