# Maintainer: Patrick Northon <northon_patrick3@yahoo.ca>

pkgname=sshpilot
pkgver=5.7.0
pkgrel=1
pkgdesc='SSH connection manager with integrated terminal, tunneling, tabbed interface and scp upload support.'
url='https://github.com/mfat/sshpilot'
license=('GPL-3.0-only')
arch=('any')
# python-keyring is the secret backend the code imports (secret_storage.py);
# python-psutil backs port_utils.py and wol.py; openssh provides the ssh/scp/
# ssh-keygen/ssh-copy-id binaries every connection spawns.
# Dropped: python-matplotlib (never imported) and python-flask/-socketio, which
# went with the old pyxtermjs server -- the terminal now uses an in-process PTY
# bridge.
depends=('python' 'python-gobject' 'python-cairo' 'python-cryptography'
         'python-keyring' 'python-psutil' 'openssh'
         'libsecret' 'libadwaita' 'vte4' 'gtksourceview5' 'sshpass' 'webkitgtk-6.0')
# Meson is the upstream build system: it compiles the Blueprint .blp sources into
# the bundled GResource and installs the launcher, the Python package, the desktop
# entry, the AppStream metainfo, the icon and sshpilot-agent.
makedepends=('meson' 'ninja' 'blueprint-compiler' 'glib2-devel' 'gtk4' 'gettext'
             'desktop-file-utils' 'appstream')
# Built-in protocol plugins shell out to these; all degrade gracefully if absent.
optdepends=('inetutils: Telnet protocol support'
            'mosh: Mosh protocol support'
            'kubectl: Kubernetes protocol support'
            'docker: Docker/Podman protocol support'
            'picocom: Serial console protocol support'
            'python-pykeepass: KeePass (.kdbx) secret backend')
source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz")
sha256sums=('2fd37d10c297bd7ec064bf56f01f335f24d26a488bdf850c8e573e958fef893d')

build() {
	arch-meson "${pkgname}-${pkgver}" build
	meson compile -C build
}

check() {
	# Validates the .desktop entry and the AppStream metainfo.
	meson test -C build --print-errorlogs
}

package() {
	meson install -C build --destdir "${pkgdir}"
}
