Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sonic 1.4.1 #139397

Merged
merged 2 commits into from
Sep 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 24 additions & 12 deletions Formula/s/sonic.rb
Original file line number Diff line number Diff line change
@@ -1,27 +1,39 @@
class Sonic < Formula
desc "Fast, lightweight & schema-less search backend"
homepage "https://github.com/valeriansaliou/sonic"
url "https://github.com/valeriansaliou/sonic/archive/v1.4.0.tar.gz"
sha256 "953314a8c711fde89ac5a7e41ab37d35fffa2b5cc6428d849bc65968e45a8cde"
url "https://github.com/valeriansaliou/sonic/archive/refs/tags/v1.4.1.tar.gz"
sha256 "54c4bf768808ae1b5526d3c557759f5f0fd31aac453aba71638b498fc9015170"
license "MPL-2.0"

bottle do
sha256 cellar: :any_skip_relocation, arm64_ventura: "ba4c2939b999ae73c46cceecb21e25f67f2c0107d8fc53b4ffbe5337299a66c3"
sha256 cellar: :any_skip_relocation, arm64_monterey: "88a2d41df229febf3a5fc32b1af2c78657810e12ef94ca9522a318b590365bf6"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "42ec66f78a25bd41bfb235b6684aa4f17c7360a5cdc2fdff6206b9be0c0b62e0"
sha256 cellar: :any_skip_relocation, ventura: "cdc64f315ef84bee7373ce6d79bb3d556ab9f834c2a1dd69a096bcb5bef9cdbb"
sha256 cellar: :any_skip_relocation, monterey: "00d1c7357fcb1261433e54856267d7c653701b8d154e4951cd16ba70fe66c3c6"
sha256 cellar: :any_skip_relocation, big_sur: "322caf905b32c77a887ac05a5c9d78d1116e3af9701ecc27652c813d86c9f1a6"
sha256 cellar: :any_skip_relocation, catalina: "9396cb130cd9db11186a103e19371ff06d1e6e72ef784f5b9f94415ef29dfef3"
sha256 cellar: :any_skip_relocation, x86_64_linux: "12a26ea1c3ca5619ac1f72d37526b47862512c136bc0e56b24c5b023b72c1d42"
sha256 cellar: :any_skip_relocation, arm64_ventura: "11a23492e2ad193b664c3552fe6ba219552805787fb0eb2fbbf174aae5933cd5"
sha256 cellar: :any_skip_relocation, arm64_monterey: "a78f9e55686eaf8951e9eb4055a119872c5de7088a5f1a44c28edfa196d14bc1"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "7f8c034a9459392dc521e60a46672f9d6c70e91c30cc5ca5b51c21913872f248"
sha256 cellar: :any_skip_relocation, ventura: "87956eae0267936d007753252e2297cbbb96ef129e57355a131bc5ff687a0e74"
sha256 cellar: :any_skip_relocation, monterey: "d123ac2daa1ef6cdebf2f4e8ab00d6fdcaca19c5367f8f66bfda3ad568bcb431"
sha256 cellar: :any_skip_relocation, big_sur: "532f64da105577f6ba6f90f7953370ef4d04826e7919bade075d694b6741cc31"
sha256 cellar: :any_skip_relocation, x86_64_linux: "ab07e6adf7d8858270f08554aa271b84564c016e23762a45ea8d670abf926342"
end

# Use `llvm@15` to work around build failure with Clang 16 described in
# https://github.com/rust-lang/rust-bindgen/issues/2312.
# TODO: Switch back to `uses_from_macos "llvm" => :build` when `bindgen` is
# updated to 0.62.0 or newer. There is a check in the `install` method.
depends_on "llvm@15" => :build
depends_on "rust" => :build

uses_from_macos "llvm" => :build
uses_from_macos "netcat" => :test

def install
bindgen_version = Version.new(
(buildpath/"Cargo.lock").read
.match(/name = "bindgen"\nversion = "(.*)"/)[1],
)
if bindgen_version >= "0.62.0"
odie "`bindgen` crate is updated to 0.62.0 or newer! Please remove " \
'this check and try switching to `uses_from_macos "llvm" => :build`.'
end

system "cargo", "install", *std_cargo_args
inreplace "config.cfg", "./", var/"sonic/"
etc.install "config.cfg" => "sonic.cfg"
Expand All @@ -43,7 +55,7 @@ def install
inreplace "config.cfg", "#{var}/sonic", "."

fork { exec bin/"sonic" }
sleep 2
sleep 10
system "nc", "-z", "localhost", port
end
end