mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-06 07:38:21 +00:00
This is an update to address common agentic issues I run into, but the `build.nu` script may be generally helpful to people using the Nix env since `xcodebuild` is broken by default in Nix due to the compiler/linker overrides Nix shell does.
33 lines
1.0 KiB
Plaintext
Executable File
33 lines
1.0 KiB
Plaintext
Executable File
#!/usr/bin/env nu
|
|
|
|
# Build the macOS Ghostty app using xcodebuild with a clean environment
|
|
# to avoid Nix shell interference (NIX_LDFLAGS, NIX_CFLAGS_COMPILE, etc.).
|
|
|
|
def main [
|
|
--scheme: string = "Ghostty" # Xcode scheme (Ghostty, Ghostty-iOS, DockTilePlugin)
|
|
--configuration: string = "Debug" # Build configuration (Debug, Release, ReleaseLocal)
|
|
--action: string = "build" # xcodebuild action (build, test, clean, etc.)
|
|
] {
|
|
let project = ($env.FILE_PWD | path join "Ghostty.xcodeproj")
|
|
let build_dir = ($env.FILE_PWD | path join "build")
|
|
|
|
# Skip UI tests for CLI-based invocations because it requires
|
|
# special permissions.
|
|
let skip_testing = if $action == "test" {
|
|
[-skip-testing GhosttyUITests]
|
|
} else {
|
|
[]
|
|
}
|
|
|
|
(^env -i
|
|
$"HOME=($env.HOME)"
|
|
"PATH=/usr/bin:/bin:/usr/sbin:/sbin"
|
|
xcodebuild
|
|
-project $project
|
|
-scheme $scheme
|
|
-configuration $configuration
|
|
$"SYMROOT=($build_dir)"
|
|
...$skip_testing
|
|
$action)
|
|
}
|