Files
MINGW-packages/mingw-w64-python-pybase64/PKGBUILD
Biswapriyo Nath 725c2b6577 python-pybase64: Add the upstream patch file
The checksum of the patch file is not static because the commit hash length changes between 7 and 8 chars.
2024-07-18 06:31:13 +00:00

65 lines
2.0 KiB
Bash

# Maintainer: ciciwu <yw@m-labs.hk>
_realname=pybase64
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
pkgver=1.3.2
pkgrel=3
pkgdesc='Fast Base64 encoding/decoding (mingw-w64)'
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://github.com/mayeut/pybase64"
msys2_references=(
'pypi: pybase64'
)
license=('spdx:BSD-2-Clause')
depends=(
"${MINGW_PACKAGE_PREFIX}-python"
)
makedepends=(
"${MINGW_PACKAGE_PREFIX}-python-build"
"${MINGW_PACKAGE_PREFIX}-python-installer"
"${MINGW_PACKAGE_PREFIX}-python-setuptools"
"${MINGW_PACKAGE_PREFIX}-python-wheel"
"${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-cmake"
)
checkdepends=("${MINGW_PACKAGE_PREFIX}-python-pytest")
options=(!strip)
source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz"
"001-fix-build-on-mingw.patch"
"002-fix-constness-issues-related-to-PyArg_ParseTupleAndKeywords.patch")
sha256sums=('32ef993c55821dac9abd767ee4656a5013b2ed8bf1125cabbae7e84d2b991038'
'4b2aa671004a1c1031b603287bbe47fc9e78f59781d2cb2bb14ddf0897cc24aa'
'1475f46ab00a818dfefeb938b82525eeca729084f9b23cde8e9c0df9d65bc77e')
prepare() {
cd ${_realname}-${pkgver}
patch -p1 -i ${srcdir}/001-fix-build-on-mingw.patch
patch -p1 -i ${srcdir}/002-fix-constness-issues-related-to-PyArg_ParseTupleAndKeywords.patch
}
build() {
cd "${srcdir}"
cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}" && cd "python-build-${MSYSTEM}"
CIBUILDWHEEL=1 \
${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation
}
check() {
cd "${srcdir}/python-build-${MSYSTEM}"
"${MINGW_PREFIX}"/bin/python -m pytest
}
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"
}