Skip to content

Commit a218ff1

Browse files
committed
Fix build issue
1 parent 4ad3453 commit a218ff1

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Sources/PackageLoading/Target+PkgConfig.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ extension SystemPackageProviderDescription {
139139
switch self {
140140
case .brew(let packages):
141141
return " brew install \(packages.joined(separator: " "))\n"
142+
case .port(let packages):
143+
return " port install \(packages.joined(separator: " "))\n"
142144
case .apt(let packages):
143145
return " apt-get install \(packages.joined(separator: " "))\n"
144146
case .yum(let packages):
@@ -156,6 +158,10 @@ extension SystemPackageProviderDescription {
156158
if case .darwin = platform {
157159
return true
158160
}
161+
case .port:
162+
if case .darwin = platform {
163+
return true
164+
}
159165
case .apt:
160166
if case .linux(.debian) = platform {
161167
return true
@@ -200,6 +206,8 @@ extension SystemPackageProviderDescription {
200206
}
201207
}
202208
return try packages.map({ try AbsolutePath(validating: brewPrefix).appending(components: "opt", $0, "lib", "pkgconfig") })
209+
case .port:
210+
return []
203211
case .apt:
204212
return []
205213
case .yum:

Tests/PackageLoadingTests/PkgConfigTests.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class PkgConfigTests: XCTestCase {
5151
pkgConfig: "Foo",
5252
providers: [
5353
.brew(["libFoo"]),
54+
.port(["libFoo"]),
5455
.apt(["libFoo-dev"]),
5556
.yum(["libFoo-devel"]),
5657
.nuget(["Foo"]),
@@ -67,6 +68,8 @@ class PkgConfigTests: XCTestCase {
6768
switch result.provider {
6869
case .brew(let names)?:
6970
XCTAssertEqual(names, ["libFoo"])
71+
case .port(let names)?:
72+
XCTAssertEqual(names, ["libFoo"])
7073
case .apt(let names)?:
7174
XCTAssertEqual(names, ["libFoo-dev"])
7275
case .yum(let names)?:

0 commit comments

Comments
 (0)