54 lines
1.8 KiB
Bash
54 lines
1.8 KiB
Bash
# Maintainer: Alexey Pavlov <alexpux@gmail.com>
|
|
|
|
_realname=cffi
|
|
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.17.1
|
|
pkgrel=2
|
|
pkgdesc="Foreign Function Interface for Python calling C code (mingw-w64)"
|
|
url='https://cffi.readthedocs.io/'
|
|
license=('MIT')
|
|
arch=('any')
|
|
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
|
|
msys2_references=(
|
|
'pypi: cffi'
|
|
)
|
|
depends=("${MINGW_PACKAGE_PREFIX}-libffi"
|
|
"${MINGW_PACKAGE_PREFIX}-python-pycparser")
|
|
makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools" "${MINGW_PACKAGE_PREFIX}-cc")
|
|
source=("https://pypi.org/packages/source/${_realname:0:1}/${_realname}/${_realname}-${pkgver}.tar.gz"
|
|
"mingw-non-x86.patch")
|
|
sha256sums=('1c39c6016c32bc48dd54561950ebd6836e1670f2ae46128f67cf49e789c52824'
|
|
'c8a8ea2d65932ea0b62eae56dbc8afd6baacaadc7cb284ca0e4edf7ed1460c52')
|
|
|
|
prepare() {
|
|
cd "${srcdir}"
|
|
cp -r "${_realname}-${pkgver}" "python-build-${CARCH}"
|
|
cd "python-build-${CARCH}"
|
|
patch -Np1 -i "${srcdir}"/mingw-non-x86.patch
|
|
}
|
|
|
|
build() {
|
|
cd "${srcdir}/python-build-${CARCH}"
|
|
|
|
# work around gcc errors
|
|
if [[ "${CC}" == "gcc" ]]; then
|
|
CFLAGS+=" -Wno-error=incompatible-pointer-types"
|
|
CXXFLAGS+=" -Wno-error=incompatible-pointer-types"
|
|
fi
|
|
|
|
${MINGW_PREFIX}/bin/python setup.py build
|
|
}
|
|
|
|
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}" --skip-build
|
|
|
|
install -D -m644 LICENSE "${pkgdir}${MINGW_PREFIX}"/share/licenses/python-${_realname}/LICENSE
|
|
}
|