diff --git a/pkgbuilds/ghostty/.omarchy/package.json b/pkgbuilds/ghostty/.omarchy/package.json new file mode 100644 index 00000000..088e3853 --- /dev/null +++ b/pkgbuilds/ghostty/.omarchy/package.json @@ -0,0 +1,9 @@ +{ + "source": "local", + "upstream": { + "watch": { + "pattern": "v(?P[0-9]+(?:\\.[0-9]+)*)", + "git_tags": "https://github.com/ghostty-org/ghostty.git" + } + } +} diff --git a/pkgbuilds/ghostty/PKGBUILD b/pkgbuilds/ghostty/PKGBUILD new file mode 100644 index 00000000..23166e5d --- /dev/null +++ b/pkgbuilds/ghostty/PKGBUILD @@ -0,0 +1,114 @@ +# Ghostty for 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 +# 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 +pkgdesc='Fast, native, feature-rich terminal emulator pushing modern features' +arch=(aarch64) +url='https://github.com/ghostty-org/ghostty' +license=(MIT) +depends=( + bzip2 + fontconfig + freetype2 + glib2 + glibc + gtk4 + gtk4-layer-shell + harfbuzz + libadwaita + libpng + oniguruma + pixman + wayland + zlib +) +makedepends=( + blueprint-compiler + curl + gettext + pkgconf +) +_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" +) +sha256sums=( + '3349d25600ffbda281197a18314f7d18791969cffe9474f0ff16a45a9ebfccdb' + '958ed7d1e00d0ea76590d27666efbf7a932281b3d7ba0c6b01b0ff26498f667f' +) + +prepare() { + cd "$_archive" + PATH="$srcdir/zig-aarch64-linux-$_zigver:$PATH" \ + ZIG_GLOBAL_CACHE_DIR="$srcdir/zig-global-cache" \ + ./nix/build-support/fetch-zig-cache.sh +} + +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" \ + DESTDIR=build \ + zig build \ + --prefix /usr \ + --system "$srcdir/zig-global-cache/p" \ + -Doptimize=ReleaseFast \ + -Dgtk-x11=true \ + -Dcpu=baseline \ + -Dpie=true \ + -Demit-docs=false \ + -Dversion-string="$pkgver+omarchy.$pkgrel" \ + --build-id=sha1 +} + +package_ghostty() { + depends+=(ghostty-shell-integration ghostty-terminfo) + optdepends=('ghostty-nautilus: Open in Ghostty context menu in GNOME Files') + + cd "$_archive" + cp -a build/* "$pkgdir/" + install -Dm0644 LICENSE "$pkgdir/usr/share/licenses/ghostty/LICENSE" + rm -r "$pkgdir/usr/share/terminfo" \ + "$pkgdir/usr/share/ghostty/shell-integration" \ + "$pkgdir/usr/share/nautilus-python" +} + +package_ghostty-shell-integration() { + pkgdesc='Shell integration scripts for Ghostty' + depends=() + + cd "$_archive" + install -d "$pkgdir/usr/share/ghostty/shell-integration" + cp -a build/usr/share/ghostty/shell-integration/. \ + "$pkgdir/usr/share/ghostty/shell-integration/" + install -Dm0644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +} + +package_ghostty-terminfo() { + pkgdesc='Terminfo for Ghostty' + depends=() + + cd "$_archive" + install -d "$pkgdir/usr/share/terminfo" + cp -a build/usr/share/terminfo/x "$pkgdir/usr/share/terminfo/" + install -Dm0644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +} + +package_ghostty-nautilus() { + pkgdesc='Open in Ghostty for GNOME Files' + depends=(ghostty nautilus-python) + license=(GPL-2.0-or-later) + + cd "$_archive" + install -d "$pkgdir/usr/share/nautilus-python" + cp -a build/usr/share/nautilus-python/. "$pkgdir/usr/share/nautilus-python/" +}