jackett 0.22.1382
[Homebrew/homebrew-core.git] / Formula / c / cabin.rb
blob8a36db05875f97cdf03b9791c12900a165c59615
1 class Cabin < Formula
2   desc "Package manager and build system for C++"
3   homepage "https://github.com/cabinpkg/cabin"
4   url "https://github.com/cabinpkg/cabin/archive/refs/tags/0.11.1.tar.gz"
5   sha256 "3c9bd2898e6fe692eb988dc71f22214ff938255ef2282d5d7d9c6bdf149d173f"
6   license "Apache-2.0"
7   revision 1
8   head "https://github.com/cabinpkg/cabin.git", branch: "main"
10   bottle do
11     sha256 cellar: :any,                 arm64_sequoia: "7327067ecb4450c4fbc39652c1d1244d95140de92191c4ac82e6043f23e542e3"
12     sha256 cellar: :any,                 arm64_sonoma:  "b4a7af27d3b278dec5584f8d1e71162281bed77c2d661e731a8f0e8280e87144"
13     sha256 cellar: :any,                 arm64_ventura: "90ca58fc4591819dd7bdb0a62d766d219de1bba32007fda30c85290e595c935c"
14     sha256 cellar: :any,                 sonoma:        "edcff193af9aa1f0eeea737a3b8ca9369c1c8801ccfbbba7ef564911cea2bcaf"
15     sha256 cellar: :any,                 ventura:       "b1605b98b0f7351d70be33d99a7d6d96061519723dbe17d96601bcb3711bfa9a"
16     sha256 cellar: :any_skip_relocation, x86_64_linux:  "95337e4be084788162d2ed9c63fbfa120e7e4a91213a0b24638460f3711bd784"
17   end
19   depends_on "nlohmann-json" => :build
20   depends_on "toml11" => :build
21   depends_on "curl"
22   depends_on "fmt"
23   depends_on "libgit2"
24   depends_on "pkgconf"
25   depends_on "tbb"
27   on_macos do
28     depends_on "llvm" => [:build, :test] if DevelopmentTools.clang_build_version <= 1200
29   end
31   on_ventura do
32     # Ventura seems to be missing the `source_location` header.
33     depends_on "llvm" => [:build, :test]
34   end
36   on_linux do
37     depends_on "gcc" # C++20
38   end
40   fails_with :clang do
41     build 1200
42     cause "Requires C++20"
43   end
45   fails_with :gcc do
46     version "11"
47     cause "Requires C++20"
48   end
50   def install
51     ENV.llvm_clang if OS.mac? && (DevelopmentTools.clang_build_version <= 1200 || MacOS.version == :ventura)
52     # Avoid cloning `toml11` at build-time.
53     (buildpath/"build/DEPS/toml11").install_symlink Formula["toml11"].opt_include
54     system "make", "RELEASE=1", "PREFIX=#{prefix}", "install"
55   end
57   test do
58     ENV.clang if OS.mac? && (DevelopmentTools.clang_build_version <= 1200 || MacOS.version == :ventura)
59     system bin/"cabin", "new", "hello_world"
60     cd "hello_world" do
61       assert_equal "Hello, world!", shell_output("#{bin}/cabin run").split("\n").last
62     end
63   end
64 end