jackett 0.22.1382
[Homebrew/homebrew-core.git] / Formula / r / river.rb
blobf26a3b2a65e3b5ad34a5548d0a55d7599502f584
1 class River < Formula
2   desc "Reverse proxy application, based on the pingora library from Cloudflare"
3   homepage "https://github.com/memorysafety/river"
4   url "https://github.com/memorysafety/river/archive/refs/tags/v0.5.0.tar.gz"
5   sha256 "fe96d3693d60be06d0d1810954835f79139495b890b597f42c2b0bfa2bd8c7a6"
6   license "Apache-2.0"
7   head "https://github.com/memorysafety/river.git", branch: "main"
9   bottle do
10     sha256 cellar: :any,                 arm64_sequoia:  "07ebac88781c5ead2935d4fcdcf750f10791ac135986c7917e5fcfcf8cad0a97"
11     sha256 cellar: :any,                 arm64_sonoma:   "d214bd3778baa4798b1842f4d4a6049d48f02cbe6862418d35e1acc8fe8d319a"
12     sha256 cellar: :any,                 arm64_ventura:  "2f254be15ed6c188188fa007bcb48e7124808c8449c95da2bc463b1539852b23"
13     sha256 cellar: :any,                 arm64_monterey: "6bb3878f623d205400f5906e4104b7545c1054169766720fc2acb8ddf403a8c1"
14     sha256 cellar: :any,                 sonoma:         "32bf41e3c0baccfccc9aa73af1e00178cda928638dab11a67651342a54a9ce67"
15     sha256 cellar: :any,                 ventura:        "92a0e801a55f3d122801ce1394b665e4d9ffeff6a6fc3f3aebb14e27ea1335ce"
16     sha256 cellar: :any,                 monterey:       "c99da45b6218bbc2254e0f9deefd84aeedb74f44cc7049babfe93e1d9dbbbd35"
17     sha256 cellar: :any_skip_relocation, x86_64_linux:   "0ffd4142bf28d324a32169a8e5cd31640c89af81ae66e3f7f4b2fc548322dec0"
18   end
20   depends_on "cmake" => :build
21   depends_on "pkgconf" => :build
22   depends_on "rust" => :build
23   depends_on "openssl@3"
25   def install
26     # Ensure that the `openssl` crate picks up the intended library.
27     ENV["OPENSSL_DIR"] = Formula["openssl@3"].opt_prefix
28     ENV["OPENSSL_NO_VENDOR"] = "1"
30     system "cargo", "install", *std_cargo_args(path: "source/river")
31   end
33   test do
34     require "utils/linkage"
36     (testpath/"example-config.toml").write <<~TOML
37       [system]
38         [[basic-proxy]]
39         name = "Example Config"
40         [basic-proxy.connector]
41         proxy_addr = "127.0.0.1:80"
42     TOML
43     system bin/"river", "--validate-configs", "--config-toml", testpath/"example-config.toml"
45     [
46       Formula["openssl@3"].opt_lib/shared_library("libssl"),
47       Formula["openssl@3"].opt_lib/shared_library("libcrypto"),
48     ].each do |library|
49       assert Utils.binary_linked_to_library?(bin/"river", library),
50              "No linkage with #{library.basename}! Cargo is likely using a vendored version."
51     end
52   end
53 end