Skip to content

Commit 053c053

Browse files
authored
Merge pull request #271 from asevko/fix-linux-compilation
fix: compilation on x86_64-swift-linux-musl
2 parents acc3545 + 21d0ae1 commit 053c053

3 files changed

Lines changed: 36 additions & 25 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,9 @@ jobs:
3838
runs-on: ubuntu-22.04
3939
steps:
4040
- name: Install Swift
41-
# WORKAROUND:https://github.com/swift-actions/setup-swift/pull/680
42-
uses: swift-actions/setup-swift@bb83339d1e8577741bdc6c65ba551ce7dc0fb854
41+
uses: swift-actions/setup-swift@v2
4342
with:
44-
swift-version: '5.10.1'
43+
swift-version: '6.0.3'
4544

4645
- uses: actions/checkout@v4
4746

Package.resolved

Lines changed: 21 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import PackageDescription
44

5+
let linuxPlatforms: [Platform] = [.linux, .openbsd]
6+
57
let package = Package(
68
name: "MachOKit",
79
platforms: [
@@ -35,7 +37,11 @@ let package = Package(
3537
),
3638
.package(
3739
url: "https://github.com/p-x9/ObjectArchiveKit.git",
38-
from: "0.3.0"
40+
from: "0.5.0"
41+
),
42+
.package(
43+
url: "https://github.com/apple/swift-crypto.git",
44+
"1.0.0" ..< "4.0.0"
3945
),
4046
],
4147
targets: [
@@ -44,7 +50,12 @@ let package = Package(
4450
dependencies: [
4551
"MachOKitC",
4652
.product(name: "FileIO", package: "swift-fileio"),
47-
.product(name: "FileIOBinary", package: "swift-fileio-extra")
53+
.product(name: "FileIOBinary", package: "swift-fileio-extra"),
54+
.product(
55+
name: "Crypto",
56+
package: "swift-crypto",
57+
condition: .when(platforms: linuxPlatforms)
58+
)
4859
],
4960
swiftSettings: SwiftSetting.allCases + [
5061
.enableExperimentalFeature("AccessLevelOnImport", .when(configuration: .debug))
@@ -102,23 +113,6 @@ if isForBinaryKitFramework {
102113
]
103114
}
104115

105-
// MARK: - Crypto
106-
107-
#if (os(macOS) || os(iOS) || os(watchOS) || os(tvOS)) && canImport(CommonCrypto)
108-
/* Do Nothing */
109-
#else
110-
package.dependencies += [
111-
.package(url: "https://github.com/apple/swift-crypto.git", "1.0.0" ..< "4.0.0")
112-
]
113-
114-
machOKit?.dependencies += [
115-
.product(
116-
name: "Crypto",
117-
package: "swift-crypto"
118-
)
119-
]
120-
#endif
121-
122116
// https://github.com/treastrain/swift-upcomingfeatureflags-cheatsheet
123117
extension SwiftSetting {
124118
static let forwardTrailingClosures: Self = .enableUpcomingFeature("ForwardTrailingClosures") // SE-0286, Swift 5.3, SwiftPM 5.8+

0 commit comments

Comments
 (0)