Skip to content

Commit

Permalink
gitoxide: prepare for upstream config changes
Browse files Browse the repository at this point in the history
  • Loading branch information
carlocab committed May 5, 2023
1 parent 6abd748 commit 513efa0
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions Formula/gitoxide.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
class Gitoxide < Formula
desc "Idiomatic, lean, fast & safe pure Rust implementation of Git"
homepage "https://github.com/Byron/gitoxide"
# TODO: Update `features` array in install at version bump.
url "https://github.com/Byron/gitoxide/archive/refs/tags/v0.25.0.tar.gz"
sha256 "098bb18e1cae42ab7597b6b442538d3f51b57935a848ea121e20e2921d6a4693"
license "Apache-2.0"
head "https://github.com/Byron/gitoxide.git", branch: "main"

livecheck do
url :stable
Expand All @@ -27,10 +29,17 @@ class Gitoxide < Formula

def install
# Avoid requiring CMake or building a vendored zlib-ng.
# `max` feature is the default.
inreplace "gix/Cargo.toml", "zlib-ng", "zlib-stock"
features = %w[max gix-features/zlib-stock]
system "cargo", "install", "--features=#{features.join(",")}", *std_cargo_args
# See: https://github.com/Byron/gitoxide/blob/b8db2072bb6a5625f37debe9e58d08461ece67dd/Cargo.toml#L88-L89
features = if build.head?
# Use these features unconditionally at version bump.
%w[max-control gix-features/zlib-stock gitoxide-core-blocking-client http-client-curl]
else
odie "`install` method needs updating!" if version > "0.25.0"

inreplace "gix/Cargo.toml", "zlib-ng", "zlib-stock"
%w[max gix-features/zlib-stock]
end
system "cargo", "install", "--no-default-features", "--features=#{features.join(",")}", *std_cargo_args
end

test do
Expand Down

0 comments on commit 513efa0

Please sign in to comment.