From 4965d3c1fbcb35533377f54576e816aeb4210b6e Mon Sep 17 00:00:00 2001 From: Eduardo Date: Fri, 2 Oct 2026 18:45:05 +0900 Subject: [PATCH] Fix Ghostty ncurses file conflicts --- docs/ghostty.md | 5 +++ .../lib/try-omarchy/install-ghostty-arm64 | 2 +- .../local/share/try-omarchy/ghostty/PKGBUILD | 6 ++- guest/spec.json | 4 +- guest/tests/test_ghostty_installer.py | 42 +++++++++++++++++++ macos/run-qemu-gpu.sh | 4 +- 6 files changed, 56 insertions(+), 7 deletions(-) diff --git a/docs/ghostty.md b/docs/ghostty.md index a2093003..be79a154 100644 --- a/docs/ghostty.md +++ b/docs/ghostty.md @@ -20,6 +20,11 @@ does not try to replace it. Remove it with `omarchy-pkg-remove ghostty` after se There is no automatic upstream Ghostty release check: a newer pinned release requires an updated Try Omarchy installer and another installation. +The package leaves `/usr/share/terminfo/g/ghostty` owned by `ncurses` and +includes Ghostty's `xterm-ghostty` entry. Revision `1.3.1-2` fixes the file +conflict that prevented `1.3.1-1` from installing. If you encountered that +failure, run the updated installer from a checkout as described below. + ## Existing VMs Existing VM disks do not automatically receive a rebuilt factory image. From a diff --git a/guest/native-overlay/usr/local/lib/try-omarchy/install-ghostty-arm64 b/guest/native-overlay/usr/local/lib/try-omarchy/install-ghostty-arm64 index 18aa7fbd..52713736 100755 --- a/guest/native-overlay/usr/local/lib/try-omarchy/install-ghostty-arm64 +++ b/guest/native-overlay/usr/local/lib/try-omarchy/install-ghostty-arm64 @@ -77,7 +77,7 @@ echo 'The first build takes several minutes and uses temporary disk space.' # Installing dependencies and publishing the completed package require sudo; # download, signature verification, compilation and makepkg run unprivileged. omarchy-pkg-add gtk4 libadwaita gtk4-layer-shell libx11 libxkbcommon mesa \ - glibc gcc-libs pkgconf gettext minisign fakeroot binutils || fail 'could not install build dependencies' + glibc gcc-libs ncurses pkgconf gettext minisign fakeroot binutils || fail 'could not install build dependencies' for tool in makepkg python3 curl tar zstd minisign pkg-config fakeroot bsdtar repo-add pacman; do command -v "$tool" >/dev/null || fail "$tool is required" done diff --git a/guest/native-overlay/usr/local/share/try-omarchy/ghostty/PKGBUILD b/guest/native-overlay/usr/local/share/try-omarchy/ghostty/PKGBUILD index be0b3d61..bad0343c 100644 --- a/guest/native-overlay/usr/local/share/try-omarchy/ghostty/PKGBUILD +++ b/guest/native-overlay/usr/local/share/try-omarchy/ghostty/PKGBUILD @@ -1,12 +1,12 @@ # User-initiated build, not part of the factory package transaction. pkgname=ghostty pkgver=1.3.1 -pkgrel=1 +pkgrel=2 pkgdesc='Ghostty terminal with a Try Omarchy VirGL rendering fallback' arch=('aarch64') url='https://ghostty.org' license=('MIT') -depends=('gtk4' 'libadwaita' 'gtk4-layer-shell' 'libx11' 'libxkbcommon' 'mesa' 'glibc' 'gcc-libs') +depends=('gtk4' 'libadwaita' 'gtk4-layer-shell' 'libx11' 'libxkbcommon' 'mesa' 'glibc' 'gcc-libs' 'ncurses') makedepends=('pkgconf' 'gettext' 'minisign') options=('!debug' '!strip' '!lto') source=( @@ -38,6 +38,8 @@ build() { package() { cp -a "$srcdir/staged/usr" "$pkgdir/" + # ncurses owns this alias. Keep Ghostty's xterm-ghostty entry for TERM. + rm -f "$pkgdir/usr/share/terminfo/g/ghostty" install -dm755 "$pkgdir/usr/lib/ghostty" mv "$pkgdir/usr/bin/ghostty" "$pkgdir/usr/lib/ghostty/ghostty" install -m755 "$srcdir/ghostty-wrapper" "$pkgdir/usr/bin/ghostty" diff --git a/guest/spec.json b/guest/spec.json index b54d6144..c575571e 100644 --- a/guest/spec.json +++ b/guest/spec.json @@ -182,7 +182,7 @@ }, "ghostty": { "version": "1.3.1", - "pkgrel": "1", + "pkgrel": "2", "sourceUrl": "https://release.files.ghostty.org/1.3.1/ghostty-1.3.1.tar.gz", "sourceSha256": "3349d25600ffbda281197a18314f7d18791969cffe9474f0ff16a45a9ebfccdb", "signingKey": "RWQlAjJC23149WL2sEpT/l0QKy7hMIFhYdQOFy0Z7z7PbneUgvlsnYcV", @@ -190,7 +190,7 @@ "zigUrl": "https://ziglang.org/download/0.15.2/zig-aarch64-linux-0.15.2.tar.xz", "zigSha256": "958ed7d1e00d0ea76590d27666efbf7a932281b3d7ba0c6b01b0ff26498f667f", "recipe": "native-overlay/usr/local/share/try-omarchy/ghostty/PKGBUILD", - "recipeSha256": "fe333bdccba74a4817d2b8e7180f4f37f8455bbb9019cb7db81481c3f64bbf9c", + "recipeSha256": "039101852ca314042c7a28892554418ca7f067a174c4dea3bdc453182bbde28c", "wrapperSha256": "c41b20e46f257da7a06ee8c67b1056d099f61d7935ac2014525b1b2b1f74f827", "license": "MIT", "signatureSha256": "5591816f6a52f03d1ea5be0129fcc396aeece7238419cdd36e511546ee242798" diff --git a/guest/tests/test_ghostty_installer.py b/guest/tests/test_ghostty_installer.py index 1dbdf2f7..f2f02aae 100644 --- a/guest/tests/test_ghostty_installer.py +++ b/guest/tests/test_ghostty_installer.py @@ -57,6 +57,48 @@ def test_signature_failure_stops_before_build(self): self.assertEqual(result.returncode, 42) self.assertNotIn('continued', result.stdout) + def test_package_preserves_terminfo_without_claiming_ncurses_alias(self): + with tempfile.TemporaryDirectory() as temporary: + root = Path(temporary) + src = root / 'src' + pkg = root / 'pkg' + pkg.mkdir() + staged = src / 'staged/usr' + files = { + 'bin/ghostty': b'compiled executable', + 'share/terminfo/x/xterm-ghostty': b'compiled terminfo', + 'share/ghostty/terminfo/ghostty.terminfo': b'terminfo source', + 'share/applications/com.mitchellh.ghostty.desktop': b'desktop entry', + } + for name, contents in files.items(): + path = staged / name + path.parent.mkdir(parents=True, exist_ok=True) + path.write_bytes(contents) + alias = staged / 'share/terminfo/g/ghostty' + alias.parent.mkdir(parents=True) + os.link(staged / 'share/terminfo/x/xterm-ghostty', alias) + version = SPEC['supplyChain']['ghostty']['version'] + license = src / f'ghostty-{version}/LICENSE' + license.parent.mkdir() + license.write_text('MIT') + shutil.copyfile(ASSETS / 'ghostty-wrapper', src / 'ghostty-wrapper') + # GNU install -D creates this parent in the Linux guest; precreate + # it so the package function can also run with macOS BSD install. + (pkg / 'usr/share/licenses/ghostty').mkdir(parents=True) + result = subprocess.run( + ['bash', '-c', 'set -e; source "$1"; srcdir=$2; pkgdir=$3; package; printf "%s\\n" "${depends[@]}"', + 'bash', str(ASSETS / 'PKGBUILD'), str(src), str(pkg)], + capture_output=True, text=True) + self.assertEqual(result.returncode, 0, result.stderr) + self.assertIn('ncurses', result.stdout.splitlines()) + self.assertFalse((pkg / 'usr/share/terminfo/g/ghostty').exists()) + self.assertEqual(alias.read_bytes(), b'compiled terminfo') + for name, contents in files.items(): + target = 'lib/ghostty/ghostty' if name == 'bin/ghostty' else name + self.assertEqual((pkg / 'usr' / target).read_bytes(), contents) + self.assertEqual((pkg / 'usr/bin/ghostty').read_bytes(), (ASSETS / 'ghostty-wrapper').read_bytes()) + self.assertEqual((pkg / 'usr/share/licenses/ghostty/LICENSE').read_text(), 'MIT') + def test_wrapper_scopes_rendering_and_preserves_arguments(self): for cmdline, expected in (('quiet omarchy.qemu_virgl=1 root=/dev/vda', '1'), ('omarchy.qemu_virgl=10', '0'), ('xomarchy.qemu_virgl=1', '0'), ('', '0')): diff --git a/macos/run-qemu-gpu.sh b/macos/run-qemu-gpu.sh index 3aa87038..9fba2706 100755 --- a/macos/run-qemu-gpu.sh +++ b/macos/run-qemu-gpu.sh @@ -754,7 +754,7 @@ ghostty = exact_keys( ) if ghostty != { "version": "1.3.1", - "pkgrel": "1", + "pkgrel": "2", "sourceUrl": "https://release.files.ghostty.org/1.3.1/ghostty-1.3.1.tar.gz", "sourceSha256": "3349d25600ffbda281197a18314f7d18791969cffe9474f0ff16a45a9ebfccdb", "signingKey": "RWQlAjJC23149WL2sEpT/l0QKy7hMIFhYdQOFy0Z7z7PbneUgvlsnYcV", @@ -762,7 +762,7 @@ if ghostty != { "zigUrl": "https://ziglang.org/download/0.15.2/zig-aarch64-linux-0.15.2.tar.xz", "zigSha256": "958ed7d1e00d0ea76590d27666efbf7a932281b3d7ba0c6b01b0ff26498f667f", "recipe": "native-overlay/usr/local/share/try-omarchy/ghostty/PKGBUILD", - "recipeSha256": "fe333bdccba74a4817d2b8e7180f4f37f8455bbb9019cb7db81481c3f64bbf9c", + "recipeSha256": "039101852ca314042c7a28892554418ca7f067a174c4dea3bdc453182bbde28c", "wrapperSha256": "c41b20e46f257da7a06ee8c67b1056d099f61d7935ac2014525b1b2b1f74f827", "license": "MIT", "signatureSha256": "5591816f6a52f03d1ea5be0129fcc396aeece7238419cdd36e511546ee242798"