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

pkgname=sshpilot
pkgver=5.5.7
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')
depends=('python' 'python-gobject' 'python-cairo' 'python-cryptography' 'python-matplotlib'
         'libsecret' 'libadwaita' 'vte4' 'gtksourceview5' 'sshpass' 'webkitgtk-6.0'
         'python-flask' 'python-flask-socketio')
# 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=('103f974bffda9eee035cb4986126cb5d06b01f55e8975c4cd114293187f692c4')

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}"
}
