# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

ISTUTILS_EXT=1
DISTUTILS_OPTIONAL=1
DISTUTILS_SINGLE_IMPL=1
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{10..13} )
inherit autotools distutils-r1

KEYWORDS="~amd64"

git_commit="c7299b4ef37726155a7fcb7ebbdb9786c1e9e81e"
SRC_URI=""https://github.com/TelepathyIM/telepathy-farstream/archive/${git_commit}.tar.gz

DESCRIPTION="Telepathy GLib-based client library that uses Farstream to handle Call channels"
HOMEPAGE="https://telepathy.freedesktop.org/wiki/"

LICENSE="LGPL-2.1"
SLOT="0"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
RESTRICT="test"

DEPEND="
    dev-libs/glib
    net-libs/farstream
	net-libs/telepathy-glib
"

RDEPEND="${DEPEND}"

BDEPEND="
	dev-build/cmake-extras
    dev-build/samurai
    dev-util/intltool
    dev-util/gtk-doc
	virtual/pkgconfig

    ${PYTHON_DEPS}
"
S="${WORKDIR}/${PN}-${git_commit}"

src_prepare() {
    eapply_user

	eautoreconf
}

src_configure() {
    local myconf=(
        --disable-static
        --disable-gtk-doc
        --disable-Werror # Should be enabled again in next release
    )

	econf "${myconf[@]}"
}

src_compile() {
    emake
}