# Maintainer: Dominykas Svetikas <dominykas@svetikas.lt>
pkgname=tt-build-git
_pkgname=tt-build
pkgver=r5.5df3574
pkgrel=1
pkgdesc='A tool to produce optimized plugin archives for TheoTown.'
arch=('any')
url='https://github.com/JustAnyones/tt-build'
license=('MIT')
depends=('python')
makedepends=('python-build' 'python-installer' 'python-wheel' 'python-setuptools' 'git')
conflicts=('tt-build')
provides=('tt-build')
source=("git+$url.git")
md5sums=('SKIP')

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

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

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