# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Pete Alexandrou <pete@ozmartians.com>

pkgname=vidcutter
pkgver=6.0.5.3
pkgrel=4
pkgdesc='Modern, simple to use, constantly evolving and hella fast media cutter + joiner with frame-accurate SmartCut technology'
arch=('x86_64')
url='https://github.com/ozmartian/vidcutter'
license=('GPL3')
depends=('ffmpeg' 'mediainfo' 'mpv' 'python-opengl' 'python-pyqt5' 'python-simplejson')
makedepends=('cython' 'python-build' 'python-installer' 'python-setuptools' 'python-wheel')
source=("https://github.com/ozmartian/$pkgname/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha256sums=('d613eb5e20b4606b416ae21968717027b527939d1aaf591f1044c9efe9552b87')

prepare() {
  cd $pkgname-$pkgver

  # Fix build
  sed -i 's/ or isinstance(obj, long)//' vidcutter/libs/pympv/mpv.pyx

  # remove mpv.c so it gets regenerated by current cython
  rm vidcutter/libs/pympv/mpv.c
}

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

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