# Maintainer edward-p <edward at edward-p dot xyz>
# Contributor: f4iey <f4iey@f4iey.fr>	

pkgname=not1mm-git
pkgver=r3045.73c2702
pkgrel=1
pkgdesc="Not1MM != N1MM, An amateur radio contest logger for Linux."
arch=('any')
license=('GPL-3.0-only')
url="https://github.com/mbridak/not1mm"
makedepends=(git python-build python-installer python-wheel python-setuptools)
depends=(
  python
  python-pyqt6
  python-requests
  python-dicttoxml
  python-xmltodict
  python-pyserial
  python-sounddevice
  python-soundfile
  python-numpy
  python-notctyparser
  python-rapidfuzz
  python-appdata
  python-levenshtein
)
optdepends=(hamlib flrig)
provides=(not1mm)
conflicts=(not1mm)
source=($pkgname::"git+$url.git")
sha256sums=('SKIP')

prepare(){
    git -C "$srcdir/$pkgname" clean -dfx
}

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

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

package() {
  cd $srcdir/$pkgname
  python -m installer --destdir="$pkgdir" dist/*.whl
  # Desktop icon
  install -Dm755 "not1mm/data/k6gte-not1mm.desktop" "$pkgdir/usr/share/applications/k6gte-not1mm.desktop"
  install -Dm755 "not1mm/data/k6gte.not1mm.svg" "$pkgdir/usr/share/pixmaps/k6gte-not1mm.svg"

}
