python-py2exe: Add missing memimporter module

This commit is contained in:
Biswapriyo Nath 2024-03-21 16:22:49 +00:00
parent 2009bdb6c4
commit cf1e02daa2
2 changed files with 43 additions and 2 deletions

View File

@ -130,3 +130,28 @@
)
interpreters = [run, run_w, resource_dll,
--- a/setup_zipextimporter.py
+++ b/setup_zipextimporter.py
@@ -23,8 +23,8 @@
############################################################################
-python_dll_name = '\"python%d%d.dll\"' % sys.version_info[:2]
-python_dll_name_debug = '\"python%d%d_d.dll\"' % sys.version_info[:2]
+python_dll_name = '\"libpython%d.%d.dll\"' % sys.version_info[:2]
+python_dll_name_debug = '\"libpython%d.%d_d.dll\"' % sys.version_info[:2]
def _is_debug_build():
for ext in machinery.all_suffixes():
@@ -46,11 +46,6 @@
extra_compile_args = []
extra_link_args = []
-extra_compile_args.append("-IC:\\Program Files\\Microsoft SDKs\\Windows\\v7.0\\Include")
-extra_compile_args.append("-IC:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\include")
-extra_compile_args.append("-IC:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.10586.0\\ucrt")
-extra_compile_args.append("/DSTANDALONE")
-
if 0:
# enable this to debug a release build
extra_compile_args.append("/Od")

View File

@ -4,7 +4,7 @@ _realname=py2exe
pkgbase=mingw-w64-python-${_realname}
pkgname=${MINGW_PACKAGE_PREFIX}-python-${_realname}
pkgver=0.13.0.1
pkgrel=1
pkgrel=2
pkgdesc='A distutils extension to create standalone Windows programs from Python code (mingw-w64)'
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
@ -28,7 +28,7 @@ source=(https://github.com/py2exe/${_realname}/archive/v${pkgver}/${_realname}-$
001-setup-fix.patch
002-mingw-fix.patch)
sha256sums=('1d8ea4c79e372ae44833f3fd7f7285a2bf6282f34c902d4d891ff742be789881'
'80f69d375eb0dc33b21f9de9601ca6ee4b5e8c22e088101f96796bc22ecde19a'
'dabe972096c34f5e9ffd0023794807cc665a8870cd6bef6985f9d7197ec4d717'
'3ac8b13f12ca901a07f3ca87b494f5c97ea31192715b6f1fb36563b458462a0f')
prepare() {
@ -38,6 +38,13 @@ prepare() {
}
build() {
# build separate zipextimporter wheel for _memimporter pyd (#20382)
cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}-zipextimporter"
pushd "${srcdir}/python-build-${MSYSTEM}-zipextimporter"
mv setup_zipextimporter.py setup.py
${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation
popd
rm -rf python-build-${MSYSTEM} | true
cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}"
cd "${srcdir}/python-build-${MSYSTEM}"
@ -45,6 +52,15 @@ build() {
}
package() {
cd "${srcdir}/python-build-${MSYSTEM}-zipextimporter"
MSYS2_ARG_CONV_EXCL="--prefix=" \
${MINGW_PREFIX}/bin/python -m installer --prefix=${MINGW_PREFIX} \
--destdir="${pkgdir}" dist/*.whl
local _pythonpath=`python -c "import sysconfig; print(sysconfig.get_path('platlib'))"`
local _site_packages="${pkgdir}$(cygpath ${_pythonpath})"
rm -rf "${_site_packages}"/zipextimporter*
cd "${srcdir}/python-build-${MSYSTEM}"
MSYS2_ARG_CONV_EXCL="--prefix=" \
${MINGW_PREFIX}/bin/python -m installer --prefix=${MINGW_PREFIX} \