This allows us to include a version and we already use PURL for other things, so might as well remove the pypi special case. Normalize the names, since that is required for PURLs.
86 lines
2.9 KiB
Bash
86 lines
2.9 KiB
Bash
# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>
|
|
# Maintainer: Naveen M K <naven@syrusdark.website>
|
|
|
|
_realname=distlib
|
|
pkgbase=mingw-w64-python-${_realname}
|
|
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
|
|
pkgver=0.3.9
|
|
pkgrel=1
|
|
pkgdesc="Low-level components of distutils2/packaging (mingw-w64)"
|
|
arch=('any')
|
|
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
|
|
msys2_references=(
|
|
'purl: pkg:pypi/distlib'
|
|
)
|
|
url="https://github.com/pypa/distlib"
|
|
license=('FSF')
|
|
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")
|
|
source=("https://files.pythonhosted.org/packages/source/${_realname:0:1}/${_realname}/${_realname}-${pkgver}.tar.gz"
|
|
"003-launcher-secure-api-shim.patch")
|
|
sha256sums=('a60f20dea646b8a33f3e7772f74dc0b2d0772d2837ee1342a00645c81edf9403'
|
|
'f90de01cd05cf901e9ac375e5f92727b83cb90ce3847d6ac0a18e504cd3793ca')
|
|
|
|
prepare() {
|
|
cd "${srcdir}"
|
|
rm -rf python-build-${MSYSTEM} | true
|
|
cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}"
|
|
|
|
cd "python-build-${MSYSTEM}"
|
|
patch -Np1 -i "${srcdir}/003-launcher-secure-api-shim.patch"
|
|
}
|
|
|
|
build() {
|
|
cd "${srcdir}/python-build-${MSYSTEM}"
|
|
|
|
rm -f distlib/{w,t}{32,64}{,-arm}.exe
|
|
local _gui_cflags="-DWIN32 -DNDEBUG -D_WINDOWS -mwindows -O2"
|
|
local _cli_cflags="-DWIN32 -DNDEBUG -D_CONSOLE -O2"
|
|
local _gui_lflags="-lshlwapi"
|
|
local _cli_lflags="-lshlwapi"
|
|
if check_option "strip" "y"; then
|
|
_gui_cflags+=" -s"
|
|
_cli_cflags+=" -s"
|
|
fi
|
|
|
|
windres --input PC/launcher.rc --output PC/resources.res --output-format=coff
|
|
|
|
case "${MINGW_CHOST}" in
|
|
i686-w64-mingw32)
|
|
cc $_cli_cflags -o distlib/t32.exe PC/launcher.c PC/resources.res $_cli_lflags
|
|
cc $_gui_cflags -o distlib/w32.exe PC/launcher.c PC/resources.res $_gui_lflags
|
|
;;
|
|
x86_64-w64-mingw32)
|
|
cc $_cli_cflags -o distlib/t64.exe PC/launcher.c PC/resources.res $_cli_lflags
|
|
cc $_gui_cflags -o distlib/w64.exe PC/launcher.c PC/resources.res $_gui_lflags
|
|
;;
|
|
aarch64-w64-mingw32)
|
|
cc $_cli_cflags -o distlib/t64-arm.exe PC/launcher.c PC/resources.res $_cli_lflags
|
|
cc $_gui_cflags -o distlib/w64-arm.exe PC/launcher.c PC/resources.res $_gui_lflags
|
|
;;
|
|
*)
|
|
echo "Unsupported CHOST ${MINGW_CHOST}" && false
|
|
;;
|
|
esac
|
|
|
|
${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation
|
|
}
|
|
|
|
check() {
|
|
msg "Python test for ${MSYSTEM}"
|
|
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.txt "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE"
|
|
}
|