From 9371c653b2e7286765ed501dff0efb9ba9ec2f00 Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Tue, 22 Oct 2024 15:52:45 +0100 Subject: [PATCH] xclogparser: staticly link Swift stdlib on Linux --- Formula/x/xclogparser.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Formula/x/xclogparser.rb b/Formula/x/xclogparser.rb index a0c72eb30aef0a..5eddf4fdfeb540 100644 --- a/Formula/x/xclogparser.rb +++ b/Formula/x/xclogparser.rb @@ -4,6 +4,7 @@ class Xclogparser < Formula url "https://github.com/MobileNativeFoundation/XCLogParser/archive/refs/tags/v0.2.39.tar.gz" sha256 "b225891b94bbdb549ddbc9ffe838ad87f73ef7cc79934e3e23969bb1220eafd9" license "Apache-2.0" + revision 1 bottle do sha256 cellar: :any_skip_relocation, arm64_sonoma: "2af489ea40d0e2ea3d490c151137cc74992e17d9e5d4ea842efe37bb5c3c83f3" @@ -18,9 +19,20 @@ class Xclogparser < Formula depends_on xcode: "13.0" uses_from_macos "swift" + uses_from_macos "zlib" def install - system "swift", "build", "-c", "release", "--disable-sandbox" + # Fix hardcoded path to system zlib. + system "swift", "package", "fetch" + inreplace ".build/checkouts/GzipSwift/Sources/system-zlib/include/module.modulemap", + "/usr/include", Formula["zlib"].opt_include + + args = if OS.mac? + ["--disable-sandbox"] + else + ["--static-swift-stdlib"] + end + system "swift", "build", "-c", "release", *args bin.install ".build/release/xclogparser" end