2 desc "Package manager for the Zig programming language"
3 homepage "https://nektro.github.io/zigmod/"
4 url "https://github.com/nektro/zigmod/archive/refs/tags/r93.tar.gz"
5 sha256 "302162e6ba66ee8abe028b5d61fe1c474ec50eadfb6481dc782702126fddb639"
14 sha256 cellar: :any_skip_relocation, arm64_sequoia: "420f7558e02cced834ae9109dfb12b93a864510c582af36d097cbb25a3379fc0"
15 sha256 cellar: :any_skip_relocation, arm64_sonoma: "3ada99291a14a4b050d9021469d4912be19098785d6d557ccfd09f7613dbce43"
16 sha256 cellar: :any_skip_relocation, arm64_ventura: "6dde24eaa99843a68b0f5c59f95c3a7116afd326b315d8a30f519cd6eb099c79"
17 sha256 cellar: :any_skip_relocation, sonoma: "61702ca7b0671790b8598c55957f3cd53b6f215907be3add1f9de06f3da746ad"
18 sha256 cellar: :any_skip_relocation, ventura: "dfd79a1b16483e86d85867b7494952d6a9c05dbc26c0924fd952106370e41500"
19 sha256 cellar: :any_skip_relocation, x86_64_linux: "41a39652f9ed4f90a02280a3064bfa9a16746fda7af518d886280e86dceeb068"
22 depends_on "pkgconf" => :build
26 # Fix illegal instruction errors when using bottles on older CPUs.
27 # https://github.com/Homebrew/homebrew-core/issues/92282
28 cpu = case Hardware.oldest_cpu
29 when :arm_vortex_tempest then "apple_m1" # See `zig targets`.
30 else Hardware.oldest_cpu
40 args << "-Dcpu=#{cpu}" if build.bottle?
42 system "zig", "build", *args
46 (testpath/"zigmod.yml").write <<~YAML
47 id: 89ujp8gq842x6mzok8feypwze138n2d96zpugw44hcq7406r
51 description: Test zig.mod
52 min_zig_version: 0.11.0
54 - src: git https://github.com/nektro/zig-yaml
57 (testpath/"src/lib.zig").write <<~ZIG
58 const std = @import("std");
60 std.log.info("Hello, world!");
64 system bin/"zigmod", "fetch"
65 assert_path_exists testpath/"deps.zig"
66 assert_path_exists testpath/"zigmod.lock"
68 assert_match version.to_s, shell_output("#{bin}/zigmod version")