From 6711c83cefeb1beaaa01f187075b1474971f2706 Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Mon, 31 Oct 2022 19:51:54 -0400 Subject: [PATCH 1/4] zig 0.10.0 Signed-off-by: Rui Chen --- Formula/zig.rb | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/Formula/zig.rb b/Formula/zig.rb index 93475dfb6e43b..dd1df334aea61 100644 --- a/Formula/zig.rb +++ b/Formula/zig.rb @@ -1,14 +1,10 @@ class Zig < Formula desc "Programming language designed for robustness, optimality, and clarity" homepage "https://ziglang.org/" + url "https://ziglang.org/download/0.10.0/zig-0.10.0.tar.xz" + sha256 "d8409f7aafc624770dcd050c8fa7e62578be8e6a10956bca3c86e8531c64c136" license "MIT" - revision 2 - - stable do - url "https://ziglang.org/download/0.9.1/zig-0.9.1.tar.xz" - sha256 "38cf4e84481f5facc766ba72783e7462e08d6d29a5d47e3b75c8ee3142485210" - depends_on "llvm@13" => :build - end + head "https://github.com/ziglang/zig.git", branch: "master" bottle do sha256 cellar: :any_skip_relocation, arm64_monterey: "f07d304c8fb5ef31ac58004cd455d76064f739ba0b0992eb99c2b10160b060ad" @@ -19,12 +15,9 @@ class Zig < Formula sha256 cellar: :any_skip_relocation, x86_64_linux: "95dbaeaabf3cc63df04c8fa46a19f74ef17e7f67cfeb7bfe0dd1e6be99cb399b" end - head do - url "https://github.com/ziglang/zig.git", branch: "master" - depends_on "llvm" => :build - end - depends_on "cmake" => :build + depends_on "llvm" => :build + uses_from_macos "ncurses" uses_from_macos "zlib" From 2aa4dc1d08ebd40d7133035a1e1544dddd7263fe Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Tue, 1 Nov 2022 12:27:57 +0800 Subject: [PATCH 2/4] Update Formula/zig.rb --- Formula/zig.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Formula/zig.rb b/Formula/zig.rb index dd1df334aea61..203e295edeb0b 100644 --- a/Formula/zig.rb +++ b/Formula/zig.rb @@ -17,7 +17,8 @@ class Zig < Formula depends_on "cmake" => :build depends_on "llvm" => :build - + depends_on "z3" + depends_on "zstd" uses_from_macos "ncurses" uses_from_macos "zlib" From 6b47c60273fb9f9e308f1ae702e6d3ceb70f262f Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Tue, 1 Nov 2022 17:09:32 +0800 Subject: [PATCH 3/4] zig: fix `brew bottle` --- Formula/zig.rb | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/Formula/zig.rb b/Formula/zig.rb index 203e295edeb0b..24ab9c16f3f96 100644 --- a/Formula/zig.rb +++ b/Formula/zig.rb @@ -1,11 +1,20 @@ class Zig < Formula desc "Programming language designed for robustness, optimality, and clarity" homepage "https://ziglang.org/" - url "https://ziglang.org/download/0.10.0/zig-0.10.0.tar.xz" - sha256 "d8409f7aafc624770dcd050c8fa7e62578be8e6a10956bca3c86e8531c64c136" license "MIT" head "https://github.com/ziglang/zig.git", branch: "master" + stable do + url "https://ziglang.org/download/0.10.0/zig-0.10.0.tar.xz" + sha256 "d8409f7aafc624770dcd050c8fa7e62578be8e6a10956bca3c86e8531c64c136" + + on_macos do + # We need to make sure there is enough space in the MachO header when we rewrite install names. + # https://github.com/ziglang/zig/issues/13388 + patch :DATA + end + end + bottle do sha256 cellar: :any_skip_relocation, arm64_monterey: "f07d304c8fb5ef31ac58004cd455d76064f739ba0b0992eb99c2b10160b060ad" sha256 cellar: :any_skip_relocation, arm64_big_sur: "3f3dacda44621fb6d7d0ba1ef241840059bd0876547ab12355238e53e325aef1" @@ -55,3 +64,17 @@ def install assert_equal "Hello, world!", shell_output("./hello") end end + +__END__ +diff --git a/build.zig b/build.zig +index e5e80b4..1da6892 100644 +--- a/build.zig ++++ b/build.zig +@@ -154,6 +154,7 @@ pub fn build(b: *Builder) !void { + + exe.stack_size = stack_size; + exe.strip = strip; ++ exe.headerpad_max_install_names = true; + exe.sanitize_thread = sanitize_thread; + exe.build_id = b.option(bool, "build-id", "Include a build id note") orelse false; + exe.install(); From 4200f20e917ff06a6e939fb68a77c75bd8b891f4 Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Tue, 1 Nov 2022 21:28:53 +0800 Subject: [PATCH 4/4] Update Formula/zig.rb --- Formula/zig.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/Formula/zig.rb b/Formula/zig.rb index 24ab9c16f3f96..8f73de3940627 100644 --- a/Formula/zig.rb +++ b/Formula/zig.rb @@ -26,6 +26,7 @@ class Zig < Formula depends_on "cmake" => :build depends_on "llvm" => :build + depends_on macos: :big_sur # https://github.com/ziglang/zig/issues/13313 depends_on "z3" depends_on "zstd" uses_from_macos "ncurses"