Merge pull request #207012 from Homebrew/bump-tailwindcss-4.0.5
[Homebrew/homebrew-core.git] / Formula / g / git-absorb.rb
bloba690c72d93d8c6befa30a4e85cae8c1a6c1acad5
1 class GitAbsorb < Formula
2   desc "Automatic git commit --fixup"
3   homepage "https://github.com/tummychow/git-absorb"
4   url "https://github.com/tummychow/git-absorb/archive/refs/tags/0.6.17.tar.gz"
5   sha256 "512ef2bf0e642f8c34eb56aad657413bd9e04595e3bc4650ecf1c0799f148ca4"
6   license "BSD-3-Clause"
8   bottle do
9     sha256 cellar: :any,                 arm64_sequoia: "bb985890d415ff167d823f5ecb8a8e627b97375b81efb58fc00db2995dc806b2"
10     sha256 cellar: :any,                 arm64_sonoma:  "4b43c763348b5beb746a35baa22ff81511e89338669a46f5daf979ec30383267"
11     sha256 cellar: :any,                 arm64_ventura: "0fa5ccdc1815c2fed9505950968e1075ee971d4f158b087b4d22f1bd797b1734"
12     sha256 cellar: :any,                 sonoma:        "1bd3b24e9b32f49351555e3e8bea57fcc868a475243df29082f07899a87d3a02"
13     sha256 cellar: :any,                 ventura:       "74aa1215fca2e8df5a019b03ad8b917bc9bd73d24b1be84e9d129054922a3cc5"
14     sha256 cellar: :any_skip_relocation, x86_64_linux:  "e75f77c1f10cefb7a8400671d7d2eb307ea41d4d36e0aeb7f71c266e0d1590c3"
15   end
17   depends_on "pkgconf" => :build
18   depends_on "rust" => :build
19   depends_on "libgit2"
21   def install
22     ENV["LIBGIT2_NO_VENDOR"] = "1"
24     system "cargo", "install", *std_cargo_args
26     man1.install "Documentation/git-absorb.1"
27     generate_completions_from_executable(bin/"git-absorb", "--gen-completions")
28   end
30   test do
31     (testpath/".gitconfig").write <<~EOS
32       [user]
33         name = Real Person
34         email = notacat@hotmail.cat
35     EOS
36     system "git", "init"
37     (testpath/"test").write "foo"
38     system "git", "add", "test"
39     system "git", "commit", "--message", "Initial commit"
41     (testpath/"test").delete
42     (testpath/"test").write "bar"
43     system "git", "add", "test"
44     system "git", "absorb"
46     linkage_with_libgit2 = (bin/"git-absorb").dynamically_linked_libraries.any? do |dll|
47       next false unless dll.start_with?(HOMEBREW_PREFIX.to_s)
49       File.realpath(dll) == (Formula["libgit2"].opt_lib/shared_library("libgit2")).realpath.to_s
50     end
52     assert linkage_with_libgit2, "No linkage with libgit2! Cargo is likely using a vendored version."
53   end
54 end