51 lines
1.7 KiB
Bash
51 lines
1.7 KiB
Bash
# Maintainer: Konstantin Podsvirov <konstantin@podsvirov.su>
|
|
|
|
_realname=hiredis
|
|
pkgbase=mingw-w64-python-${_realname}
|
|
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
|
|
pkgver=3.3.0
|
|
pkgrel=1
|
|
pkgdesc="Python wrapper for hiredis (mingw-w64)"
|
|
arch=('any')
|
|
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
|
|
msys2_references=(
|
|
'purl: pkg:pypi/hiredis'
|
|
)
|
|
url='https://github.com/redis/hiredis-py'
|
|
license=('spdx:MIT')
|
|
depends=("${MINGW_PACKAGE_PREFIX}-python")
|
|
makedepends=("${MINGW_PACKAGE_PREFIX}-python-build"
|
|
"${MINGW_PACKAGE_PREFIX}-python-installer"
|
|
"${MINGW_PACKAGE_PREFIX}-python-setuptools"
|
|
"${MINGW_PACKAGE_PREFIX}-cc")
|
|
checkdepends=("${MINGW_PACKAGE_PREFIX}-python-pytest")
|
|
source=("https://pypi.python.org/packages/source/${_realname:0:1}/${_realname}/${_realname}-${pkgver}.tar.gz"
|
|
'0001-fix-clock_gettime.patch')
|
|
sha256sums=('105596aad9249634361815c574351f1bd50455dc23b537c2940066c4a9dea685'
|
|
'b1c5b2b99367bcaab3c7a6086003a6b21a4b8116678ffca64db87f3e74f35ea2')
|
|
|
|
prepare() {
|
|
cd "${_realname}-${pkgver}/vendor/hiredis"
|
|
patch -p1 -i "${srcdir}"/0001-fix-clock_gettime.patch
|
|
}
|
|
|
|
build() {
|
|
cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}" && cd "python-build-${MSYSTEM}"
|
|
${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation
|
|
}
|
|
|
|
check() {
|
|
cd "${srcdir}/python-build-${MSYSTEM}"
|
|
${MINGW_PREFIX}/bin/python -m pytest || warning "Tests failed"
|
|
}
|
|
|
|
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/python-${_realname}/LICENSE"
|
|
}
|