# Maintainer (AUR):  Caleb Maclennan <caleb@alerque.com>
# Contributor (AUR): Lucki <https://aur.archlinux.org/account/Lucki/>
# Contributor (AUR): Johan Reitan (venatux) <johan.reitan@gmail.com>
# Contributer (AUR): Kenneth Lyons (ixjlyons) <ixjlyons@gmail.com>

pkgname=python-poppler-qt5
pkgver=0.75.0
pkgrel=4
pkgdesc='Python binding to libpoppler-qt5'
arch=('any')
url="https://github.com/frescobaldi/$pkgname"
license=('LGPL')
depends=('python-pyqt5' 'poppler-qt5')
makedepends=('python-sip' 'sip' 'python-setuptools')
source=($pkgname-$pkgver.tar.gz::https://github.com/frescobaldi/$pkgname/archive/v$pkgver.tar.gz)
sha256sums=('92e6bd8f4ce90ba4e3e0c2ada026b643481ba1b109d45e8fdbdaedca8416a995')

build() {
    cd "$pkgname-$pkgver"
    # python setup.py build
    local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
    python setup.py build_ext --pyqt-sip-dir="$site_packages"/PyQt5/bindings/
}

package() {
    cd "$pkgname-$pkgver"
    python setup.py install --prefix=/usr --root="$pkgdir" --optimize 1
}
