# Maintainer: wh01s17
pkgname=ge150-linux-git
pkgver=0.4.0
pkgrel=1
pkgdesc="Linux editor (GUI and CLI) for the Mooer GE150 multi-effects pedal"
arch=('any')
url="https://github.com/wh01s17/ge150-linux"
license=('MIT')
depends=('python' 'pyside6' 'python-pyusb' 'python-markdown-it-py')
optdepends=('qt6-webengine: TONE3000 catalogue inside the editor'
            'qt6-imageformats: your own gear photos in WebP'
            'python-mcp: AI assistant (Claude Code / Codex)')
makedepends=('git' 'python-build' 'python-installer' 'python-setuptools' 'python-wheel')
provides=('ge150-linux')
conflicts=('ge150-linux')
source=("$pkgname::git+$url.git")
sha256sums=('SKIP')

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

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

package() {
  cd "$pkgname"
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 udev/70-mooer-ge150.rules "$pkgdir/usr/lib/udev/rules.d/70-mooer-ge150.rules"
  install -Dm644 packaging/ge150.desktop "$pkgdir/usr/share/applications/ge150.desktop"
  install -Dm644 packaging/ge150.svg "$pkgdir/usr/share/icons/hicolor/scalable/apps/ge150.svg"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
}
