# Maintainer: Saul Ibarra Corretge # Contributor: Alexey Pavlov # Contributor: Mehdi Chinoune _realname=sip pkgbase=mingw-w64-${_realname} pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}") pkgver=6.15.1 pkgrel=4 pkgdesc="A tool that makes it easy to create Python bindings for C and C++ libraries (mingw-w64)" arch=('any') mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64') url="https://riverbankcomputing.com/software/sip" msys2_repository_url="https://github.com/Python-SIP/sip" msys2_references=( 'archlinux: sip' 'purl: pkg:pypi/sip' ) license=('spdx:BSD-2-Clause') depends=("${MINGW_PACKAGE_PREFIX}-python" "${MINGW_PACKAGE_PREFIX}-python-packaging" "${MINGW_PACKAGE_PREFIX}-python-setuptools") makedepends=("${MINGW_PACKAGE_PREFIX}-python-build" "${MINGW_PACKAGE_PREFIX}-python-installer" "${MINGW_PACKAGE_PREFIX}-python-setuptools-scm") options=(!strip) source=(https://pypi.python.org/packages/source/s/sip/sip-${pkgver}.tar.gz 001-mingw-python.patch 002-wrappers.patch) sha256sums=('dc2e58c1798a74e1b31c28e837339822fe8fa55288ae30e8986eb28100ebca5a' '01ca8b2d6b312f80113f5fdc129cf11ae6d47d49479eb39a80aeaeec6226c731' 'ba695df87296ad5be7a64d57ce0a8f54db3867a9b69b303b76482f2ac48bb7d6') apply_patch_with_msg() { for _patch in "$@" do msg2 "Applying ${_patch}" patch -Nbp1 -i "${srcdir}/${_patch}" done } prepare() { cd "${srcdir}"/${_realname}-${pkgver} # Apply patches apply_patch_with_msg \ 001-mingw-python.patch \ 002-wrappers.patch cd "${srcdir}" rm -rf python-build-${MSYSTEM} | true cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}" # Set version for setuptools_scm export SETUPTOOLS_SCM_PRETEND_VERSION=${pkgver} } build() { cd python-build-${MSYSTEM} ${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation } package() { cd "${srcdir}"/python-build-${MSYSTEM} MSYS2_ARG_CONV_EXCL="--prefix=" \ ${MINGW_PREFIX}/bin/python -m installer --prefix=${MINGW_PREFIX} \ --destdir="${pkgdir}" dist/*.whl install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE" }