Skip to content

Commit

Permalink
xclogparser: staticly link Swift stdlib on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo98 committed Oct 22, 2024
1 parent 8f306f5 commit 420c3b2
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Formula/x/xclogparser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -18,9 +19,21 @@ class Xclogparser < Formula
depends_on xcode: "13.0"

uses_from_macos "swift"
uses_from_macos "zlib"

def install

Check failure on line 24 in Formula/x/xclogparser.rb

View workflow job for this annotation

GitHub Actions / Linux

`brew install --verbose --formula --build-bottle xclogparser` failed on Linux!

/tmp/xclogparser-20241103-6652-160k21/XCLogParser-0.2.39/Sources/XCLogParser/logmanifest/LogManifest.swift:73:33: warning: 'init(contentsOfFile:)' is deprecated guard let logContents = NSDictionary(contentsOfFile: logManifestURL.path) else { ^ [19/21] Compiling XCLogParserApp DumpCommand.swift [19/21] Write Objects.LinkFileList error: link command failed with exit code 1 (use -v to see invocation) /home/linuxbrew/.linuxbrew/opt/swift/libexec/lib/swift_static/linux/libFoundation.a(CFCalendar.c.o):CFCalendar.c:function __calcNextDaylightSavingTimeTransition:(.text+0x4c): error: undefined reference to 'ucal_setMillis_74' /home/linuxbrew/.linuxbrew/opt/swift/libexec/lib/swift_static/linux/libFoundation.a(CFCalendar.c.o):CFCalendar.c:function __calcNextDaylightSavingTimeTransition:(.text+0x5c): error: undefined reference to 'ucal_getTimeZoneTransitionDate_74' /home/linuxbrew/.linuxbrew/opt/swift/libexec/lib/swift_static/linux/libFoundation.a(CFCalendar.c.o):CFCalendar.c:function __CFCalendarDeallocate:(.text+0xd7): error: undefined reference to 'ucal_close_74' /home/linuxbrew/.linuxbrew/opt/swift/libexec/lib/swift_static/linux/libFoundation.a(CFCalendar.c.o):CFCalendar.c:function __CFCalendarCreateUCalendar:(.text+0x261): error: undefined reference to 'ucal_open_74' /home/linuxbrew/.linuxbrew/opt/swift/libexec/lib/swift_static/linux/libFoundation.a(CFCalendar.c.o):CFCalendar.c:function __CFCalendarSetupCal:(.text+0x2d3): error: undefined reference to 'ucal_setAttribute_74' /home/linuxbrew/.linuxbrew/opt/swift/libexec/lib/swift_static/linux/libFoundation.a(CFCalendar.c.o):CFCalendar.c:function __CFCalendarSetupCal:(.text+0x2e4): error: undefined reference to 'ucal_setAttribute_74' /home/linuxbrew/.linuxbrew/opt/swift/libexec/lib/swift_static/linux/libFoundation.a(CFCalendar.c.o):CFCalendar.c:function __CFCalendarSetupCal:(.text+0x31b): error: undefined reference to 'ucal_setGregorianChange_74' /home/linuxbrew/.linuxbrew/opt/swift/libexec/lib/swift_static/linux/libFoundation.a(CFCalendar.c.o):CFCalendar.c:function _CFCalendarIsDateInWeekend:(.text+0x376): error: undefined reference to 'ucal_isWeekend_74' /home/linuxbrew/.linuxbrew/opt/swift/libexec/lib/swift_static/linux/libFoundation.a(CFCalendar.c.o):CFCalendar.c:function _CFCalendarGetNextWeekend:(.text+0x543): error: undefined reference to 'ucal_getDayOfWeekType_74' /home/linuxbrew/.linuxbrew/opt/swift/libexec/lib/swift_static/linux/libFoundation.a(CFCalendar.c.o):CFCalendar.c:function _CFCalendarGetNextWeekend:(.text+0x598): error: undefined reference to 'ucal_getDayOfWeekType_74' /home/linuxbrew/.linuxbrew/opt/swift/libexec/lib/swift_static/linux/libFoundation.a(CFCalendar.c.o):CFCalendar.c:function _CFCalendarGetNextWeekend:(.text+0x5cc): error: undefined reference to 'ucal_getDayOfWeekType_74' /home/linuxbrew/.linuxbrew/opt/swift/libexec/lib/swift_static/linux/libFoundation.a(CFCalendar.c.o):CFCalendar.c:function _CFCalendarGetNextWeekend:(.text+0x5fd): error: undefined reference to 'ucal_getDayOfWeekType_74' /home/linuxbrew/.linuxbrew/opt/swift/libexec/lib/swift_static/linux/libFoundation.a(CFCalendar.c.o):CFCalendar.c:function _CFCalendarGetNextWeekend:(.text+0x73d): error: undefined reference to 'ucal_getWeekendTransition_74' /home/linuxbrew/.linuxbrew/opt/swift/libexec/lib/swift_static/linux/libFoundation.a(CFCalendar.c.o):CFCalendar.c:function _CFCalendarGetNextWeekend:(.text+0x77b): error: undefined reference to 'ucal_getWeekendTransition_74' /home/linuxbrew/.linuxbrew/opt/swift/libexec/lib/swift_static/linux/libFoundation.a(CFCalendar.c.o):CFCalendar.c:function __CFCalendarZapCal:(.text+0x97e): error: undefined reference to 'ucal_close_74' /home/linuxbrew/.linuxbrew/opt/swift/libexec/lib/swift_static/linux/libFoundation.a(CFCalendar.c.o):CFCalendar.c:function __CFCalendarApplyUserSettingsFromLocale:(.text+0xb1b): error: undefined reference to 'ucal_setAttribute_74' /home/linuxbrew/.linuxbrew/opt/swift/libexec/lib/swift_static/linux/libFoundation.a(CFCalendar.c.o):CFCalendar.c:function __CFCalendarApplyUserSettingsFromLocale
system "swift", "build", "-c", "release", "--disable-sandbox"
args = if OS.mac?
["--disable-sandbox"]
else
["--static-swift-stdlib"]
end

# Fix hardcoded path to system zlib.
system "swift", "package", "fetch", *args
inreplace ".build/checkouts/GzipSwift/Sources/system-zlib/include/module.modulemap",
"/usr/include", Formula["zlib"].opt_include

system "swift", "build", "-c", "release", *args
bin.install ".build/release/xclogparser"
end

Expand Down

0 comments on commit 420c3b2

Please sign in to comment.