From 9c1bf4d84f9c08ff856fddab3e07db840f7c5273 Mon Sep 17 00:00:00 2001 From: BlackAngelTVdev Date: Fri, 6 Nov 2026 08:41:18 +0100 Subject: [PATCH] build: add an Arch package for the FWS kitty Installing the branch system-wide meant copying binaries by hand. Provide a PKGBUILD that builds the branch and installs kitty and kitten in /usr/bin so pacman can install and update it, with instructions for a local repository. --- packaging/PKGBUILD | 70 +++++++++++++++++++++++++++++++++++++++++ packaging/README.md | 77 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 147 insertions(+) create mode 100644 packaging/PKGBUILD create mode 100644 packaging/README.md diff --git a/packaging/PKGBUILD b/packaging/PKGBUILD new file mode 100644 index 0000000..7854ca1 --- /dev/null +++ b/packaging/PKGBUILD @@ -0,0 +1,70 @@ +# Maintainer: FWS +# +# Arch package for the FWS kitty fork. Built with makepkg from this directory: +# +# cd packaging && makepkg -f +# +# The resulting fws-kitty---.pkg.tar.zst is ready to be +# added to a pacman repository (see README.md in this directory). +# +# kitty installs its own binary under /usr/bin and cannot coexist with the +# upstream package, hence provides/conflicts. + +pkgname=fws-kitty +pkgver=0.50.0 +pkgrel=1 +pkgdesc='Fast, feature-rich, GPU based terminal (FWS fork with the file-manager kitten)' +arch=('x86_64' 'aarch64') +url='https://gitea.nocode-var.tech/FWS/FWS-Kitty' +license=('GPL-3.0-only') + +# Replace main with the tag or commit to ship once the release is cut. +_branch=main +_repo='https://gitea.nocode-var.tech/FWS/FWS-Kitty.git' + +depends=( + python harfbuzz zlib libpng lcms2 xxhash openssl + pixman cairo freetype2 fontconfig + libx11 libxcb libxrandr libxinerama libxcursor libxi libxrender + libxkbcommon libxkbcommon-x11 mesa wayland dbus + libcanberra systemd-libs +) +makedepends=( + git go python pkgconf ncurses rsync which file simde shader-slang +) +optdepends=( + 'imagemagick: display uncommon image formats' + 'shader-slang: custom shaders' +) +provides=('kitty') +conflicts=('kitty') + +source=( + "$pkgname::git+$_repo#branch=$_branch" + "nerdfonts-symbols.tar.xz::https://github.com/ryanoasis/nerd-fonts/releases/download/v3.5.1/NerdFontsSymbolsOnly.tar.xz" +) +sha256sums=('SKIP' '01172f37db8543edb102e5cb5c64101c9f4686630804d49b419aa07b23a69996') + +prepare() { + # kitty embeds the mono variant of the Nerd font at build time, but Arch + # only packages the proportional one, so ship the font with the build. + mkdir -p "$pkgname/fonts" + cp "$srcdir/SymbolsNerdFontMono-Regular.ttf" "$pkgname/fonts/" + + cd "$pkgname" + # linux-package regenerates the man pages and the HTML docs, and some of + # their dependencies (furo, sphinx-design) are not packaged for Arch, so + # keep a local throwaway environment instead of requiring the system ones. + # Do not reuse the system packages: pip would then skip installing sphinx + # itself and the venv would have no sphinx-build entry point. + python -m venv .docs-venv + .docs-venv/bin/pip install --disable-pip-version-check -q -r docs/requirements.txt +} + +package() { + cd "$pkgname" + # kitty's linux-package target stages a full self-contained install, so + # pointing --prefix at the package root is enough; no manual file copying. + PATH="$srcdir/$pkgname/.docs-venv/bin:$PATH" python setup.py linux-package --prefix "$pkgdir/usr" + install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +} diff --git a/packaging/README.md b/packaging/README.md new file mode 100644 index 0000000..a549254 --- /dev/null +++ b/packaging/README.md @@ -0,0 +1,77 @@ +# Paquet Arch — FWS-Kitty + +Ce dossier contient le `PKGBUILD` qui produit le paquet pacman de FWS-Kitty, +prêt à être publié dans le dépôt officiel FWS. Le paquet s'appelle +`fws-kitty` et remplace `kitty` (`provides`/`conflicts`) : les deux ne peuvent +pas cohabiter, ils installent les mêmes binaires dans `/usr/bin`. + +## Construire + +```sh +cd packaging +makepkg -f # ajouter -s pour installer les dépendances manquantes +``` + +Le résultat est `fws-kitty---.pkg.tar.zst`. +`makepkg` construit depuis la branche indiquée par `_branch` en haut du +`PKGBUILD` (`main` par défaut). Pour publier une version précise, pointez-la +sur un tag ou un commit : + +```sh +_branch=v0.50.0 +``` + +La police Symbols Nerd Font Mono n'est pas fournie par les dépôts Arch +(`ttf-nerd-fonts-symbols` n'installe que la variante proportionnelle) : le +`PKGBUILD` télécharge la release 3.5.1 de nerd-fonts et place le fichier dans +`fonts/` avant la compilation. + +La cible `linux-package` de kitty reconstruit aussi les pages de manuel et la +documentation HTML : le `PKGBUILD` crée pour cela un environnement Python +isolé dans `prepare()` et installe `docs/requirements.txt` (Sphinx, thème +Furo…), car certaines de ces dépendances ne sont pas dans les dépôts Arch +(`sphinx-design`, `furo` au nom `python-sphinx-furo`). + +## Tester localement + +```sh +sudo pacman -U fws-kitty-*.pkg.tar.zst +kitty --version +kitten --version +``` + +## Publier dans le dépôt pacman + +Un dépôt pacman est un simple dossier HTTP contenant les paquets et une base +`repo-add` : + +```sh +repo-add fws-kitty.db.tar.gz fws-kitty-*.pkg.tar.zst +``` + +Puis, côté client, dans `/etc/pacman.conf` : + +```ini +[fws] +SigLevel = Optional TrustAll +Server = https:///fws/$arch +``` + +Le dossier doit être servi en HTTP/HTTPS statique (nginx, Caddy, GitHub/Gitea +Pages…). Gitea n'a pas de registre pacman natif : le registre « Generic » +fonctionne pour héberger les fichiers, mais pacman a besoin d'URL stables pour +`fws-kitty.db.tar.gz` et les `.pkg.tar.zst`, ce qu'un simple dossier servi par +nginx (ou des assets de release) fournit directement. + +Pour une publication automatique, il suffit d'enchaîner dans la CI : + +```sh +makepkg -f --nodeps # ou -s avec un utilisateur autorisé à pacman +repo-add repo/fws-kitty.db.tar.gz fws-kitty-*.pkg.tar.zst +# puis copier repo/ vers le serveur +``` + +Si le dépôt doit aussi fournir `kitty-terminfo` et l'intégration shell aux +serveurs SSH, ces fichiers peuvent être découpés en paquets séparés : la +documentation de kitty (`docs/build.rst`, section « Notes pour les +empaqueteurs ») décrit la répartition.