Skip to content

Commit

Permalink
maa-cli: use vendored libgit2 to avoid linking issues
Browse files Browse the repository at this point in the history
  • Loading branch information
wangl-cc committed Jul 18, 2024
1 parent 9499618 commit f23bd36
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions Formula/maa-cli-beta.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@ class MaaCliBeta < Formula
sha256 cellar: :any_skip_relocation, x86_64_linux: "4f711b34cd01695b9baf1adda523320848181d2022697c11251e9fc2e5e9219c"
end

option "without-libgit2", "Don't build with libgit2 resource updater backend"
option "without-git2", "Don't build with libgit2 resource updater backend"
option "without-core-installer", "Don't build with core installer"

depends_on "rust" => :build

depends_on "libgit2" => :recommended
# openssl is always required on Linux
# while it's only required on macOS when building with git2
depends_on "openssl@3" if OS.linux? || build.with?("libgit2")
depends_on "openssl@3" if OS.linux? || build.with?("git2")
uses_from_macos "zlib"

conflicts_with "maa-cli", { because: "both provide maa" }
Expand All @@ -39,7 +38,7 @@ def install
ENV["MAA_VERSION"] = version.to_s

features = []
features += ["git2"] if build.with? "libgit2"
features += ["git2", "git2/vendored-libgit2"] if build.with? "git2"
features += ["core_installer"] if build.with? "core-installer"

system "cargo", "install", "--no-default-features",
Expand Down
7 changes: 3 additions & 4 deletions Formula/maa-cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ class MaaCli < Formula
sha256 cellar: :any_skip_relocation, x86_64_linux: "8483bdb5d22fb8f8d570f23fb05450401e5ae59abb54966f6df6508d3300998a"
end

option "without-libgit2", "Don't build with libgit2 resource updater backend"
option "without-git2", "Don't build with libgit2 resource updater backend"
option "without-core-installer", "Don't build with core installer"

depends_on "rust" => :build

depends_on "libgit2" => :recommended
# openssl is always required on Linux
# while it's only required on macOS when building with git2
depends_on "openssl@3" if OS.linux? || build.with?("libgit2")
depends_on "openssl@3" if OS.linux? || build.with?("git2")

uses_from_macos "zlib"

Expand All @@ -35,7 +34,7 @@ def install
ENV["MAA_VERSION"] = version.to_s

features = []
features += ["git2"] if build.with? "libgit2"
features += ["git2", "git2/vendored-libgit2"] if build.with? "git2"
features += ["core_installer"] if build.with? "core-installer"

system "cargo", "install", "--no-default-features",
Expand Down

0 comments on commit f23bd36

Please sign in to comment.