Skip to content

Commit 31a2778

Browse files
authored
Merge pull request #194634 from Homebrew/bat-libgit2
bat: backport libgit2 1.8 support
2 parents f7f5c9c + 2b71c00 commit 31a2778

File tree

1 file changed

+62
-12
lines changed

1 file changed

+62
-12
lines changed

Formula/b/bat.rb

Lines changed: 62 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,33 @@
11
class Bat < Formula
22
desc "Clone of cat(1) with syntax highlighting and Git integration"
33
homepage "https://github.com/sharkdp/bat"
4-
url "https://github.com/sharkdp/bat/archive/refs/tags/v0.24.0.tar.gz"
5-
sha256 "907554a9eff239f256ee8fe05a922aad84febe4fe10a499def72a4557e9eedfb"
64
license any_of: ["Apache-2.0", "MIT"]
75
revision 1
86
head "https://github.com/sharkdp/bat.git", branch: "master"
97

8+
# Remove `stable` block when patch is no longer needed.
9+
stable do
10+
url "https://github.com/sharkdp/bat/archive/refs/tags/v0.24.0.tar.gz"
11+
sha256 "907554a9eff239f256ee8fe05a922aad84febe4fe10a499def72a4557e9eedfb"
12+
13+
# Update libgit2-sys to support libgit2 1.8.
14+
# Backport of https://github.com/sharkdp/bat/commit/c59dad0cae45d7aa84ad87583d6b6904b30839b2
15+
patch :DATA
16+
end
17+
1018
bottle do
11-
sha256 cellar: :any, arm64_sequoia: "8d57d3134c0940ff5b9b8ae47fb339e51bb7f7c307c538e8bbbc6e1751f9d858"
12-
sha256 cellar: :any, arm64_sonoma: "7f10b2232b03e82cd9d27560e9ed7e62e685370a187c1d9ae692b9c088f7b078"
13-
sha256 cellar: :any, arm64_ventura: "36c6ccd54c032411a7e552a010e6859936bec66ad7937ee210de8ef2a7b09ffc"
14-
sha256 cellar: :any, arm64_monterey: "bc2056fc9ac24bd33d1f8739330f25c759afad5255532547a30ecc4ebb792004"
15-
sha256 cellar: :any, sonoma: "f6d1933c659a4073863cdad02273a9a6261770cf2bcdb8694ebd65433c49f634"
16-
sha256 cellar: :any, ventura: "1beafb2f78e79ea2a905db10306c5944cb02a58b6b0e334d766482f853c9c692"
17-
sha256 cellar: :any, monterey: "14e1b6003fd419f35f525667d4997c42fc044f85709563c3f02833ecbb98e3dc"
18-
sha256 cellar: :any_skip_relocation, x86_64_linux: "36182f578db0917f46fce701b68b7122bba8323524b384f3238ca325a789b97d"
19+
rebuild 1
20+
sha256 cellar: :any, arm64_sequoia: "551f2475fea64abf18cc89dd3d7b5b81025f1eea76ec9822931698746252c7b6"
21+
sha256 cellar: :any, arm64_sonoma: "6cc195324f99c03418d089b273b581856ad80876845898c3e932d843ce9b36d7"
22+
sha256 cellar: :any, arm64_ventura: "cdf2086708888cbf4196097e7970faefa5d307d1af1596318cad3e40125952a1"
23+
sha256 cellar: :any, sonoma: "ef586d39057da2d71132ff3828a787602865895305a314356fcd91d2ad062736"
24+
sha256 cellar: :any, ventura: "34437a8949ccf6c038623ed61c5a1741a60ac34a8fd09f55eac283485e780458"
25+
sha256 cellar: :any_skip_relocation, x86_64_linux: "a9b46511808dedc8e88fe9a7194adee9d873e84c32a22a5fdc2b66f13cf35b56"
1926
end
2027

2128
depends_on "pkg-config" => :build
2229
depends_on "rust" => :build
23-
depends_on "libgit2@1.7"
30+
depends_on "libgit2"
2431
depends_on "oniguruma"
2532

2633
def install
@@ -52,11 +59,54 @@ def check_binary_linkage(binary, library)
5259
assert_match "Homebrew test", output
5360

5461
[
55-
Formula["libgit2@1.7"].opt_lib/shared_library("libgit2"),
62+
Formula["libgit2"].opt_lib/shared_library("libgit2"),
5663
Formula["oniguruma"].opt_lib/shared_library("libonig"),
5764
].each do |library|
5865
assert check_binary_linkage(bin/"bat", library),
5966
"No linkage with #{library.basename}! Cargo is likely using a vendored version."
6067
end
6168
end
6269
end
70+
71+
__END__
72+
diff --git a/Cargo.lock b/Cargo.lock
73+
index d51c98a..90367a0 100644
74+
--- a/Cargo.lock
75+
+++ b/Cargo.lock
76+
@@ -523,9 +523,9 @@ dependencies = [
77+
78+
[[package]]
79+
name = "git2"
80+
-version = "0.18.0"
81+
+version = "0.19.0"
82+
source = "registry+https://github.com/rust-lang/crates.io-index"
83+
-checksum = "12ef350ba88a33b4d524b1d1c79096c9ade5ef8c59395df0e60d1e1889414c0e"
84+
+checksum = "b903b73e45dc0c6c596f2d37eccece7c1c8bb6e4407b001096387c63d0d93724"
85+
dependencies = [
86+
"bitflags 2.4.0",
87+
"libc",
88+
@@ -658,9 +658,9 @@ checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3"
89+
90+
[[package]]
91+
name = "libgit2-sys"
92+
-version = "0.16.1+1.7.1"
93+
+version = "0.17.0+1.8.1"
94+
source = "registry+https://github.com/rust-lang/crates.io-index"
95+
-checksum = "f2a2bb3680b094add03bb3732ec520ece34da31a8cd2d633d1389d0f0fb60d0c"
96+
+checksum = "10472326a8a6477c3c20a64547b0059e4b0d086869eee31e6d7da728a8eb7224"
97+
dependencies = [
98+
"cc",
99+
"libc",
100+
diff --git a/Cargo.toml b/Cargo.toml
101+
index e31fbc3..5fb32c8 100644
102+
--- a/Cargo.toml
103+
+++ b/Cargo.toml
104+
@@ -69,7 +69,7 @@ os_str_bytes = { version = "~6.4", optional = true }
105+
run_script = { version = "^0.10.0", optional = true}
106+
107+
[dependencies.git2]
108+
-version = "0.18"
109+
+version = "0.19"
110+
optional = true
111+
default-features = false
112+

0 commit comments

Comments
 (0)