class Arangodb < Formula desc "The Multi-Model NoSQL Database." homepage "https://www.arangodb.com/" url "https://download.arangodb.com/Source/ArangoDB-3.2.4.tar.gz" sha256 "564cacc29e806bca3ce3115bb03fd5b500dbceb32a5b3124e6f8c480dbe98270" head "https://github.com/arangodb/arangodb.git", :branch => "unstable" bottle do sha256 "0a8c25d62bbc15b6bf9f6055b921c6de55d16968b708808796b17814fc438bbe" => :high_sierra sha256 "07a6580ed2f65800c97fe1c033f530fd9501aeb59ee8350a28d81d3f5fac1e0f" => :sierra sha256 "0e18ab5c12e2f7c5b4dc6ec1ff5d297889fb3bae73c61bcfe3fde34f40524812" => :el_capitan end depends_on :macos => :yosemite depends_on "cmake" => :build depends_on "go" => :build depends_on "openssl" needs :cxx11 fails_with :clang do build 600 cause "Fails with compile errors" end def install ENV.cxx11 mkdir "build" do args = std_cmake_args + %W[ -DHOMEBREW=ON -DUSE_OPTIMIZE_FOR_ARCHITECTURE=OFF -DASM_OPTIMIZATIONS=OFF -DCMAKE_INSTALL_DATADIR=#{share} -DCMAKE_INSTALL_DATAROOTDIR=#{share} -DCMAKE_INSTALL_SYSCONFDIR=#{etc} -DCMAKE_INSTALL_LOCALSTATEDIR=#{var} ] if ENV.compiler == "gcc-6" ENV.append "V8_CXXFLAGS", "-O3 -g -fno-delete-null-pointer-checks" end system "cmake", "..", *args system "make", "install" %w[arangod arango-dfdb arangosh foxx-manager].each do |f| inreplace etc/"arangodb3/#{f}.conf", pkgshare, opt_pkgshare end end end def post_install (var/"lib/arangodb3").mkpath (var/"log/arangodb3").mkpath end def caveats s = <<-EOS.undent An empty password has been set. Please change it by executing #{opt_sbin}/arango-secure-installation EOS s end plist_options :manual => "#{HOMEBREW_PREFIX}/opt/arangodb/sbin/arangod" def plist; <<-EOS.undent KeepAlive Label #{plist_name} Program #{opt_sbin}/arangod RunAtLoad EOS end test do testcase = "require('@arangodb').print('it works!')" output = shell_output("#{bin}/arangosh --server.password \"\" --javascript.execute-string \"#{testcase}\"") assert_equal "it works!", output.chomp end end