# SliTaz package receipt.

PACKAGE="tazterm"
VERSION="0.9"
CATEGORY="utilities"
SHORT_DESC="GTK3/VTE terminal with split panes, made for AI agents."
MAINTAINER="pankso@slitaz.org"
LICENSE="BSD"
WEB_SITE="https://github.com/pankso/tazterm"
TARBALL="$PACKAGE-$VERSION.tar.gz"
WGET_URL="https://github.com/pankso/$PACKAGE/archive/refs/tags/$VERSION.tar.gz"
HOST_ARCH="i486 x86_64"

DEPENDS="gtk+3 vte291"
BUILD_DEPENDS="gtk+3-dev vte291-dev pkg-config gettext-tools"

# Rules to configure and make the package.
compile_rules()
{
	make &&
	make DESTDIR=$install PREFIX=/usr install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	mkdir -p $fs
	cp -a $install/* $fs
	chown -R root:root $fs
}

# Unit tests (no display): redaction, paste sanitizer, command parsing.
# Output shown on failure only: a redaction test input reads like a
# make error and would trip cook's log check.
testsuite()
{
	cd $src && make test > test.log 2>&1 || { cat test.log; return 1; }
	echo "$(grep -c '^PASS' test.log) unit tests passed"
}

post_install()
{
	gtk-update-icon-cache -q -t -f "$1/usr/share/icons/hicolor" 2>/dev/null
	true
}
