-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathneon-storage.rb
74 lines (63 loc) · 2.99 KB
/
neon-storage.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
class NeonStorage < Formula
desc "Storage components for Neon"
homepage "https://github.com/neondatabase/neon"
url "https://github.com/neondatabase/neon.git",
tag: "release-7765",
revision: "a54853abd52570dea2eaebeee3b50bc04b569330"
license "Apache-2.0"
head "https://github.com/neondatabase/neon.git", branch: "main"
livecheck do
url :head
regex(/^release-(\d+)$/i)
end
bottle do
root_url "https://ghcr.io/v2/bayandin/tap"
sha256 cellar: :any_skip_relocation, arm64_sequoia: "b79900367c61294a62ec919aa6b77196170f5be5a5727420e65c6db192a8bfee"
sha256 cellar: :any_skip_relocation, arm64_sonoma: "5733d7ae2a8b39bcd9f82dcbeae0eaa7b0455fe1076118c4ebe039afa18a1656"
sha256 cellar: :any_skip_relocation, ventura: "8a670e7a73cdb976408e33eb52367382a6c83efa69ad19f020346af4145e8264"
sha256 cellar: :any_skip_relocation, x86_64_linux: "0a3073c87b6cff18324640fea30f50b334be005a13ec34782b0b371fc7a54315"
end
depends_on "pkg-config" => :build
depends_on "rust" => :build
depends_on "bayandin/tap/neon-postgres"
depends_on "openssl@3"
depends_on "protobuf"
uses_from_macos "llvm" => :build
def binaries
%w[
compute_ctl neon_local pagebench pagectl pageserver
safekeeper storage_broker storage_controller
storage_scrubber storcon_cli wal_craft
]
end
def neon_postgres
Formula["bayandin/tap/neon-postgres"]
end
def install
ENV["BUILD_TAG"] = build.stable? ? "release-#{version}" : "dev-#{Utils.git_short_head}"
ENV["GIT_VERSION"] = Utils.git_head
ENV["POSTGRES_INSTALL_DIR"] = neon_postgres.opt_libexec
ENV["POSTGRES_DISTRIB_DIR"] = neon_postgres.opt_libexec
mkdir_p libexec/"storage_controller"
cp_r "storage_controller/migrations", libexec/"storage_controller/"
system "cargo", "install", *std_cargo_args(root: libexec, path: "compute_tools")
system "cargo", "install", *std_cargo_args(root: libexec, path: "control_plane")
system "cargo", "install", *std_cargo_args(root: libexec, path: "control_plane/storcon_cli")
system "cargo", "install", *std_cargo_args(root: libexec, path: "libs/postgres_ffi/wal_craft")
system "cargo", "install", *std_cargo_args(root: libexec, path: "pageserver")
system "cargo", "install", *std_cargo_args(root: libexec, path: "pageserver/ctl")
system "cargo", "install", *std_cargo_args(root: libexec, path: "pageserver/pagebench")
system "cargo", "install", *std_cargo_args(root: libexec, path: "safekeeper")
system "cargo", "install", *std_cargo_args(root: libexec, path: "storage_broker")
system "cargo", "install", *std_cargo_args(root: libexec, path: "storage_controller")
system "cargo", "install", *std_cargo_args(root: libexec, path: "storage_scrubber")
end
test do
(binaries - %w[compute_ctl pagebench wal_craft]).each do |file|
system libexec/"bin"/file, "--version"
end
system libexec/"bin/compute_ctl", "--help"
system libexec/"bin/pagebench", "--help"
system libexec/"bin/wal_craft", "--help"
end
end