diff --git a/ports/py-wheel/portfile.cmake b/ports/py-wheel/portfile.cmake index 38e57434..c95dd779 100644 --- a/ports/py-wheel/portfile.cmake +++ b/ports/py-wheel/portfile.cmake @@ -10,8 +10,4 @@ vcpkg_python_build_and_install_wheel(SOURCE_PATH "${SOURCE_PATH}" OPTIONS -x) vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt") -if(NOT VCPKG_TARGET_IS_WINDOWS) - vcpkg_copy_tools(TOOL_NAMES wheel DESTINATION "${CURRENT_PACKAGES_DIR}/tools/python3" AUTO_CLEAN) -endif() - set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) diff --git a/ports/py-wheel/vcpkg.json b/ports/py-wheel/vcpkg.json index dec3c1b5..edf4f808 100644 --- a/ports/py-wheel/vcpkg.json +++ b/ports/py-wheel/vcpkg.json @@ -1,6 +1,7 @@ { "name": "py-wheel", "version": "0.41.3", + "port-version": 1, "description": "The official binary distribution format for Python", "homepage": "https://github.com/pypa/wheel", "license": "MIT", diff --git a/ports/python3/0016-undup-ffi-symbols.patch b/ports/python3/0016-undup-ffi-symbols.patch new file mode 100644 index 00000000..7faec9f9 --- /dev/null +++ b/ports/python3/0016-undup-ffi-symbols.patch @@ -0,0 +1,14 @@ +diff --git a/Modules/_ctypes/malloc_closure.c b/Modules/_ctypes/malloc_closure.c +index 788bae6a9..3938f79db 100644 +--- a/Modules/_ctypes/malloc_closure.c ++++ b/Modules/_ctypes/malloc_closure.c +@@ -11,6 +11,9 @@ + #endif + #include "ctypes.h" + ++#undef Py_ffi_closure_alloc ++#undef Py_ffi_closure_free ++ + /* BLOCKSIZE can be adjusted. Larger blocksize will take a larger memory + overhead, but allocate less blocks from the system. It may be that some + systems have a limit of how many mmap'd blocks can be open. diff --git a/ports/python3/0018-fix-sysconfig-include.patch b/ports/python3/0018-fix-sysconfig-include.patch index 1efdb5a8..b05a35d5 100644 --- a/ports/python3/0018-fix-sysconfig-include.patch +++ b/ports/python3/0018-fix-sysconfig-include.patch @@ -1,15 +1,18 @@ diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py -index ebe371182..e351df7da 100644 +index ebe3711..b127603 100644 --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py -@@ -51,8 +51,8 @@ - 'platstdlib': '{base}/Lib', - 'purelib': '{base}/Lib/site-packages', - 'platlib': '{base}/Lib/site-packages', -- 'include': '{installed_base}/Include', -- 'platinclude': '{installed_base}/Include', -+ 'include': '{installed_base}/../../include/python{py_version_short}{abiflags}', -+ 'platinclude': '{installed_base}/../../include/python{py_version_short}{abiflags}', - 'scripts': '{base}/Scripts', +@@ -30,10 +30,10 @@ + 'purelib': '{base}/lib/python{py_version_short}/site-packages', + 'platlib': '{platbase}/{platlibdir}/python{py_version_short}/site-packages', + 'include': +- '{installed_base}/include/python{py_version_short}{abiflags}', ++ '{installed_base}/../../include/python{py_version_short}{abiflags}', + 'platinclude': +- '{installed_platbase}/include/python{py_version_short}{abiflags}', +- 'scripts': '{base}/bin', ++ '{installed_platbase}/../../include/python{py_version_short}{abiflags}', ++ 'scripts': '{base}/tools/python3', 'data': '{base}', }, + 'posix_home': { diff --git a/ports/python3/portfile.cmake b/ports/python3/portfile.cmake index a018ff02..57b1aef2 100644 --- a/ports/python3/portfile.cmake +++ b/ports/python3/portfile.cmake @@ -33,6 +33,7 @@ set(PATCHES 0012-force-disable-modules.patch 0014-fix-get-python-inc-output.patch 0015-dont-use-WINDOWS-def.patch + 0016-undup-ffi-symbols.patch # Required for lld-link. 0018-fix-sysconfig-include.patch ) @@ -376,4 +377,11 @@ if (NOT VCPKG_TARGET_IS_WINDOWS) endif() endif() -configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-port-config.cmake" "${CURRENT_PACKAGES_DIR}/share/python3/vcpkg-port-config.cmake" @ONLY) \ No newline at end of file +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/python3/Lib/distutils/command/build_ext.py" "'libs'" "'../../lib'") +else() + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/python3.${PYTHON_VERSION_MINOR}/distutils/command/build_ext.py" "'libs'" "'../../lib'") + file(COPY_FILE "${CURRENT_PACKAGES_DIR}/tools/python3/python3.${PYTHON_VERSION_MINOR}" "${CURRENT_PACKAGES_DIR}/tools/python3/python3") +endif() + +configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-port-config.cmake" "${CURRENT_PACKAGES_DIR}/share/python3/vcpkg-port-config.cmake" @ONLY) diff --git a/ports/python3/vcpkg.json b/ports/python3/vcpkg.json index 4f32a58c..98052df7 100644 --- a/ports/python3/vcpkg.json +++ b/ports/python3/vcpkg.json @@ -1,7 +1,7 @@ { "name": "python3", "version": "3.11.5", - "port-version": 3, + "port-version": 4, "description": "The Python programming language", "homepage": "https://github.com/python/cpython", "license": "Python-2.0",