// swift-tools-version: 5.9 import PackageDescription import Foundation let sharedNative: Package.Dependency = ProcessInfo.processInfo.environment["OFICINA_NATIVE_PACKAGE_PATH"].map { .package(path: $0) } ?? .package(url: "https://amadan.net/rastrillo/native", revision: "b8098cd09c2641467f4dad71057e4a733b610649") let package = Package( name: "CallsNative", platforms: [.macOS(.v14), .iOS(.v17)], products: [ .library(name: "CallsKit", targets: ["CallsKit"]), // What the iPhone's broadcast extension links, and all it links: no // WebRTC, so the extension stays far inside its memory ceiling. .library(name: "CallsBroadcastKit", targets: ["CallsBroadcastKit"]), .executable(name: "CallsMac", targets: ["CallsMac"]), .executable(name: "CallsInterop", targets: ["CallsInterop"]), ], dependencies: [ sharedNative, .package(url: "https://github.com/livekit/webrtc-xcframework.git", exact: "150.7871.02") ], targets: [ .binaryTarget(name: "CallsBridge", path: "../build/CallsBridge.xcframework"), // Built by scripts/build-rnnoise.sh, as CallsBridge is by build-bridge.sh. .binaryTarget(name: "RNNoise", path: "../build/RNNoise.xcframework"), // Built by scripts/build-deepfilter.sh. Linked on Mac only: the iPhone // runs RNNoise, and should not carry a model runtime it never uses. .binaryTarget(name: "DeepFilter", path: "../build/DeepFilter.xcframework"), .target(name: "CallsBroadcastKit"), .target( name: "CallsKit", dependencies: [ "CallsBridge", "CallsBroadcastKit", "RNNoise", .target(name: "DeepFilter", condition: .when(platforms: [.macOS])), .product(name: "LiveKitWebRTC", package: "webrtc-xcframework"), ]), .executableTarget(name: "CallsMac", dependencies: [.product(name: "RastrilloMacUpdates", package: "native", condition: .when(platforms: [.macOS])), "CallsKit"], resources: [.copy("Resources/AppIcon.png"), .copy("Resources/MacIcon.png")]), .executableTarget(name: "CallsInterop", dependencies: ["CallsKit"]), .testTarget(name: "CallsKitTests", dependencies: ["CallsKit", "CallsBroadcastKit"], resources: [.copy("Fixtures")]), ] )