# Maintainer: gym603 <gui_yuan_miao@163.com>

_realname=xlwt
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
provides=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
conflicts=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
replaces=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgver=1.3.0
pkgrel=1
pkgdesc="Library to create spreadsheet files compatible with MS Excel 97/2000/XP/2003 XLS files, on any platform (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32')
license=('custom')
url="https://github.com/python-excel/xlwt"
depends=("${MINGW_PACKAGE_PREFIX}-python")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools")
source=(${_realname}-${pkgver}.tar.gz::https://github.com/python-excel/xlwt/archive/${pkgver}.tar.gz)
sha256sums=('1961682C6A3CEDB44E6A96FF6ED099D80AF8DA9A669DBBBC1D1959E8398122D6')

build() {
  cd "${srcdir}/${_realname}-${pkgver}"
  ${MINGW_PREFIX}/bin/python setup.py build
}

package() {
  cd "${srcdir}/${_realname}-${pkgver}"

  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 docs/licenses.rst "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/licenses.rst"
}
