From b5c20844f788c42742e227d349a1a573bffbb9f1 Mon Sep 17 00:00:00 2001 From: Andrew Werner Date: Mon, 30 Sep 2019 08:29:49 -0400 Subject: [PATCH] cockroach 19.1.5 --- Formula/cockroach.rb | 42 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/Formula/cockroach.rb b/Formula/cockroach.rb index 7ba7e08897e18..20a30c068e448 100644 --- a/Formula/cockroach.rb +++ b/Formula/cockroach.rb @@ -1,9 +1,9 @@ class Cockroach < Formula desc "Distributed SQL database" homepage "https://www.cockroachlabs.com" - url "https://binaries.cockroachdb.com/cockroach-v19.1.4.src.tgz" - version "19.1.4" - sha256 "d819167dc109b566511cb6cef9aadc8c4f07b1be6a8b3108f4bbd14808d21faf" + url "https://binaries.cockroachdb.com/cockroach-v19.1.5.src.tgz" + version "19.1.5" + sha256 "1e3329a56e5a1729ed3ac4ff0a97943163325dd4825e8c7c8c1d9fd57bfddfde" head "https://github.com/cockroachdb/cockroach.git" bottle do @@ -24,6 +24,38 @@ def install # that causes it to loop infinitely when trying to build cockroach. Use # the more up-to-date make that Homebrew provides. ENV.prepend_path "PATH", Formula["make"].opt_libexec/"gnubin" + + # Patch the CXX_FLAGS used to build rocksdb as a workaround for the issue fixed by + # https://github.com/facebook/rocksdb/pull/5779. Furthermore on 10.14 (Mojave) and + # later we also allow defaulted-function-delete as a workaround for + # https://github.com/facebook/rocksdb/pull/5095. + if MacOS.version < "10.14" + patch = <<~PATCH + 253c253 + < set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") + --- + > set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wno-error=shadow") + PATCH + else + patch = <<~PATCH + 253c253 + < set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") + --- + > set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wno-error=shadow -Wno-error=defaulted-function-deleted") + PATCH + end + patchfile = Tempfile.new("patch") + begin + patchfile.write(patch) + patchfile.close + system "patch", "src/github.com/cockroachdb/cockroach/c-deps/rocksdb/CMakeLists.txt", patchfile.path + ensure + patchfile.unlink + end + + # Ensure that go modules are not used as cockroachdb does not support them. + ENV["GO111MODULE"] = "off" + # Build only the OSS components system "make", "buildoss" system "make", "install", "prefix=#{prefix}", "BUILDTYPE=release" @@ -40,6 +72,10 @@ def caveats; <<~EOS mode and may expose data publicly in e.g. a DNS rebinding attack. To run CockroachDB securely, please see: #{Formatter.url("https://www.cockroachlabs.com/docs/secure-a-cluster.html")} + + Due to a license change, the cockroach package in homebrew-core will no + longer be updated when CockroachDB 19.2 is released. Please switch to + https://github.com/cockroachdb/homebrew-tap instead. EOS end