Files
MINGW-packages/mingw-w64-python-comtypes/PKGBUILD
2019-12-17 15:37:56 +03:00

54 lines
1.8 KiB
Bash

# Maintainer: Smo <smo@xpra.org>
_realname=comtypes
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgver=1.1.7
pkgrel=3
pkgdesc="A pure Python, lightweight COM client and server framework, based on the ctypes Python FFI package (mingw-w64)"
arch=('any')
url='https://github.com/enthought/comtypes'
license=('OSI')
depends=("${MINGW_PACKAGE_PREFIX}-python3")
makedepends=("${MINGW_PACKAGE_PREFIX}-python3-setuptools")
options=('staticlibs' 'strip' '!debug')
source=("${_realname}-${pkgver}.tar.gz"::"https://github.com/enthought/comtypes/archive/${pkgver}.tar.gz")
sha512sums=('be83ff1c38306c6ef7994be3fc21f3b533e3d1d26184cf536a38c15cb6435b38ec803d3e3ab08e994444030c022aeab65ec918cc91a2d24c9b25069c0384c0ae')
prepare() {
cd "${srcdir}"
rm -rf python3-build-${CARCH} | true
cp -r "${_realname}-${pkgver}" "python3-build-${CARCH}"
# Set version for setuptools_scm
export SETUPTOOLS_SCM_PRETEND_VERSION=${pkgver}
}
build() {
msg "Python 3 build for ${CARCH}"
cd "${srcdir}/python3-build-${CARCH}"
${MINGW_PREFIX}/bin/python3 setup.py build
}
check() {
msg "Python 3 test for ${CARCH}"
cd "${srcdir}/python3-build-${CARCH}"
${MINGW_PREFIX}/bin/python3 setup.py check
}
package() {
cd "${srcdir}/python3-build-${CARCH}"
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python3 setup.py install --prefix=${MINGW_PREFIX} \
--root="${pkgdir}" --optimize=1 --skip-build
install -Dm644 LICENSE.txt "${pkgdir}${MINGW_PREFIX}/share/licenses/python3-${_realname}/COPYING"
local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX})
# fix python command in files
for _f in "${pkgdir}${MINGW_PREFIX}"/bin/*.py; do
sed -e "s|/usr/bin/env |${MINGW_PREFIX}|g" \
-e "s|${PREFIX_WIN}|${MINGW_PREFIX}|g" -i ${_f}
done
}