diff --git a/Package.swift b/Package.swift index 9de0f56..bb7999b 100644 --- a/Package.swift +++ b/Package.swift @@ -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( @@ -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( @@ -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