Merge pull request #462 from omacom/feat/ghostty-x86_64

Build Ghostty for x86_64 with pinned Zig toolchain
This commit is contained in:
Ryan Hughes authored and GitHub committed 2026-09-15 13:19:44 -07:00
commit ea69034287
2 files changed
+28 -9

No files matched your search

+18 -9
View File
@@ -1,15 +1,15 @@
# Ghostty for aarch64, built from the upstream release source tarball.
# Ghostty for x86_64 and aarch64, built from the upstream release source tarball.
#
# Ghostty 1.3.x requires Zig 0.15.2 exactly. Arch Linux ARM currently ships
# newer Zig releases, so use the verified upstream aarch64 toolchain only at
# Ghostty 1.3.x requires Zig 0.15.2 exactly. Distribution toolchains can move
# ahead, so use the verified upstream toolchain for each architecture only at
# package-build time rather than publishing a second Zig package.
pkgbase=ghostty
pkgname=(ghostty ghostty-shell-integration ghostty-terminfo ghostty-nautilus)
pkgver=1.3.1
pkgrel=1
pkgrel=3
pkgdesc='Fast, native, feature-rich terminal emulator pushing modern features'
arch=(aarch64)
arch=(x86_64 aarch64)
url='https://github.com/ghostty-org/ghostty'
license=(MIT)
depends=(
@@ -38,16 +38,25 @@ _zigver=0.15.2
_archive="$pkgbase-$pkgver"
source=(
"https://release.files.ghostty.org/$pkgver/$_archive.tar.gz"
"https://ziglang.org/download/$_zigver/zig-aarch64-linux-$_zigver.tar.xz"
'build-data-llvm.patch'
)
sha256sums=(
'3349d25600ffbda281197a18314f7d18791969cffe9474f0ff16a45a9ebfccdb'
'958ed7d1e00d0ea76590d27666efbf7a932281b3d7ba0c6b01b0ff26498f667f'
'd9f5781b748651fa1ff7b919f4a79cd8570118faefe2848f64f02ea4220257ba'
)
source_x86_64=("https://ziglang.org/download/$_zigver/zig-x86_64-linux-$_zigver.tar.xz")
sha256sums_x86_64=('02aa270f183da276e5b5920b1dac44a63f1a49e55050ebde3aecc9eb82f93239')
source_aarch64=("https://ziglang.org/download/$_zigver/zig-aarch64-linux-$_zigver.tar.xz")
sha256sums_aarch64=('958ed7d1e00d0ea76590d27666efbf7a932281b3d7ba0c6b01b0ff26498f667f')
prepare() {
cd "$_archive"
PATH="$srcdir/zig-aarch64-linux-$_zigver:$PATH" \
# Zig's native x86 linker cannot read .sframe relocations in Arch's crt1.o.
# Use bundled LLVM for the build-data helper, as the main executable does.
if [[ "$CARCH" == x86_64 ]]; then
patch -Np1 -i "$srcdir/build-data-llvm.patch"
fi
PATH="$srcdir/zig-$CARCH-linux-$_zigver:$PATH" \
ZIG_GLOBAL_CACHE_DIR="$srcdir/zig-global-cache" \
./nix/build-support/fetch-zig-cache.sh
}
@@ -56,7 +65,7 @@ build() {
cd "$_archive"
# A '-' suffix is a SemVer prerelease and selects Ghostty's tip channel.
# Keep the package revision as build metadata on the stable release.
PATH="$srcdir/zig-aarch64-linux-$_zigver:$PATH" \
PATH="$srcdir/zig-$CARCH-linux-$_zigver:$PATH" \
DESTDIR=build \
zig build \
--prefix /usr \
+10
View File
@@ -0,0 +1,10 @@
--- a/src/build/GhosttyResources.zig
+++ b/src/build/GhosttyResources.zig
@@ -15,6 +15,7 @@
// This is the exe used to generate some build data.
const build_data_exe = b.addExecutable(.{
.name = "ghostty-build-data",
+ .use_llvm = true,
.root_module = b.createModule(.{
.root_source_file = b.path("src/main_build_data.zig"),
.target = b.graph.host,