# Maintainer: Konstantin Podsvirov <konstantin@podsvirov.pro>

_realname=blinker
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
pkgver=1.4
pkgrel=1
pkgdesc='Fast, simple object-to-object and broadcast signaling (mingw-w64)'
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32')
url='https://pythonhosted.org/blinker/'
license=('MIT')
depends=("${MINGW_PACKAGE_PREFIX}-python")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools")
checkdepends=("${MINGW_PACKAGE_PREFIX}-python-nose")
source=("blinker-rel-${pkgver}.tar.gz"::"https://github.com/jek/blinker/archive/rel-${pkgver}.tar.gz")
sha256sums=('ee9d6d52cbb93a8f9fe40205f7e0bd33af90458e27214ffcd35415d1a940c36b')

prepare() {
  cd "${srcdir}"
  rm -rf "python-build-${CARCH}" | true
  cp -r "blinker-rel-${pkgver}" "python-build-${CARCH}"
}

build() {
  msg "Python build for ${CARCH}"
  cd "${srcdir}/python-build-${CARCH}"
  ${MINGW_PREFIX}/bin/python setup.py build
}

check() {
  cd "${srcdir}/python-build-${CARCH}"
  PYTHONPATH="${srcdir}/python-build-${CARCH}/build/lib:${PYTHONPATH}" \
    ${MINGW_PREFIX}/bin/nosetests
}

package() {
  cd "${srcdir}/python-build-${CARCH}"
  MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
    ${MINGW_PREFIX}/bin/python setup.py install --prefix=${MINGW_PREFIX} --root="${pkgdir}" -O1 --skip-build
  install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE"
}

# vim: ts=2 sw=2 et:
