# Maintainer: okrinoggen <okrinoggen@users.noreply.github.com>
pkgname=voxn-git
pkgver=0.3.0.r0.g0000000
pkgrel=1
pkgdesc="Local-first voice and text note-taking suite"
arch=('any')
url="https://github.com/okrinoggen33/voxn"
license=('MIT')
depends=('python' 'python-typer' 'sox' 'fzf' 'sqlite')
makedepends=('git' 'python-build' 'python-hatchling' 'python-installer' 'python-wheel')
optdepends=(
  'faster-whisper: local speech transcription backend'
  'ollama: default local LLM provider'
  'wl-clipboard: copy notes from voxn browse'
  'libnotify: desktop notifications'
  'yt-dlp: ingest video URLs'
  'poppler: ingest PDF files'
)
provides=('voxn')
conflicts=('voxn')
source=('git+https://github.com/okrinoggen33/voxn.git')
sha256sums=('SKIP')

pkgver() {
  cd voxn
  git describe --long --tags --always | sed 's/^v//;s/-/.r/;s/-/./'
}

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

package() {
  cd voxn
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  install -Dm644 man/*.1 -t "$pkgdir/usr/share/man/man1/"
  install -Dm644 systemd/voxn-index.path "$pkgdir/usr/lib/systemd/user/voxn-index.path"
  install -Dm644 packaging/systemd/voxn-index.service "$pkgdir/usr/lib/systemd/user/voxn-index.service"
}
