build: bundle playback and YouTube dependencies
Build pinned LGPL playback libraries and package standalone YouTube helpers inside the signed native app. Keep the CLI inside the app and relocate private library links for installation without runtime Homebrew dependencies. Record adaptive fixture completion in its EXIT trap: cancellation can exit with status 143 before the TERM trap writes its marker, while native pause and quality preservation remain correct.
This commit is contained in:
@@ -36,11 +36,22 @@ enum TerebiCLI {
|
||||
fail(error.localizedDescription, code: 78)
|
||||
}
|
||||
}
|
||||
guard let executable = Bundle.main.executableURL else {
|
||||
var size: UInt32 = 0
|
||||
_ = _NSGetExecutablePath(nil, &size)
|
||||
var path = [CChar](repeating: 0, count: Int(size))
|
||||
guard _NSGetExecutablePath(&path, &size) == 0 else {
|
||||
fail("Could not locate the CLI executable.", code: 69)
|
||||
}
|
||||
let app = executable.resolvingSymlinksInPath().deletingLastPathComponent()
|
||||
.appendingPathComponent("terebi.app", isDirectory: true)
|
||||
let executable = path.withUnsafeBufferPointer {
|
||||
URL(fileURLWithPath: String(cString: $0.baseAddress!)).resolvingSymlinksInPath()
|
||||
}
|
||||
let macOS = executable.deletingLastPathComponent()
|
||||
let contents = macOS.deletingLastPathComponent()
|
||||
let app = contents.deletingLastPathComponent()
|
||||
guard macOS.lastPathComponent == "MacOS", contents.lastPathComponent == "Contents",
|
||||
app.pathExtension == "app" else {
|
||||
fail("The CLI must be installed inside terebi.app. Rebuild and reinstall the bundled app.", code: 69)
|
||||
}
|
||||
if let error = FFmpegRuntime.error(for: app) {
|
||||
fail(error, code: 69)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user