Skip to content

Commit

Permalink
jj: update to use libgit2 1.9
Browse files Browse the repository at this point in the history
Signed-off-by: Rui Chen <[email protected]>
  • Loading branch information
chenrui333 committed Jan 9, 2025
1 parent 8b773b2 commit a4ec2f8
Showing 1 changed file with 52 additions and 3 deletions.
55 changes: 52 additions & 3 deletions Formula/j/jj.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Jj < Formula
url "https://github.com/jj-vcs/jj/archive/refs/tags/v0.25.0.tar.gz"
sha256 "3a99528539e414a3373f24eb46a0f153d4e52f7035bb06df47bd317a19912ea3"
license "Apache-2.0"
revision 1
revision 2
head "https://github.com/martinvonz/jj.git", branch: "main"

bottle do
Expand All @@ -18,10 +18,16 @@ class Jj < Formula

depends_on "pkgconf" => :build
depends_on "rust" => :build
depends_on "libgit2@1.8" # needs https://github.com/rust-lang/git2-rs/issues/1109 to support libgit2 1.9
depends_on "libgit2"
depends_on "openssl@3"
uses_from_macos "zlib"

# patch to use libgit2 1.9, upstream pr ref, https://github.com/jj-vcs/jj/pull/5315
patch do
url "https://github.com/jj-vcs/jj/commit/b4f936ac302ee835aa274e4dd186b436781d5d2f.patch?full_index=1"
sha256 "7b2f84de2c6bbdce9934384af2f7f2d0b7f7116c4726aeef87581010cdf1564e"
end

def install
ENV["LIBGIT2_NO_VENDOR"] = "1"

Expand All @@ -45,7 +51,7 @@ def check_binary_linkage(binary, library)
assert_predicate testpath/".jj", :exist?

[
Formula["libgit2@1.8"].opt_lib/shared_library("libgit2"),
Formula["libgit2"].opt_lib/shared_library("libgit2"),
Formula["openssl@3"].opt_lib/shared_library("libcrypto"),
Formula["openssl@3"].opt_lib/shared_library("libssl"),
].each do |library|
Expand All @@ -54,3 +60,46 @@ def check_binary_linkage(binary, library)
end
end
end

__END__
diff --git a/Cargo.lock b/Cargo.lock
index 69398f4d6..3ec8dfdac 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -913,9 +913,9 @@ checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd"

[[package]]
name = "git2"
-version = "0.19.0"
+version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b903b73e45dc0c6c596f2d37eccece7c1c8bb6e4407b001096387c63d0d93724"
+checksum = "3fda788993cc341f69012feba8bf45c0ba4f3291fcc08e214b4d5a7332d88aff"
dependencies = [
"bitflags",
"libc",
@@ -2109,9 +2109,9 @@ checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a"

[[package]]
name = "libgit2-sys"
-version = "0.17.0+1.8.1"
+version = "0.18.0+1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "10472326a8a6477c3c20a64547b0059e4b0d086869eee31e6d7da728a8eb7224"
+checksum = "e1a117465e7e1597e8febea8bb0c410f1c7fb93b1e1cddf34363f8390367ffec"
dependencies = [
"cc",
"libc",
diff --git a/Cargo.toml b/Cargo.toml
index 0fc4393cb..b955fd6aa 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -46,7 +46,7 @@ dirs = "5.0.1"
dunce = "1.0.5"
either = "1.13.0"
futures = "0.3.31"
-git2 = { version = "0.19.0", features = [
+git2 = { version = "0.20.0", features = [
# Do *not* disable this feature even if you'd like dynamic linking. Instead,
# set the environment variable `LIBGIT2_NO_VENDOR=1` if dynamic linking must
# be used (this will override the Cargo feature), and allow static linking

0 comments on commit a4ec2f8

Please sign in to comment.