Skip to content

Commit

Permalink
Linux Dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
consuelita committed Dec 13, 2021
1 parent 3fb20f0 commit bc03bd0
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 2 deletions.
50 changes: 49 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import PackageDescription

#if os(macOS)
let package = Package(
name: "ShadowSwift",
platforms: [
Expand All @@ -17,7 +18,7 @@ let package = Package(
.package(url: "https://github.com/OperatorFoundation/Chord.git", from: "0.0.15"),
.package(url: "https://github.com/OperatorFoundation/Datable.git", from: "3.1.2"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.4.2"),
.package(url: "https://github.com/OperatorFoundation/SwiftHexTools.git", from: "1.2.4"),
.package(url: "https://github.com/OperatorFoundation/SwiftHexTools.git", from: "1.2.5"),
.package(url: "https://github.com/OperatorFoundation/Transmission.git", from: "1.0.4"),
.package(url: "https://github.com/OperatorFoundation/Transport.git", from: "2.3.5"),
.package(url: "https://github.com/apple/swift-crypto", from: "2.0.0")
Expand Down Expand Up @@ -46,3 +47,50 @@ let package = Package(

swiftLanguageVersions: [.v5]
)
#else
let package = Package(
name: "ShadowSwift",
platforms: [
.macOS(.v10_15),
.iOS(.v14)],
products: [
.library(
name: "ShadowSwift",
targets: ["ShadowSwift"]),
],
dependencies: [
.package(url: "https://github.com/OperatorFoundation/Chord.git", from: "0.0.15"),
.package(url: "https://github.com/OperatorFoundation/Datable.git", from: "3.1.2"),
.package(url: "https://github.com/OperatorFoundation/NetworkLinux.git", from: "0.4.5"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.4.2"),
.package(url: "https://github.com/OperatorFoundation/SwiftHexTools.git", from: "1.2.5"),
.package(url: "https://github.com/OperatorFoundation/Transmission.git", from: "1.0.4"),
.package(url: "https://github.com/OperatorFoundation/Transport.git", from: "2.3.5"),
.package(url: "https://github.com/apple/swift-crypto", from: "2.0.0")
],
targets: [
.target(
name: "ShadowSwift",
dependencies: [
"Chord",
"Datable",
"NetworkLinux",
"Transmission",
"Transport",
.product(name: "Logging", package: "swift-log"),
.product(name: "Crypto", package: "swift-crypto")
]),
.testTarget(
name: "ShadowSwiftTests",
dependencies: [
"Datable",
"ShadowSwift",
"SwiftHexTools",
"Chord",
.product(name: "Logging", package: "swift-log")],
exclude: ["Info.plist"]),
],

swiftLanguageVersions: [.v5]
)
#endif
9 changes: 8 additions & 1 deletion Sources/ShadowSwift/DarkStar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,17 @@
import Foundation
import Crypto
import Transmission
import Network
import Datable
import SwiftHexTools

#if (os(macOS) || os(iOS) || os(watchOS) || os(tvOS))
import CryptoKit
import Network
#else
import Crypto
import NetworkLinux
#endif

let P256KeySize = 32 // compact format
let ConfirmationSize = 32
let NonceSize = 32
Expand Down

0 comments on commit bc03bd0

Please sign in to comment.