SUMMARY="Free console XMPP client"
DESCRIPTION="Poezio is a free console XMPP client (the protocol on which the \
Jabber IM network is built).

Its goal is to let you connect very easily (no account creation needed) to the \
network and join various chatrooms, immediately. It tries to look like the \
most famous IRC clients (weechat, irssi, etc). Many commands are identical \
and you won't be lost if you already know these clients. Configuration can be \
made in a configuration file or directly from the client.

You'll find the light, fast, geeky and anonymous spirit of IRC while using a \
powerful, standard and open protocol."
HOMEPAGE="https://poez.io"
COPYRIGHT="2010-2020 Florent Le Coz, Mathieu Pasquet"
LICENSE="Zlib"
REVISION="1"
SOURCE_URI="https://pypi.io/packages/source/p/poezio/poezio-$portVersion.tar.gz"
CHECKSUM_SHA256="d12a95e5895d2aae17621f60092b5ca56384922b3637bff0e8a92952c0188e2d"
SOURCE_DIR="poezio-$portVersion"
PATCHES="poezio-$portVersion.patchset"

ARCHITECTURES="all !x86_gcc2 ?x86"
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	poezio$secondaryArchSuffix = $portVersion
	cmd:poezio = $portVersion
	cmd:poezio_logs = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	aiodns_python3
	pyasn1_modules_python3
	pyasn1_python3
	pycares_python3
	slixmpp_python3 >= 1.3.0
	cmd:python3
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	setuptools_python3
	cmd:gcc$secondaryArchSuffix
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	python3 setup.py build
}

INSTALL()
{
	# GENERIC: all python_setuptools-based installs need this
	pythonVersion=$(python3 --version 2>&1 | sed 's/Python //' | head -c3)
	installLocation=$prefix/lib/python$pythonVersion/vendor-packages/
	export PYTHONPATH=$installLocation:$PYTHONPATH
	mkdir -p $installLocation

	$portPackageLinksDir/cmd~python3/bin/python3 setup.py install \
		--root=$prefix --prefix=. --skip-build
}
