Skip to content

Commit

Permalink
require packages only where the native libs arent available
Browse files Browse the repository at this point in the history
  • Loading branch information
theBreadCompany committed Jan 4, 2024
1 parent c93c3f0 commit a5e89f9
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ let package = Package(
dependencies: [
// .package(url: "https://github.com/phimage/Erik.git", from: "5.1.0"),
// .package(url: "https://github.com/maparoni/Zip.git", .revisionItem("059e7346082d02de16220cd79df7db18ddeba8c3"))
.package(url: "https://github.com/weichsel/ZIPFoundation.git", .upToNextMajor(from: "0.9.0")),
.package(url: "https://github.com/fwcd/swift-gif.git", .upToNextMajor(from: "2.0.0")),
.package(url: "https://github.com/twostraws/SwiftGD", .upToNextMajor(from: "2.0.0"))
.package(url: "https://github.com/weichsel/ZIPFoundation.git", .upToNextMajor(from: "0.9.0"))
],
targets: [
.target(
Expand All @@ -28,9 +26,7 @@ let package = Package(
.target(
name: "pixivswiftWrapper",
dependencies: [
"pixivswift", "ZIPFoundation",
.product(name: "GIF", package: "swift-gif", condition: .when(platforms: [.linux])),
.product(name: "SwiftGD", package: "SwiftGD", condition: .when(platforms: [.linux]))
"pixivswift", "ZIPFoundation",
]
),
.testTarget(
Expand All @@ -48,7 +44,18 @@ let package = Package(
package.targets.append(.target(name: "pixivauth", dependencies: ["pixivswift"]))
package.products.append(.executable(name: "pixivauth", targets: ["pixivauth"]))
#endif

#if !canImport(CommonCrypto)
package.dependencies.append(.package(url: "https://github.com/apple/swift-crypto.git", .upToNextMajor(from: "3.0.0")))
package.targets.first(where: {$0.name == "pixivswift"})!.dependencies.append(.productItem(name: "Crypto", package: "swift-crypto", condition: .when(platforms: [.linux])))
#endif
#if !canImport(ImageIO)
package.dependencies.append([
.package(url: "https://github.com/fwcd/swift-gif.git", .upToNextMajor(from: "2.0.0")),
.package(url: "https://github.com/twostraws/SwiftGD", .upToNextMajor(from: "2.0.0"))
])
package.targets.first(where: {$0.name == "pixivswiftWrapper"})!.dependencies.append([
.product(name: "GIF", package: "swift-gif", condition: .when(platforms: [.linux])),
.product(name: "SwiftGD", package: "SwiftGD", condition: .when(platforms: [.linux]))
])
#endif

0 comments on commit a5e89f9

Please sign in to comment.