diff --git a/Formula/risingwave@1.1.rb b/Formula/risingwave@1.1.rb new file mode 100644 index 0000000..dbc841f --- /dev/null +++ b/Formula/risingwave@1.1.rb @@ -0,0 +1,40 @@ +class Risingwave < Formula + RW_VERSION = "1.1.2".freeze + desc "Distributed SQL database for stream processing" + homepage "https://github.com/risingwavelabs/risingwave" + url "https://github.com/risingwavelabs/risingwave/archive/refs/tags/v#{RW_VERSION}.tar.gz" + sha256 "9f137bded84d3fe7713c4bc37674c40f6a7f1c73ef68df55a6e71f1656af5231" + license "Apache-2.0" + head "https://github.com/risingwavelabs/risingwave.git", branch: "main" + + bottle do + root_url "https://github.com/risingwavelabs/homebrew-risingwave/releases/download/risingwave-1.1.2" + sha256 cellar: :any, arm64_monterey: "bc4e9742da58038881a106b2f4000f94d5ca94da96451d1b68d386f60c028894" + sha256 cellar: :any, monterey: "a23810510625b3c83fb61de6645e6b2d15c567ce1c5914ca6a872cd46aab83bc" + end + + depends_on "cmake" => :build + depends_on "llvm" => :build + depends_on "protobuf" => :build + depends_on "rustup-init" => :build + depends_on "openssl@3" + depends_on "xz" + + def install + # this will install the necessary cargo/rustup toolchain bits in HOMEBREW_CACHE + system "#{Formula["rustup-init"].bin}/rustup-init", + "-qy", "--no-modify-path", + "--default-toolchain", "none" + ENV.prepend_path "PATH", HOMEBREW_CACHE/"cargo_cache/bin" + + ENV.delete "RUSTFLAGS" # https://github.com/Homebrew/brew/pull/15544#issuecomment-1628639703 + system "cargo", "install", + "--bin", "risingwave", + "--features", "rw-static-link", + *std_cargo_args(path: "src/cmd_all") # "--locked", "--root ...", "--path src/cmd_all" + end + + test do + system "#{bin}/risingwave", "--help" + end +end diff --git a/Formula/risingwave@1.2.rb b/Formula/risingwave@1.2.rb new file mode 100644 index 0000000..375cab4 --- /dev/null +++ b/Formula/risingwave@1.2.rb @@ -0,0 +1,46 @@ +class Risingwave < Formula + desc "Distributed SQL database for stream processing" + homepage "https://github.com/risingwavelabs/risingwave" + url "https://github.com/risingwavelabs/risingwave/archive/refs/tags/v1.2.0.tar.gz" + sha256 "8dc4e3997941a31b3ff08ac0be760cbdcb840b8e40dcc99b40c2eafe346e034c" + license "Apache-2.0" + head "https://github.com/risingwavelabs/risingwave.git", branch: "main" + + bottle do + root_url "https://github.com/risingwavelabs/homebrew-risingwave/releases/download/risingwave-1.2.0" + sha256 cellar: :any, arm64_ventura: "3332956802bdbc0ba1dc3246e6cf4a347ce990eb6f755203884139546151b73a" + sha256 cellar: :any, ventura: "eeea7521801328f50fdf8a00bc222eed11a06b0f7a2de118e9a052af957e21d4" + end + + depends_on "cmake" => :build + depends_on "llvm" => :build + depends_on "protobuf" => :build + depends_on "rustup-init" => :build + depends_on "openssl@3" + depends_on "xz" + + def install + # this will install the necessary cargo/rustup toolchain bits in HOMEBREW_CACHE + system "#{Formula["rustup-init"].bin}/rustup-init", + "-qy", "--no-modify-path", + "--default-toolchain", "none" + ENV.prepend_path "PATH", HOMEBREW_CACHE/"cargo_cache/bin" + + ENV.delete "RUSTFLAGS" # https://github.com/Homebrew/brew/pull/15544#issuecomment-1628639703 + # Homebrew changes cxx flags, and CMake doesn't pick them up, so rdkafka-sys build fails. + # We cannot pass CMake flags (`std_cmake_args`) because it's in their build.rs. + # + # Some refs that might be useful: + # https://github.com/Homebrew/homebrew-core/pull/51949#issuecomment-601943075 + # https://github.com/Homebrew/brew/pull/7134 + ENV["SDKROOT"] = MacOS.sdk_path_if_needed + system "cargo", "install", + "--bin", "risingwave", + "--features", "rw-static-link", + *std_cargo_args(path: "src/cmd_all") # "--locked", "--root ...", "--path src/cmd_all" + end + + test do + system "#{bin}/risingwave", "--help" + end +end