1 class GitSeries < Formula
2 desc "Track changes to a patch series over time"
3 homepage "https://github.com/git-series/git-series"
4 url "https://github.com/git-series/git-series/archive/refs/tags/0.9.1.tar.gz"
5 sha256 "c0362e19d3fa168a7cb0e260fcdecfe070853b163c9f2dfd2ad8213289bc7e5f"
10 sha256 cellar: :any, arm64_sequoia: "2e348dcdc3d49977fe6647cc92e833f174fde3b6ec3e199c0965639b6e76f868"
11 sha256 cellar: :any, arm64_sonoma: "f65c2ae6393964b2aa6ca5932f2c46aa09b66516994b22a6dd9803532f69ff52"
12 sha256 cellar: :any, arm64_ventura: "66d9169576bcc5e0e50d8cbc4209c7576988a9ad55a38d3b2b9c0bfd66dfc545"
13 sha256 cellar: :any, sonoma: "2a6340eeb3800421ce3f529d17ae243c3705c1e0842f0539f8cbcd4d9076bfc4"
14 sha256 cellar: :any, ventura: "6dbec136b4be60ee749b0d9cb51c514d978840ad75c8fddf475cba6747c0b9d9"
15 sha256 cellar: :any_skip_relocation, x86_64_linux: "bd832576f196e9dea9d888881f89d08f9d849b7971fa5b66f1bed7ae942673e1"
18 depends_on "pkgconf" => :build
19 depends_on "rust" => :build
20 depends_on "libgit2@1.8" # needs https://github.com/rust-lang/git2-rs/issues/1109 to support libgit2 1.9
22 depends_on "openssl@3"
25 # Ensure that the `openssl` crate picks up the intended library.
26 # https://crates.io/crates/openssl#manual-configuration
27 ENV["OPENSSL_DIR"] = Formula["openssl@3"].opt_prefix
28 ENV["OPENSSL_NO_VENDOR"] = "1"
30 ENV["LIBGIT2_SYS_USE_PKG_CONFIG"] = "1"
31 ENV["LIBSSH2_SYS_USE_PKG_CONFIG"] = "1"
33 # TODO: In the next version after 0.9.1, update this command as follows:
34 # system "cargo", "install", *std_cargo_args
35 system "cargo", "install", "--root", prefix, "--path", "."
36 man1.install "git-series.1"
40 require "utils/linkage"
42 (testpath/".gitconfig").write <<~EOS
45 email = notacat@hotmail.cat
49 (testpath/"test").write "foo"
50 system "git", "add", "test"
51 system "git", "commit", "-m", "Initial commit"
52 (testpath/"test").append_lines "bar"
53 system "git", "commit", "-m", "Second commit", "test"
54 system bin/"git-series", "start", "feature"
55 system "git", "checkout", "HEAD~1"
56 system bin/"git-series", "base", "HEAD"
57 system bin/"git-series", "commit", "-a", "-m", "new feature v1"
60 Formula["libgit2@1.8"].opt_lib/shared_library("libgit2"),
61 Formula["libssh2"].opt_lib/shared_library("libssh2"),
62 Formula["openssl@3"].opt_lib/shared_library("libssl"),
64 linked_libraries << (Formula["openssl@3"].opt_lib/shared_library("libcrypto")) if OS.mac?
66 linked_libraries.each do |library|
67 assert Utils.binary_linked_to_library?(bin/"git-series", library),
68 "No linkage with #{library.basename}! Cargo is likely using a vendored version."