# Maintainer: Evangelos Foutras <foutrelis@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: Allan McRae <allan@archlinux.org>
# Contributor: FJ <joostef@gmail.com>
# Contributor: Sebastien Piccand <sebcactus gmail com>

pkgname=gaupol
pkgver=1.15
pkgrel=3
pkgdesc="Editor for text-based subtitles"
arch=('any')
url="https://otsaloma.io/gaupol/"
license=('GPL')
depends=('python-gobject' 'gtk3' 'gst-plugins-'{base,good,bad,ugly} 'gst-libav'
         'gst-plugin-gtk' 'gspell' 'iso-codes' 'python-charset-normalizer'
         'python-cairo' 'desktop-file-utils' 'hicolor-icon-theme')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
optdepends=('mpv: subtitle preview'
            'vlc: subtitle preview'
            'mplayer: subtitle preview')
source=($pkgname-$pkgver.tar.gz::https://github.com/otsaloma/$pkgname/archive/$pkgver.tar.gz
        fix-prefix-with-pep517.patch)
sha256sums=('4128aa01f2ed3ecbcf12676e99087351251a9f105c14567786b31e77ba9fbfd7'
            '5e4402fd683a24c1b8ddcb9226176d259215263a491265548547d787bd28052d')

prepare() {
  cd $pkgname-$pkgver
  patch -Np1 -i ../fix-prefix-with-pep517.patch
}

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

package() {
  cd $pkgname-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  # remove bundled iso-codes
  rm -r "$pkgdir/usr/share/gaupol/iso-codes"
}

# vim:set ts=2 sw=2 et:
