# Contributor: knuxify <knuxify@gmail.com>
# Maintainer: knuxify <knuxify@gmail.com>
pkgname=blueman
pkgver=2.4.3
pkgrel=0
pkgdesc="GTK+ Bluetooth Manager"
url="https://github.com/blueman-project/blueman"
arch="all"
license="GPL-3.0-or-later"
depends="bluez dbus gtk+3.0 python3 py3-cairo py3-gobject3"
makedepends="
	autoconf
	automake
	bluez-dev
	cython
	glib-dev
	libtool
	polkit-dev
	python3-dev
	py3-gobject3-dev
	"
checkdepends="networkmanager libpulse-mainloop-glib py3-dbusmock"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang $pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/blueman-project/blueman/archive/refs/tags/$pkgver.tar.gz
	dont-rerun-plugin-tests.patch"

prepare() {
	default_prepare
	autoreconf -vfi

	# remove systemd-resolved test
	rm "$builddir"/test/main/test_dns_server_provider.py
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--disable-schemas-compile
	make
}

check() {
	PYTHONPATH=module/.libs python3 -m unittest
}

package() {
	make DESTDIR="$pkgdir" install

	rm -rf "$pkgdir"/usr/lib/systemd
}

sha512sums="
42c5267a08e4939959ef74c0b6ae28f7d34376f3dabb5ffdc2c4e47fa782e2ce9868e9330a28be245ae65d3c58e50d02445013007dc403916259145c547a33e3  blueman-2.4.3.tar.gz
a3ec5d05c0f32353c1eb933bf1acdcc1f8bede31c12132bd6b30adb46111ef88b7586f9f7c574a95b9dd4877f3977514389e2b565c1029835db920f30a01fb72  dont-rerun-plugin-tests.patch
"
