pkgname=better-adb-sync-git
pkgver=r76.2d19f23
pkgrel=4
pkgdesc='Synchronize files between a PC and an Android device using ADB (Android Debug Bridge)'
arch=(any)
url=https://github.com/jb2170/better-adb-sync
license=(Apache-2.0)
depends=(android-tools android-udev python-build python)
makedepends=(git python-installer python-wheel python-setuptools)
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=("$pkgname::git+$url.git")
sha256sums=('SKIP')

pkgver() {
	cd $pkgname
	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}

function prepare() {
	cd $pkgname
	git remote add pick https://github.com/jpstotz/better-adb-sync.git
	git fetch --all
	git cherry-pick 35e23e95d9c220fa5f3c34f02e9650ddec690ae7 --no-commit
}

build() {
	cd $pkgname
	python -m build --wheel --no-isolation
}

package() {
	cd $pkgname
	python -m installer --destdir="$pkgdir" dist/*.whl
}
