-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPackage.swift
More file actions
79 lines (78 loc) · 3.45 KB
/
Copy pathPackage.swift
File metadata and controls
79 lines (78 loc) · 3.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// swift-tools-version:6.0
import PackageDescription
// Termina — a native macOS SSH/SFTP connection manager with a Terminus-style UI.
//
// Terminal rendering is provided by SwiftTerm today. The terminal layer is kept
// behind the `TerminalSurface` protocol so a libghostty backend can be dropped in
// later (libghostty requires a full Xcode + Metal toolchain to build from source,
// which is why SwiftTerm is the shipping default).
let package = Package(
name: "Termina",
platforms: [
.macOS(.v15) // Citadel's withPTY/withTTY APIs require macOS 15+
],
products: [
.executable(name: "Termina", targets: ["Termina"])
],
dependencies: [
.package(url: "https://github.com/migueldeicaza/SwiftTerm.git", from: "1.5.0"),
.package(url: "https://github.com/orlandos-nl/Citadel.git", from: "0.12.1"),
// Direct imports needed to build PseudoTerminalRequest / ByteBuffer values
// that Citadel's PTY API takes as parameters. Versions match Citadel's lock.
.package(url: "https://github.com/Wellz26/swift-nio-ssh.git", "0.3.4" ..< "0.4.0"),
.package(url: "https://github.com/apple/swift-nio.git", from: "2.81.0"),
],
targets: [
// Prebuilt libghostty (Ghostty terminal core) — built from source with
// Zig 0.15.2 + the Metal toolchain. See Scripts/build-libghostty.sh.
.binaryTarget(
name: "GhosttyKit",
path: "Vendor/GhosttyKit.xcframework"
),
.executableTarget(
name: "Termina",
dependencies: [
.product(name: "SwiftTerm", package: "SwiftTerm"),
.product(name: "Citadel", package: "Citadel"),
.product(name: "NIOSSH", package: "swift-nio-ssh"),
.product(name: "NIOCore", package: "swift-nio"),
"GhosttyKit",
],
path: "Sources/Termina",
swiftSettings: [
// Use Swift 5 language mode to keep NIO/Citadel interop ergonomic
// (the SSH session bridges NIO channels across actors).
.swiftLanguageMode(.v5)
],
linkerSettings: [
// libghostty is a static archive; the consuming app must link the
// system frameworks Ghostty's renderer and runtime depend on.
.linkedLibrary("c++"),
.linkedFramework("Metal"),
.linkedFramework("MetalKit"),
.linkedFramework("QuartzCore"),
.linkedFramework("CoreText"),
.linkedFramework("CoreGraphics"),
.linkedFramework("CoreVideo"),
.linkedFramework("IOSurface"),
.linkedFramework("IOKit"),
.linkedFramework("Cocoa"),
.linkedFramework("Carbon"),
.linkedFramework("AudioToolbox"),
.linkedFramework("UniformTypeIdentifiers"),
.linkedFramework("UserNotifications"),
]
),
// Headless connection diagnostic — `swift run TerminaDiag <alias>`.
.executableTarget(
name: "TerminaDiag",
dependencies: [
.product(name: "Citadel", package: "Citadel"),
.product(name: "NIOSSH", package: "swift-nio-ssh"),
.product(name: "NIOCore", package: "swift-nio"),
],
path: "Sources/TerminaDiag",
swiftSettings: [.swiftLanguageMode(.v5)]
)
]
)