mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-27 19:28:59 +08:00
[python3] Update to 3.11.4 (#31727)
* [python3] Update to 3.11.3 * Force set PythonForBuild on windows * Set LD_LIBRARY_PATH on unix * Always use vcpkg_find_acquire_program(PYTHON3) on windows * Remove LD_LIBRARY_PATH shenanigans * [vtk] Parse python version from include folder * Fix static builds on windows * Pass --with-build-python on unix * [omniorb] Fix python version in patch * Resurrect rpath patch * [python3] fix usage * [gobject-introspection] don't hardcode python version * Update vcpkg_find_aquire_program(PYTHON3) This is also required for gobject-introspection * [paraview] don't hardcode python version * [vtk-dicom] don't hardcode python version * Update python in vcpkgTools.xml * Fix host arch detection in vcpkg_find_acquire_program(PYTHON3) * [libpq] Don't hardcode python version * [shiva] Don't pass python variables * [vcpkg-get-python-packages] Delete unused file, update hardcoded python version * [python3] update to 3.11.4 * [omniorb] Use PREPEND in vcpkg_add_to_path So that python from vcpkg is picked before system python * libpq quickfix * re-fix libpq * fix vcpkg-get-python-packages * Make windows 7 patch compatible with unix builds * Copy pyd files to bin Also fixes copying files that do not belong to current build tree * Fix static builds * Speculatively fix osx regression * Fix omniorb on unix * [gobject-introspection] fix windows builds * [vtk] Update vendored copy of mpi4py for python 3.11 support * [mdl-sdk] Fix python * [gobject-introspection] fix the fix of a fix... * Update versions * Undo changes in gobject-introspection and vcpkg_find_aquire_program(PYTHON3) --------- Co-authored-by: root <root@DESKTOP-UIPL9V8>
This commit is contained in:
parent
6da00e1160
commit
c6928dfb9e
@ -10,7 +10,7 @@ vcpkg_download_distfile(ARCHIVE
|
||||
|
||||
vcpkg_extract_source_archive(
|
||||
SOURCE_PATH
|
||||
ARCHIVE ${ARCHIVE}
|
||||
ARCHIVE "${ARCHIVE}"
|
||||
PATCHES
|
||||
0001-g-ir-tool-template.in.patch
|
||||
0002-cross-build.patch
|
||||
@ -29,7 +29,7 @@ if(VCPKG_CROSSCOMPILING AND
|
||||
endif()
|
||||
|
||||
vcpkg_configure_meson(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS_DEBUG
|
||||
${OPTIONS_DEBUG}
|
||||
OPTIONS_RELEASE
|
||||
@ -50,8 +50,6 @@ vcpkg_copy_pdbs()
|
||||
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
||||
|
||||
set(GI_TOOLS
|
||||
g-ir-compiler
|
||||
g-ir-generate
|
||||
@ -74,8 +72,13 @@ foreach(script IN LISTS GI_SCRIPTS)
|
||||
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/${script}")
|
||||
endforeach()
|
||||
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
file(GLOB _pyd_lib_files "${CURRENT_PACKAGES_DIR}/lib/gobject-introspection/giscanner/_giscanner.*.lib")
|
||||
file(REMOVE ${_pyd_lib_files})
|
||||
endif()
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/${PORT}")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/man")
|
||||
|
||||
set(VCPKG_POLICY_MISMATCHED_NUMBER_OF_BINARIES enabled) # _giscanner.lib
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
|
||||
|
@ -24,6 +24,6 @@ index 2a9d68556..cffe9014c 100644
|
||||
|
||||
# python headers
|
||||
-cc.check_header('Python.h', dependencies: [python.dependency()], required: true)
|
||||
+libpython_dep = dependency('python-3.10', method : 'pkg-config')
|
||||
+libpython_dep = dependency('python-@0@'.format(python_version), method : 'pkg-config')
|
||||
+cc.check_header('Python.h', dependencies: [libpython_dep], required: true)
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "gobject-introspection",
|
||||
"version": "1.72.0",
|
||||
"port-version": 3,
|
||||
"port-version": 4,
|
||||
"description": "A middleware layer between C libraries (using GObject) and language bindings.",
|
||||
"homepage": "https://gi.readthedocs.io/en/latest/",
|
||||
"license": null,
|
||||
|
@ -32,7 +32,7 @@ function(build_msvc build_type source_path)
|
||||
file(STRINGS "${CURRENT_INSTALLED_DIR}/lib/pkgconfig/openssl.pc" OPENSSL_VERSION REGEX "Version:")
|
||||
string(APPEND config "\$config->{openssl_version} = '${OPENSSL_VERSION}';\n")
|
||||
endif()
|
||||
string(APPEND config "\$config->{python_version} = '3.10';\n")
|
||||
string(APPEND config "\$config->{python_version} = '3.${PYTHON_VERSION_MINOR}';\n")
|
||||
string(APPEND config "\$config->{tcl_version} = '90';\n")
|
||||
file(WRITE "${build_path}/src/tools/msvc/config.pl" "${config}")
|
||||
|
||||
|
@ -20,6 +20,11 @@ vcpkg_extract_source_archive(
|
||||
windows/spin_delay.patch
|
||||
)
|
||||
|
||||
file(GLOB _py3_include_path "${CURRENT_HOST_INSTALLED_DIR}/include/python3*")
|
||||
string(REGEX MATCH "python3\\.([0-9]+)" _python_version_tmp "${_py3_include_path}")
|
||||
set(PYTHON_VERSION_MINOR "${CMAKE_MATCH_1}")
|
||||
vcpkg_replace_string("${SOURCE_PATH}/configure.ac" "python_version=3.REPLACEME" "python_version=3.${PYTHON_VERSION_MINOR}")
|
||||
|
||||
if("client" IN_LIST FEATURES)
|
||||
set(HAS_TOOLS TRUE)
|
||||
else()
|
||||
|
@ -8,7 +8,7 @@ index a35395e..3c1b3e2 100644
|
||||
PGAC_PATH_PYTHON
|
||||
- PGAC_CHECK_PYTHON_EMBED_SETUP
|
||||
+ python_majorversion=3
|
||||
+ python_version=3.10
|
||||
+ python_version=3.REPLACEME
|
||||
+ PKG_CHECK_MODULES(PYTHON_EMBED, python-${python_version}-embed)
|
||||
+ python_includespec="${PYTHON_EMBED_CFLAGS}"
|
||||
+ python_libdir=[$(echo " ${PYTHON_EMBED_LIBS}" | sed -e 's/\( -L[^ ]*\).*/\1/' -e 's/^.* -L//')]
|
||||
|
@ -5,7 +5,7 @@
|
||||
<VcpkgLz4Libs>@CURRENT_INSTALLED_DIR@/debug/lib/lz4d.lib</VcpkgLz4Libs>
|
||||
<VcpkgNlsLibs>@CURRENT_INSTALLED_DIR@/debug/lib/intl.lib;@CURRENT_INSTALLED_DIR@/debug/lib/iconv.lib;@CURRENT_INSTALLED_DIR@/debug/lib/charset.lib</VcpkgNlsLibs>
|
||||
<VcpkgOpensslLibs>@CURRENT_INSTALLED_DIR@/debug/lib/libssl.lib;@CURRENT_INSTALLED_DIR@/debug/lib/libcrypto.lib;crypt32.lib;ws2_32.lib;secur32.lib</VcpkgOpensslLibs>
|
||||
<VcpkgPythonLibs>@CURRENT_INSTALLED_DIR@/debug/lib/python310_d.lib</VcpkgPythonLibs>
|
||||
<VcpkgPythonLibs>@CURRENT_INSTALLED_DIR@/debug/lib/python3@PYTHON_VERSION_MINOR@_d.lib</VcpkgPythonLibs>
|
||||
<VcpkgTcl90Libs>@CURRENT_INSTALLED_DIR@/debug/lib/tcl90g.lib</VcpkgTcl90Libs>
|
||||
<VcpkgTcl90sLibs>@CURRENT_INSTALLED_DIR@/debug/lib/tcl90sg.lib</VcpkgTcl90sLibs>
|
||||
<VcpkgTcl90sxLibs>@CURRENT_INSTALLED_DIR@/debug/lib/tcl90sgx.lib</VcpkgTcl90sxLibs>
|
||||
@ -19,7 +19,7 @@
|
||||
<VcpkgLz4Libs>@CURRENT_INSTALLED_DIR@/lib/lz4.lib</VcpkgLz4Libs>
|
||||
<VcpkgNlsLibs>@CURRENT_INSTALLED_DIR@/lib/intl.lib;@CURRENT_INSTALLED_DIR@/lib/iconv.lib;@CURRENT_INSTALLED_DIR@/lib/charset.lib</VcpkgNlsLibs>
|
||||
<VcpkgOpensslLibs>@CURRENT_INSTALLED_DIR@/lib/libssl.lib;@CURRENT_INSTALLED_DIR@/lib/libcrypto.lib;crypt32.lib;ws2_32.lib;secur32.lib</VcpkgOpensslLibs>
|
||||
<VcpkgPythonLibs>@CURRENT_INSTALLED_DIR@/lib/python310.lib</VcpkgPythonLibs>
|
||||
<VcpkgPythonLibs>@CURRENT_INSTALLED_DIR@/lib/python3@PYTHON_VERSION_MINOR@.lib</VcpkgPythonLibs>
|
||||
<VcpkgTcl90Libs>@CURRENT_INSTALLED_DIR@/lib/tcl90.lib</VcpkgTcl90Libs>
|
||||
<VcpkgTcl90sLibs>@CURRENT_INSTALLED_DIR@/lib/tcl90s.lib</VcpkgTcl90sLibs>
|
||||
<VcpkgTcl90sxLibs>@CURRENT_INSTALLED_DIR@/lib/tcl90sx.lib</VcpkgTcl90sxLibs>
|
||||
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"name": "libpq",
|
||||
"version": "15.3",
|
||||
"port-version": 1,
|
||||
"description": "The official database access API of postgresql",
|
||||
"homepage": "https://www.postgresql.org/",
|
||||
"license": "PostgreSQL",
|
||||
|
11
ports/mdl-sdk/011-fix-python.patch
Normal file
11
ports/mdl-sdk/011-fix-python.patch
Normal file
@ -0,0 +1,11 @@
|
||||
--- a/src/mdl/compiler/compiler_hlsl/gen_hlsl_intrinsics.py
|
||||
+++ b/src/mdl/compiler/compiler_hlsl/gen_hlsl_intrinsics.py
|
||||
@@ -383,7 +383,7 @@ namespace {
|
||||
def get_db_hlsl():
|
||||
global g_db_hlsl
|
||||
if g_db_hlsl is None:
|
||||
- with open(g_templ_name, "rU") as f:
|
||||
+ with open(g_templ_name, "r") as f:
|
||||
g_db_hlsl = db_hlsl(f)
|
||||
return g_db_hlsl
|
||||
|
@ -101,6 +101,7 @@ vcpkg_from_github(
|
||||
008-build-static-llvm.patch
|
||||
009-include-priority-vendored-llvm.patch
|
||||
010-workaround-gcc-bit.patch
|
||||
011-fix-python.patch
|
||||
)
|
||||
|
||||
string(COMPARE NOTEQUAL "${VCPKG_CRT_LINKAGE}" "static" _MVSC_CRT_LINKAGE_OPTION)
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "mdl-sdk",
|
||||
"version": "2021.1.2",
|
||||
"port-version": 1,
|
||||
"port-version": 2,
|
||||
"description": "NVIDIA Material Definition Language SDK",
|
||||
"homepage": "https://github.com/NVIDIA/MDL-SDK",
|
||||
"license": "BSD-3-Clause",
|
||||
|
@ -34,6 +34,13 @@ if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
|
||||
set(ENV{PYTHONPATH} "${CURRENT_HOST_INSTALLED_DIR}/tools/python3/Lib${VCPKG_HOST_PATH_SEPARATOR}${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lib/python${VCPKG_HOST_PATH_SEPARATOR}${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/lib/python")
|
||||
endif()
|
||||
|
||||
if(NOT VCPKG_TARGET_IS_WINDOWS)
|
||||
file(GLOB _py3_include_path "${CURRENT_HOST_INSTALLED_DIR}/include/python3*")
|
||||
string(REGEX MATCH "python3\\.([0-9]+)" _python_version_tmp "${_py3_include_path}")
|
||||
set(PYTHON_VERSION_MINOR "${CMAKE_MATCH_1}")
|
||||
list(APPEND OPTIONS "PYTHON=${CURRENT_HOST_INSTALLED_DIR}/tools/python3/python3.${PYTHON_VERSION_MINOR}")
|
||||
endif()
|
||||
|
||||
vcpkg_find_acquire_program(FLEX)
|
||||
cmake_path(GET FLEX PARENT_PATH FLEX_DIR)
|
||||
vcpkg_add_to_path("${FLEX_DIR}")
|
||||
|
@ -7,7 +7,7 @@ index 1380018..fb321a5 100644
|
||||
PYVERSION := $(shell $(PYTHON) -c 'import sys; sys.stdout.write(".".join(sys.version.split(".")[:2]))')
|
||||
PYPREFIX := $(shell $(PYTHON) -c 'import sys; sys.stdout.write(sys.exec_prefix.replace("\\","/"))')
|
||||
-PYINCDIR := $(shell $(PYTHON) -c 'import sys, distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_inc().replace("\\","/"))')
|
||||
+PYINCDIR := $(includedir)/python3.10
|
||||
+PYINCDIR := $(includedir)/python$(PYVERSION)
|
||||
|
||||
PythonSHAREDLIB_SUFFIX = $(shell $(PYTHON) -c 'import sys, distutils.sysconfig; sys.stdout.write((distutils.sysconfig.get_config_var("SO") or ".so").lstrip("."))')
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "omniorb",
|
||||
"version": "4.3.0",
|
||||
"port-version": 1,
|
||||
"port-version": 2,
|
||||
"description": "omniORB is a robust high performance CORBA ORB for C++",
|
||||
"homepage": "https://omniorb.sourceforge.io/",
|
||||
"license": "LGPL-2.1-or-later",
|
||||
|
@ -76,7 +76,10 @@ file(COPY "${ICET_SOURCE_PATH}/" DESTINATION "${SOURCE_PATH}/ThirdParty/IceT/vtk
|
||||
if("python" IN_LIST FEATURES)
|
||||
set(python_ver "")
|
||||
if(NOT VCPKG_TARGET_IS_WINDOWS)
|
||||
set(python_ver 3.10)
|
||||
file(GLOB _py3_include_path "${CURRENT_HOST_INSTALLED_DIR}/include/python3*")
|
||||
string(REGEX MATCH "python3\\.([0-9]+)" _python_version_tmp ${_py3_include_path})
|
||||
set(PYTHON_VERSION_MINOR "${CMAKE_MATCH_1}")
|
||||
set(python_ver "3.${PYTHON_VERSION_MINOR}")
|
||||
endif()
|
||||
list(APPEND ADDITIONAL_OPTIONS
|
||||
-DPython3_FIND_REGISTRY=NEVER
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "paraview",
|
||||
"version": "5.11.0",
|
||||
"port-version": 2,
|
||||
"port-version": 3,
|
||||
"description": "VTK-based Data Analysis and Visualization Application",
|
||||
"homepage": "https://www.paraview.org/",
|
||||
"license": "BSD-3-Clause",
|
||||
|
@ -26,7 +26,7 @@ diff --git a/PCbuild/pcbuild.proj b/PCbuild/pcbuild.proj
|
||||
index 4d416c589e..ede9868a8f 100644
|
||||
--- a/PCbuild/pcbuild.proj
|
||||
+++ b/PCbuild/pcbuild.proj
|
||||
@@ -49,17 +49,17 @@
|
||||
@@ -60,17 +60,17 @@
|
||||
<!-- python3.dll -->
|
||||
<Projects Include="python3dll.vcxproj" />
|
||||
<!-- py[w].exe -->
|
||||
@ -49,7 +49,7 @@ index 4d416c589e..ede9868a8f 100644
|
||||
+ <!-- _ssl will NOT build _socket as well -->
|
||||
+ <ExtensionModules Include="_socket" Condition="true" />
|
||||
+ <ExternalModules Include="_ssl;_hashlib" Condition="true" />
|
||||
<ExternalModules Include="_tkinter" Condition="$(IncludeTkinter) and $(Platform) != 'ARM' and $(Platform) != 'ARM64'" />
|
||||
<ExternalModules Include="_tkinter" Condition="$(IncludeTkinter)" />
|
||||
<ExtensionModules Include="@(ExternalModules->'%(Identity)')" Condition="$(IncludeExternals)" />
|
||||
<Projects Include="@(ExtensionModules->'%(Identity).vcxproj')" Condition="$(IncludeExtensions)" />
|
||||
--
|
||||
|
@ -9,19 +9,38 @@ builds the pythoncore as a static library instead of a DLL
|
||||
PCbuild/pythoncore.vcxproj | 4 ++--
|
||||
2 files changed, 11 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/Modules/getpath.c b/Modules/getpath.c
|
||||
index d7d3cf081e..34269f0b75 100644
|
||||
--- a/Modules/getpath.c
|
||||
+++ b/Modules/getpath.c
|
||||
@@ -801,10 +801,12 @@ static int
|
||||
library_to_dict(PyObject *dict, const char *key)
|
||||
{
|
||||
#ifdef MS_WINDOWS
|
||||
+#ifdef Py_ENABLE_SHARED
|
||||
extern HMODULE PyWin_DLLhModule;
|
||||
if (PyWin_DLLhModule) {
|
||||
return winmodule_to_dict(dict, key, PyWin_DLLhModule);
|
||||
}
|
||||
+#endif
|
||||
#elif defined(WITH_NEXT_FRAMEWORK)
|
||||
static char modPath[MAXPATHLEN + 1];
|
||||
static int modPathInitialized = -1;
|
||||
diff --git a/PC/pyconfig.h b/PC/pyconfig.h
|
||||
index d7d3cf081e..34269f0b75 100644
|
||||
--- a/PC/pyconfig.h
|
||||
+++ b/PC/pyconfig.h
|
||||
@@ -251,6 +251,7 @@ typedef int pid_t;
|
||||
@@ -251,6 +251,9 @@ typedef int pid_t;
|
||||
|
||||
/* For Windows the Python core is in a DLL by default. Test
|
||||
Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
|
||||
+#ifndef Py_NO_ENABLE_SHARED
|
||||
+#define Py_NO_ENABLE_SHARED
|
||||
+#endif
|
||||
#if !defined(MS_NO_COREDLL) && !defined(Py_NO_ENABLE_SHARED)
|
||||
# define Py_ENABLE_SHARED 1 /* standard symbol for shared library */
|
||||
# define MS_COREDLL /* deprecated old symbol */
|
||||
@@ -276,6 +277,14 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
|
||||
@@ -276,6 +277,15 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
|
||||
# endif /* _DEBUG */
|
||||
# endif /* _MSC_VER */
|
||||
# endif /* Py_BUILD_CORE */
|
||||
@ -30,6 +49,7 @@ index d7d3cf081e..34269f0b75 100644
|
||||
+# pragma comment(lib, "version.lib")
|
||||
+# pragma comment(lib, "shlwapi.lib")
|
||||
+# pragma comment(lib, "ws2_32.lib")
|
||||
+# pragma comment(lib, "bcrypt.lib")
|
||||
+# if Py_WINVER > 0x0601
|
||||
+# pragma comment(lib, "pathcch.lib")
|
||||
+# endif /* Py_WINVER */
|
||||
@ -71,6 +91,49 @@ index 2625d0293d..2f8bdaa931 100644
|
||||
<PreprocessorDefinitions Condition="$(IncludeExternals)">_Py_HAVE_ZLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj
|
||||
index 2625d0293d..2f8bdaa931 100644
|
||||
--- a/PCbuild/_freeze_module.vcxproj
|
||||
+++ b/PCbuild/_freeze_module.vcxproj
|
||||
@@ -88,7 +88,7 @@
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
- <PreprocessorDefinitions>Py_NO_ENABLE_SHARED;Py_BUILD_CORE;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
+ <PreprocessorDefinitions>Py_NO_ENABLE_SHARED;Py_BUILD_CORE;_CONSOLE;MS_DLL_ID="$(SysWinVer)";%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
</ClCompile>
|
||||
diff --git a/Python/dynload_win.c b/Python/dynload_win.c
|
||||
index ac49f7867a..f3583345ff 100644
|
||||
--- a/Python/dynload_win.c
|
||||
+++ b/Python/dynload_win.c
|
||||
@@ -163,6 +163,7 @@ static char *GetPythonImport (HINSTANCE hModule)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
+#ifdef Py_ENABLE_SHARED
|
||||
/* Load python3.dll before loading any extension module that might refer
|
||||
to it. That way, we can be sure that always the python3.dll corresponding
|
||||
to this python DLL is loaded, not a python3.dll that might be on the path
|
||||
@@ -216,6 +217,7 @@ _Py_CheckPython3(void)
|
||||
return hPython3 != NULL;
|
||||
#undef MAXPATHLEN
|
||||
}
|
||||
+#endif /* Py_ENABLE_SHARED */
|
||||
|
||||
dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix,
|
||||
const char *shortname,
|
||||
@@ -224,7 +226,9 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix,
|
||||
dl_funcptr p;
|
||||
char funcname[258], *import_python;
|
||||
|
||||
+#ifdef Py_ENABLE_SHARED
|
||||
_Py_CheckPython3();
|
||||
+#endif /* Py_ENABLE_SHARED */
|
||||
|
||||
#if USE_UNICODE_WCHAR_CACHE
|
||||
const wchar_t *wpathname = _PyUnicode_AsUnicode(pathname);
|
||||
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
|
||||
index ac49f7867a..f3583345ff 100644
|
||||
--- a/Python/sysmodule.c
|
||||
|
@ -13,9 +13,9 @@ diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj
|
||||
index dbe236829a..5f30a35eb3 100644
|
||||
--- a/PCbuild/pythoncore.vcxproj
|
||||
+++ b/PCbuild/pythoncore.vcxproj
|
||||
@@ -507,8 +507,10 @@
|
||||
<ClCompile Include="..\Python\thread.c" />
|
||||
<ClCompile Include="..\Python\traceback.c" />
|
||||
@@ -540,8 +540,10 @@
|
||||
<ClCompile Include="..\Python\deepfreeze\deepfreeze.c" />
|
||||
<!-- END deepfreeze -->
|
||||
</ItemGroup>
|
||||
- <ItemGroup Condition="$(IncludeExternals)">
|
||||
+ <ItemGroup>
|
||||
@ -25,7 +25,7 @@ index dbe236829a..5f30a35eb3 100644
|
||||
<ClCompile Include="$(zlibDir)\adler32.c" />
|
||||
<ClCompile Include="$(zlibDir)\compress.c" />
|
||||
<ClCompile Include="$(zlibDir)\crc32.c" />
|
||||
@@ -556,7 +558,7 @@
|
||||
@@ -593,7 +595,7 @@
|
||||
<Target Name="_WarnAboutToolset" BeforeTargets="PrepareForBuild" Condition="$(PlatformToolset) != 'v140' and $(PlatformToolset) != 'v141' and $(PlatformToolset) != 'v142' and $(PlatformToolset) != 'v143'">
|
||||
<Warning Text="Toolset $(PlatformToolset) is not used for official builds. Your build may have errors or incompatibilities." />
|
||||
</Target>
|
||||
|
@ -97,7 +97,7 @@ index b2d9f5d57d..4efb826a05 100644
|
||||
- <ClCompile>
|
||||
+ <ClCompile Condition="false">
|
||||
<AdditionalIncludeDirectories>$(PySourcePath)Modules\expat;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;HAVE_EXPAT_H;XML_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;XML_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
- <ItemGroup>
|
||||
|
@ -28,30 +28,113 @@ index 25ddc82..ff51042 100644
|
||||
#if defined(MS_WIN32) && !defined(MS_WIN64)
|
||||
#define HANDLE_TO_PYNUM(handle) \
|
||||
PyLong_FromUnsignedLong((unsigned long) handle)
|
||||
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
|
||||
--- a/Modules/posixmodule.c
|
||||
+++ b/Modules/posixmodule.c
|
||||
@@ -20,7 +20,7 @@
|
||||
diff --git a/Modules/getpath.c b/Modules/getpath.c
|
||||
index bc730fc..7d3d559 100644
|
||||
--- a/Modules/getpath.c
|
||||
+++ b/Modules/getpath.c
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
FSCTL_GET_REPARSE_POINT is not exported with WIN32_LEAN_AND_MEAN. */
|
||||
# include <windows.h>
|
||||
#ifdef MS_WINDOWS
|
||||
# include <windows.h> // GetFullPathNameW(), MAX_PATH
|
||||
-# include <pathcch.h>
|
||||
+# include <Shlwapi.h>
|
||||
#endif
|
||||
|
||||
#ifdef __VXWORKS__
|
||||
@@ -4410,6 +4410,10 @@ os__getvolumepathname_impl(PyObject *module, path_t *path)
|
||||
#ifdef __APPLE__
|
||||
@@ -217,6 +217,11 @@ getpath_isfile(PyObject *Py_UNUSED(self), PyObject *args)
|
||||
return r;
|
||||
}
|
||||
|
||||
+#ifdef MS_WINDOWS
|
||||
+static int _PathCchFindExtension_Initialized = 0;
|
||||
+typedef HRESULT (__stdcall *PPathCchFindExtension) (PCWSTR pszPath, size_t cchPath, PCWSTR *ppszExt);
|
||||
+static PPathCchFindExtension _PathCchFindExtension;
|
||||
+#endif
|
||||
|
||||
static PyObject *
|
||||
getpath_isxfile(PyObject *Py_UNUSED(self), PyObject *args)
|
||||
@@ -231,13 +235,51 @@ getpath_isxfile(PyObject *Py_UNUSED(self), PyObject *args)
|
||||
path = PyUnicode_AsWideCharString(pathobj, &cchPath);
|
||||
if (path) {
|
||||
#ifdef MS_WINDOWS
|
||||
+
|
||||
+ if (_PathCchFindExtension_Initialized == 0) {
|
||||
+ HMODULE pathapi = LoadLibraryExW(L"api-ms-win-core-path-l1-1-0.dll", NULL,
|
||||
+ LOAD_LIBRARY_SEARCH_SYSTEM32);
|
||||
+
|
||||
+ if (pathapi) {
|
||||
+ _PathCchFindExtension = (PPathCchFindExtension)GetProcAddress(pathapi, "PathCchFindExtension");
|
||||
+ } else {
|
||||
+ _PathCchFindExtension = NULL;
|
||||
+ }
|
||||
+
|
||||
+ _PathCchFindExtension_Initialized = 1;
|
||||
+ }
|
||||
+
|
||||
const wchar_t *ext;
|
||||
DWORD attr = GetFileAttributesW(path);
|
||||
- r = (attr != INVALID_FILE_ATTRIBUTES) &&
|
||||
- !(attr & FILE_ATTRIBUTE_DIRECTORY) &&
|
||||
- SUCCEEDED(PathCchFindExtension(path, cchPath + 1, &ext)) &&
|
||||
- (CompareStringOrdinal(ext, -1, L".exe", -1, 1 /* ignore case */) == CSTR_EQUAL)
|
||||
- ? Py_True : Py_False;
|
||||
+ if (attr == INVALID_FILE_ATTRIBUTES || (attr & FILE_ATTRIBUTE_DIRECTORY)) {
|
||||
+ r = Py_False;
|
||||
+ }
|
||||
+ else {
|
||||
+ HRESULT hr = S_OK;
|
||||
+ if (_PathCchFindExtension) {
|
||||
+ hr = _PathCchFindExtension(path, cchPath + 1, &ext);
|
||||
+ }
|
||||
+ else {
|
||||
+ if (cchPath > MAX_PATH) {
|
||||
+ hr = E_FAIL;
|
||||
+ }
|
||||
+ else {
|
||||
+ ext = PathFindExtensionW(path);
|
||||
+ if (*ext == '\0')
|
||||
+ hr = E_FAIL;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (!SUCCEEDED(hr)) {
|
||||
+ r = Py_False;
|
||||
+ }
|
||||
+ else if (CompareStringOrdinal(ext, -1, L".exe", -1, 1 /* ignore case */) != CSTR_EQUAL) {
|
||||
+ r = Py_False;
|
||||
+ }
|
||||
+ else {
|
||||
+ r = Py_True;
|
||||
+ }
|
||||
+ }
|
||||
#else
|
||||
struct stat st;
|
||||
r = (_Py_wstat(path, &st) == 0) &&
|
||||
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
|
||||
--- a/Modules/posixmodule.c
|
||||
+++ b/Modules/posixmodule.c
|
||||
@@ -15,7 +15,7 @@
|
||||
// whereas pycore_condvar.h defines the WIN32_LEAN_AND_MEAN macro.
|
||||
#ifdef MS_WINDOWS
|
||||
# include <windows.h>
|
||||
-# include <pathcch.h>
|
||||
+# include <Shlwapi.h>
|
||||
# include <lmcons.h> // UNLEN
|
||||
# include "osdefs.h" // SEP
|
||||
# define HAVE_SYMLINK
|
||||
@@ -4471,6 +4471,11 @@ os__getvolumepathname_impl(PyObject *module, path_t *path)
|
||||
return result;
|
||||
}
|
||||
|
||||
+#ifdef MS_WINDOWS
|
||||
+static int _PathCchSkipRoot_Initialized = 0;
|
||||
+typedef HRESULT (__stdcall *PPathCchSkipRoot) (PCWSTR pszPath, PCWSTR *ppszRootEnd);
|
||||
+static PPathCchSkipRoot _PathCchSkipRoot;
|
||||
+
|
||||
|
||||
+#endif
|
||||
|
||||
/*[clinic input]
|
||||
os._path_splitroot
|
||||
@@ -4428,6 +4432,19 @@ os__path_splitroot_impl(PyObject *module, path_t *path)
|
||||
@@ -4489,6 +4493,19 @@ os__path_splitroot_impl(PyObject *module, path_t *path)
|
||||
PyObject *result = NULL;
|
||||
HRESULT ret;
|
||||
|
||||
@ -71,7 +154,7 @@ diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
|
||||
buffer = (wchar_t*)PyMem_Malloc(sizeof(wchar_t) * (wcslen(path->wide) + 1));
|
||||
if (!buffer) {
|
||||
return NULL;
|
||||
@@ -4438,7 +4455,14 @@ os__path_splitroot_impl(PyObject *module, path_t *path)
|
||||
@@ -4499,7 +4516,14 @@ os__path_splitroot_impl(PyObject *module, path_t *path)
|
||||
}
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
@ -87,99 +170,11 @@ diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
|
||||
Py_END_ALLOW_THREADS
|
||||
if (FAILED(ret)) {
|
||||
result = Py_BuildValue("sO", "", path->object);
|
||||
diff --git a/PC/getpathp.c b/PC/getpathp.c
|
||||
index 53da3a6..3d58bbf 100644
|
||||
--- a/PC/getpathp.c
|
||||
+++ b/PC/getpathp.c
|
||||
@@ -90,7 +90,7 @@
|
||||
#endif
|
||||
|
||||
#include <windows.h>
|
||||
-#include <pathcch.h>
|
||||
+#include <Shlwapi.h>
|
||||
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
@@ -249,14 +249,43 @@ ismodule(wchar_t *filename, int update_filename)
|
||||
stuff as fits will be appended.
|
||||
*/
|
||||
|
||||
+
|
||||
+static int _PathCchCombineEx_Initialized = 0;
|
||||
+typedef HRESULT(__stdcall *PPathCchCombineEx) (PWSTR pszPathOut, size_t cchPathOut,
|
||||
+ PCWSTR pszPathIn, PCWSTR pszMore,
|
||||
+ unsigned long dwFlags);
|
||||
+static PPathCchCombineEx _PathCchCombineEx;
|
||||
+
|
||||
static void
|
||||
join(wchar_t *buffer, const wchar_t *stuff)
|
||||
{
|
||||
- if (FAILED(PathCchCombineEx(buffer, MAXPATHLEN+1, buffer, stuff, 0))) {
|
||||
- Py_FatalError("buffer overflow in getpathp.c's join()");
|
||||
+ if (_PathCchCombineEx_Initialized == 0) {
|
||||
+ HMODULE pathapi = LoadLibraryExW(L"api-ms-win-core-path-l1-1-0.dll", NULL,
|
||||
+ LOAD_LIBRARY_SEARCH_SYSTEM32);
|
||||
+ if (pathapi) {
|
||||
+ _PathCchCombineEx = (PPathCchCombineEx)GetProcAddress(pathapi, "PathCchCombineEx");
|
||||
+ }
|
||||
+ else {
|
||||
+ _PathCchCombineEx = NULL;
|
||||
+ }
|
||||
+ _PathCchCombineEx_Initialized = 1;
|
||||
+ }
|
||||
+ if (_PathCchCombineEx) {
|
||||
+ if (FAILED(_PathCchCombineEx(buffer, MAXPATHLEN+1, buffer, stuff, 0))) {
|
||||
+ Py_FatalError("buffer overflow in getpathp.c's join()");
|
||||
+ }
|
||||
+ } else {
|
||||
+ if (!PathCombineW(buffer, buffer, stuff)) {
|
||||
+ Py_FatalError("buffer overflow in getpathp.c's join()");
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
+static int _PathCchCanonicalizeEx_Initialized = 0;
|
||||
+typedef HRESULT(__stdcall *PPathCchCanonicalizeEx) (PWSTR pszPathOut, size_t cchPathOut,
|
||||
+ PCWSTR pszPathIn, unsigned long dwFlags);
|
||||
+static PPathCchCanonicalizeEx _PathCchCanonicalizeEx;
|
||||
+
|
||||
/* Call PathCchCanonicalizeEx(path): remove navigation elements such as "."
|
||||
and ".." to produce a direct, well-formed path. */
|
||||
static PyStatus
|
||||
@@ -267,8 +296,26 @@ canonicalize(wchar_t *buffer, const wchar_t *path)
|
||||
return _PyStatus_NO_MEMORY();
|
||||
}
|
||||
|
||||
- if (FAILED(PathCchCanonicalizeEx(buffer, MAXPATHLEN + 1, path, 0))) {
|
||||
- return INIT_ERR_BUFFER_OVERFLOW();
|
||||
+ if (_PathCchCanonicalizeEx_Initialized == 0) {
|
||||
+ HMODULE pathapi = LoadLibraryExW(L"api-ms-win-core-path-l1-1-0.dll", NULL,
|
||||
+ LOAD_LIBRARY_SEARCH_SYSTEM32);
|
||||
+ if (pathapi) {
|
||||
+ _PathCchCanonicalizeEx = (PPathCchCanonicalizeEx)GetProcAddress(pathapi, "PathCchCanonicalizeEx");
|
||||
+ }
|
||||
+ else {
|
||||
+ _PathCchCanonicalizeEx = NULL;
|
||||
+ }
|
||||
+ _PathCchCanonicalizeEx_Initialized = 1;
|
||||
+ }
|
||||
+ if (_PathCchCanonicalizeEx) {
|
||||
+ if (FAILED(_PathCchCanonicalizeEx(buffer, MAXPATHLEN + 1, path, 0))) {
|
||||
+ return INIT_ERR_BUFFER_OVERFLOW();
|
||||
+ }
|
||||
+ }
|
||||
+ else {
|
||||
+ if (!PathCanonicalizeW(buffer, path)) {
|
||||
+ return INIT_ERR_BUFFER_OVERFLOW();
|
||||
+ }
|
||||
}
|
||||
return _PyStatus_OK();
|
||||
}
|
||||
diff --git a/PC/pyconfig.h b/PC/pyconfig.h
|
||||
index d7d3cf0..6e9c090 100644
|
||||
--- a/PC/pyconfig.h
|
||||
+++ b/PC/pyconfig.h
|
||||
@@ -136,8 +136,8 @@ WIN32 is still required for the locale module.
|
||||
@@ -130,8 +130,8 @@ WIN32 is still required for the locale module.
|
||||
|
||||
/* set the version macros for the windows headers */
|
||||
/* Python 3.9+ requires Windows 8 or greater */
|
||||
@ -190,6 +185,19 @@ index d7d3cf0..6e9c090 100644
|
||||
|
||||
/* We only set these values when building Python - we don't want to force
|
||||
these values on extensions, as that will affect the prototypes and
|
||||
diff --git a/PCbuild/_freeze_module.vcxproj b/PCbuild/_freeze_module.vcxproj
|
||||
index 442e343..ef0a43e 100644
|
||||
--- a/PCbuild/_freeze_module.vcxproj
|
||||
+++ b/PCbuild/_freeze_module.vcxproj
|
||||
@@ -94,7 +94,7 @@
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
- <AdditionalDependencies>version.lib;ws2_32.lib;pathcch.lib;bcrypt.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
+ <AdditionalDependencies>version.lib;ws2_32.lib;shlwapi.lib;bcrypt.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj
|
||||
index c39ba3e1a9..0ef3a05fb6 100644
|
||||
--- a/PCbuild/pythoncore.vcxproj
|
||||
@ -198,8 +206,121 @@ index c39ba3e1a9..0ef3a05fb6 100644
|
||||
<PreprocessorDefinitions Condition="$(IncludeExternals)">_Py_HAVE_ZLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
- <AdditionalDependencies>version.lib;ws2_32.lib;pathcch.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
+ <AdditionalDependencies>version.lib;ws2_32.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
- <AdditionalDependencies>version.lib;ws2_32.lib;pathcch.lib;bcrypt.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
+ <AdditionalDependencies>version.lib;ws2_32.lib;shlwapi.lib;bcrypt.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
diff --git a/Python/fileutils.c b/Python/fileutils.c
|
||||
index c86ed40..6b1535d 100644
|
||||
--- a/Python/fileutils.c
|
||||
+++ b/Python/fileutils.c
|
||||
@@ -8,7 +8,7 @@
|
||||
#ifdef MS_WINDOWS
|
||||
# include <malloc.h>
|
||||
# include <windows.h>
|
||||
-# include <pathcch.h> // PathCchCombineEx
|
||||
+# include <Shlwapi.h>
|
||||
extern int winerror_to_errno(int);
|
||||
#endif
|
||||
|
||||
@@ -1999,13 +1999,46 @@ _Py_wrealpath(const wchar_t *path,
|
||||
}
|
||||
#endif
|
||||
|
||||
+#ifdef MS_WINDOWS
|
||||
+static int _PathCchSkipRoot_Initialized = 0;
|
||||
+typedef HRESULT (__stdcall *PPathCchSkipRoot) (PCWSTR pszPath, PCWSTR *ppszRootEnd);
|
||||
+static PPathCchSkipRoot _PathCchSkipRoot;
|
||||
+
|
||||
+#ifndef PATHCCH_ALLOW_LONG_PATHS
|
||||
+#define PATHCCH_ALLOW_LONG_PATHS 0x00000001
|
||||
+#endif
|
||||
+#endif
|
||||
|
||||
int
|
||||
_Py_isabs(const wchar_t *path)
|
||||
{
|
||||
#ifdef MS_WINDOWS
|
||||
+ if (_PathCchSkipRoot_Initialized == 0) {
|
||||
+ HMODULE pathapi = LoadLibraryExW(L"api-ms-win-core-path-l1-1-0.dll", NULL,
|
||||
+ LOAD_LIBRARY_SEARCH_SYSTEM32);
|
||||
+
|
||||
+ if (pathapi) {
|
||||
+ _PathCchSkipRoot = (PPathCchSkipRoot)GetProcAddress(pathapi, "PathCchSkipRoot");
|
||||
+ } else {
|
||||
+ _PathCchSkipRoot = NULL;
|
||||
+ }
|
||||
+
|
||||
+ _PathCchSkipRoot_Initialized = 1;
|
||||
+ }
|
||||
+
|
||||
+ HRESULT hr;
|
||||
const wchar_t *tail;
|
||||
- HRESULT hr = PathCchSkipRoot(path, &tail);
|
||||
+ if (_PathCchSkipRoot) {
|
||||
+ hr = _PathCchSkipRoot(path, &tail);
|
||||
+ } else {
|
||||
+ tail = PathSkipRootW(path);
|
||||
+ if (!tail) {
|
||||
+ hr = E_FAIL;
|
||||
+ } else {
|
||||
+ hr = S_OK;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if (FAILED(hr) || path == tail) {
|
||||
return 0;
|
||||
}
|
||||
@@ -2086,6 +2117,11 @@ _Py_abspath(const wchar_t *path, wchar_t **abspath_p)
|
||||
#endif
|
||||
}
|
||||
|
||||
+#ifdef MS_WINDOWS
|
||||
+static int _PathCchCombineEx_Initialized = 0;
|
||||
+typedef HRESULT (__stdcall *PPathCchCombineEx) (PWSTR pszPathOut, size_t cchPathOut, PCWSTR pszPathIn, PCWSTR pszMore, ULONG dwFlags);
|
||||
+static PPathCchCombineEx _PathCchCombineEx;
|
||||
+#endif
|
||||
|
||||
// The caller must ensure "buffer" is big enough.
|
||||
static int
|
||||
@@ -2093,9 +2127,36 @@ join_relfile(wchar_t *buffer, size_t bufsize,
|
||||
const wchar_t *dirname, const wchar_t *relfile)
|
||||
{
|
||||
#ifdef MS_WINDOWS
|
||||
- if (FAILED(PathCchCombineEx(buffer, bufsize, dirname, relfile,
|
||||
- PATHCCH_ALLOW_LONG_PATHS))) {
|
||||
- return -1;
|
||||
+
|
||||
+ if (_PathCchCombineEx_Initialized == 0) {
|
||||
+ HMODULE pathapi = LoadLibraryExW(L"api-ms-win-core-path-l1-1-0.dll", NULL,
|
||||
+ LOAD_LIBRARY_SEARCH_SYSTEM32);
|
||||
+
|
||||
+ if (pathapi) {
|
||||
+ _PathCchCombineEx = (PPathCchCombineEx)GetProcAddress(pathapi, "PathCchCombineEx");
|
||||
+ } else {
|
||||
+ _PathCchCombineEx = NULL;
|
||||
+ }
|
||||
+
|
||||
+ _PathCchCombineEx_Initialized = 1;
|
||||
+ }
|
||||
+
|
||||
+ if (_PathCchCombineEx) {
|
||||
+ if (FAILED(_PathCchCombineEx(buffer, bufsize, dirname, relfile,
|
||||
+ PATHCCH_ALLOW_LONG_PATHS))) {
|
||||
+ return -1;
|
||||
+ }
|
||||
+ }
|
||||
+ else {
|
||||
+ size_t dirlen = wcslen(dirname);
|
||||
+ size_t rellen = wcslen(relfile);
|
||||
+ size_t maxlen = bufsize - 1;
|
||||
+ if (maxlen > MAX_PATH || dirlen >= maxlen || rellen >= maxlen - dirlen) {
|
||||
+ return -1;
|
||||
+ }
|
||||
+ wchar_t * r = PathCombineW(buffer, dirname, relfile);
|
||||
+ if (!r)
|
||||
+ return -1;
|
||||
}
|
||||
#else
|
||||
assert(!_Py_isabs(relfile));
|
||||
|
@ -1,32 +0,0 @@
|
||||
From a45e64a57c58a9fe4984b866e86c7b661da7940d Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com>
|
||||
Date: Mon, 14 Mar 2022 09:09:48 +0100
|
||||
Subject: [PATCH 09/11] bz2d
|
||||
|
||||
fix bz2(d) search on linux (#23525)
|
||||
---
|
||||
setup.py | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/setup.py b/setup.py
|
||||
index 43e807f20..df4d43d3d 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -1741,6 +1741,14 @@ def detect_compress_exts(self):
|
||||
self.add(Extension('_bz2', ['_bz2module.c'],
|
||||
libraries=['bz2'],
|
||||
extra_link_args=bz2_extra_link_args))
|
||||
+ elif (self.compiler.find_library_file(self.lib_dirs, 'bz2d')):
|
||||
+ if MACOS:
|
||||
+ bz2_extra_link_args = ('-Wl,-search_paths_first',)
|
||||
+ else:
|
||||
+ bz2_extra_link_args = ()
|
||||
+ self.add(Extension('_bz2', ['_bz2module.c'],
|
||||
+ libraries=['bz2d'],
|
||||
+ extra_link_args=bz2_extra_link_args))
|
||||
else:
|
||||
self.missing.append('_bz2')
|
||||
|
||||
--
|
||||
2.37.3.windows.1
|
||||
|
@ -4,167 +4,28 @@ Date: Thu, 4 Aug 2022 23:49:06 +0300
|
||||
Subject: [PATCH 10/11] dont skip rpath
|
||||
|
||||
---
|
||||
setup.py | 21 +++++++++++++++++++--
|
||||
1 file changed, 19 insertions(+), 2 deletions(-)
|
||||
configure.ac | 6 ++++++
|
||||
1 file changed, 6 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/setup.py b/setup.py
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 61b3266..4c2cfb4 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -1153,6 +1153,7 @@ def detect_readline_curses(self):
|
||||
self.add(Extension('readline', ['readline.c'],
|
||||
library_dirs=['/usr/lib/termcap'],
|
||||
extra_link_args=readline_extra_link_args,
|
||||
+ runtime_library_dirs=self.lib_dirs,
|
||||
libraries=readline_libs))
|
||||
else:
|
||||
self.missing.append('readline')
|
||||
@@ -1189,6 +1190,7 @@ def detect_readline_curses(self):
|
||||
extra_compile_args=['-DPy_BUILD_CORE_MODULE'],
|
||||
include_dirs=curses_includes,
|
||||
define_macros=curses_defines,
|
||||
+ runtime_library_dirs=self.lib_dirs,
|
||||
libraries=curses_libs))
|
||||
elif curses_library == 'curses' and not MACOS:
|
||||
# OSX has an old Berkeley curses, not good enough for
|
||||
@@ -1203,6 +1205,7 @@ def detect_readline_curses(self):
|
||||
self.add(Extension('_curses', ['_cursesmodule.c'],
|
||||
extra_compile_args=['-DPy_BUILD_CORE_MODULE'],
|
||||
define_macros=curses_defines,
|
||||
+ runtime_library_dirs=self.lib_dirs,
|
||||
libraries=curses_libs))
|
||||
else:
|
||||
curses_enabled = False
|
||||
@@ -1216,6 +1219,7 @@ def detect_readline_curses(self):
|
||||
self.add(Extension('_curses_panel', ['_curses_panel.c'],
|
||||
include_dirs=curses_includes,
|
||||
define_macros=curses_defines,
|
||||
+ runtime_library_dirs=self.lib_dirs,
|
||||
libraries=[panel_library, *curses_libs]))
|
||||
elif not skip_curses_panel:
|
||||
self.missing.append('_curses_panel')
|
||||
@@ -1234,7 +1238,7 @@ def detect_crypt(self):
|
||||
else:
|
||||
libs = []
|
||||
|
||||
- self.add(Extension('_crypt', ['_cryptmodule.c'], libraries=libs))
|
||||
+ self.add(Extension('_crypt', ['_cryptmodule.c'], runtime_library_dirs=self.lib_dirs, libraries=libs))
|
||||
|
||||
def detect_socket(self):
|
||||
# socket(2)
|
||||
@@ -1525,6 +1529,7 @@ class db_found(Exception): pass
|
||||
libraries=dblibs)
|
||||
break
|
||||
if dbmext is not None:
|
||||
+ dbmext.runtime_library_dirs = self.lib_dirs
|
||||
self.add(dbmext)
|
||||
else:
|
||||
self.missing.append('_dbm')
|
||||
@@ -1533,6 +1538,7 @@ class db_found(Exception): pass
|
||||
if ('gdbm' in dbm_order and
|
||||
self.compiler.find_library_file(self.lib_dirs, 'gdbm')):
|
||||
self.add(Extension('_gdbm', ['_gdbmmodule.c'],
|
||||
+ runtime_library_dirs=self.lib_dirs,
|
||||
libraries=['gdbm']))
|
||||
else:
|
||||
self.missing.append('_gdbm')
|
||||
@@ -1645,6 +1651,7 @@ def detect_sqlite(self):
|
||||
define_macros=sqlite_defines,
|
||||
include_dirs=include_dirs,
|
||||
library_dirs=sqlite_libdir,
|
||||
+ runtime_library_dirs=self.lib_dirs,
|
||||
extra_link_args=sqlite_extra_link_args,
|
||||
libraries=["sqlite3",]))
|
||||
else:
|
||||
@@ -1710,6 +1717,7 @@ def detect_compress_exts(self):
|
||||
zlib_extra_link_args = ()
|
||||
self.add(Extension('zlib', ['zlibmodule.c'],
|
||||
libraries=['z'],
|
||||
+ runtime_library_dirs=self.lib_dirs,
|
||||
extra_link_args=zlib_extra_link_args))
|
||||
have_zlib = True
|
||||
else:
|
||||
@@ -1732,6 +1740,7 @@ def detect_compress_exts(self):
|
||||
self.add(Extension('binascii', ['binascii.c'],
|
||||
extra_compile_args=extra_compile_args,
|
||||
libraries=libraries,
|
||||
+ runtime_library_dirs=self.lib_dirs,
|
||||
extra_link_args=extra_link_args))
|
||||
|
||||
# Gustavo Niemeyer's bz2 module.
|
||||
@@ -1742,6 +1751,7 @@ def detect_compress_exts(self):
|
||||
bz2_extra_link_args = ()
|
||||
self.add(Extension('_bz2', ['_bz2module.c'],
|
||||
libraries=['bz2'],
|
||||
+ runtime_library_dirs=self.lib_dirs,
|
||||
extra_link_args=bz2_extra_link_args))
|
||||
elif (self.compiler.find_library_file(self.lib_dirs, 'bz2d')):
|
||||
if MACOS:
|
||||
@@ -1750,6 +1760,7 @@ def detect_compress_exts(self):
|
||||
bz2_extra_link_args = ()
|
||||
self.add(Extension('_bz2', ['_bz2module.c'],
|
||||
libraries=['bz2d'],
|
||||
+ runtime_library_dirs=self.lib_dirs,
|
||||
extra_link_args=bz2_extra_link_args))
|
||||
else:
|
||||
self.missing.append('_bz2')
|
||||
@@ -1757,6 +1768,7 @@ def detect_compress_exts(self):
|
||||
# LZMA compression support.
|
||||
if self.compiler.find_library_file(self.lib_dirs, 'lzma'):
|
||||
self.add(Extension('_lzma', ['_lzmamodule.c'],
|
||||
+ runtime_library_dirs=self.lib_dirs,
|
||||
libraries=['lzma']))
|
||||
else:
|
||||
self.missing.append('_lzma')
|
||||
@@ -1819,6 +1831,7 @@ def detect_expat_elementtree(self):
|
||||
extra_compile_args=extra_compile_args,
|
||||
include_dirs=expat_inc,
|
||||
libraries=expat_lib,
|
||||
+ runtime_library_dirs=self.lib_dirs,
|
||||
sources=['pyexpat.c'] + expat_sources,
|
||||
depends=expat_depends))
|
||||
|
||||
@@ -1831,6 +1844,7 @@ def detect_expat_elementtree(self):
|
||||
define_macros=define_macros,
|
||||
include_dirs=expat_inc,
|
||||
libraries=expat_lib,
|
||||
+ runtime_library_dirs=self.lib_dirs,
|
||||
sources=['_elementtree.c'],
|
||||
depends=['pyexpat.c', *expat_sources,
|
||||
*expat_depends]))
|
||||
@@ -1883,6 +1897,7 @@ def detect_uuid(self):
|
||||
else:
|
||||
uuid_libs = []
|
||||
self.add(Extension('_uuid', ['_uuidmodule.c'],
|
||||
+ runtime_library_dirs=self.lib_dirs,
|
||||
libraries=uuid_libs))
|
||||
else:
|
||||
self.missing.append('_uuid')
|
||||
@@ -2319,6 +2334,7 @@ def detect_ctypes(self):
|
||||
ext.extra_compile_args.append("-DHAVE_FFI_CLOSURE_ALLOC=1")
|
||||
|
||||
ext.include_dirs.append(ffi_inc)
|
||||
+ ext.runtime_library_dirs = self.lib_dirs
|
||||
ext.libraries.append(ffi_lib)
|
||||
self.use_system_libffi = True
|
||||
|
||||
@@ -2485,7 +2501,7 @@ def split_var(name, sep):
|
||||
include_dirs=openssl_includes,
|
||||
library_dirs=openssl_libdirs,
|
||||
libraries=openssl_libs,
|
||||
- runtime_library_dirs=runtime_library_dirs,
|
||||
+ runtime_library_dirs=self.lib_dirs,
|
||||
)
|
||||
|
||||
# This static linking is NOT OFFICIALLY SUPPORTED.
|
||||
@@ -2639,6 +2655,7 @@ def detect_nis(self):
|
||||
self.add(Extension('nis', ['nismodule.c'],
|
||||
libraries=libs,
|
||||
library_dirs=library_dirs,
|
||||
+ runtime_library_dirs=self.lib_dirs,
|
||||
include_dirs=includes_dirs))
|
||||
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -49,6 +49,14 @@ [$1]
|
||||
[RESTORE_ENV]
|
||||
)dnl
|
||||
|
||||
+if test "$ac_sys_system" != "Darwin"; then
|
||||
+AS_VAR_IF([GNULD], [yes], [
|
||||
+ LDFLAGS="-Wl,--enable-new-dtags,-rpath,$vcpkg_rpath"
|
||||
+], [
|
||||
+ LDFLAGS="-Wl,-rpath,$vcpkg_rpath"
|
||||
+])
|
||||
+fi
|
||||
+
|
||||
dnl PY_CHECK_FUNC(FUNCTION, [INCLUDES], [AC_DEFINE-VAR])
|
||||
AC_DEFUN([PY_CHECK_FUNC],
|
||||
[ AS_VAR_PUSHDEF([py_var], [ac_cv_func_$1])
|
||||
--
|
||||
2.37.3.windows.1
|
||||
|
||||
|
@ -11,10 +11,10 @@ diff --git a/Modules/Setup b/Modules/Setup
|
||||
index 87c6a152f8..7ad53f5b4f 100644
|
||||
--- a/Modules/Setup
|
||||
+++ b/Modules/Setup
|
||||
@@ -375,3 +375,7 @@ xxsubtype xxsubtype.c
|
||||
@@ -300,3 +300,7 @@ xxsubtype xxsubtype.c
|
||||
#
|
||||
#_sqlite3 _tkinter _curses pyexpat
|
||||
#_codecs_jp _codecs_kr _codecs_tw unicodedata
|
||||
# _sqlite3 _tkinter _curses pyexpat
|
||||
# _codecs_jp _codecs_kr _codecs_tw unicodedata
|
||||
+
|
||||
+*disabled*
|
||||
+_curses
|
||||
|
@ -1,55 +0,0 @@
|
||||
From f2c5695f17ec59f4badd374daabccf362bbd5f24 Mon Sep 17 00:00:00 2001
|
||||
From: Billy Robert O'Neal III <bion@microsoft.com>
|
||||
Date: Wed, 26 Apr 2023 05:17:22 +0000
|
||||
Subject: [PATCH 13/14] configure no libcrypt
|
||||
|
||||
---
|
||||
configure | 3 +++
|
||||
configure.ac | 3 +++
|
||||
2 files changed, 6 insertions(+)
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index bad619963a..c443360280 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -13239,6 +13239,8 @@ done
|
||||
|
||||
# We search for both crypt and crypt_r as one or the other may be defined
|
||||
# This gets us our -lcrypt in LIBS when required on the target platform.
|
||||
+# Save/restore LIBS to avoid linking libpython with libcrypt.
|
||||
+LIBS_SAVE=$LIBS
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing crypt" >&5
|
||||
$as_echo_n "checking for library containing crypt... " >&6; }
|
||||
if ${ac_cv_search_crypt+:} false; then :
|
||||
@@ -13380,6 +13382,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
|
||||
fi
|
||||
|
||||
+LIBS=$LIBS_SAVE
|
||||
|
||||
for ac_func in clock_gettime
|
||||
do :
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index cc69015b10..a6c72c1014 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -4056,6 +4056,8 @@ AC_CHECK_FUNCS(setpgrp,
|
||||
|
||||
# We search for both crypt and crypt_r as one or the other may be defined
|
||||
# This gets us our -lcrypt in LIBS when required on the target platform.
|
||||
+# Save/restore LIBS to avoid linking libpython with libcrypt.
|
||||
+LIBS_SAVE=$LIBS
|
||||
AC_SEARCH_LIBS(crypt, crypt)
|
||||
AC_SEARCH_LIBS(crypt_r, crypt)
|
||||
|
||||
@@ -4070,6 +4072,7 @@ char *r = crypt_r("", "", &d);
|
||||
[AC_DEFINE(HAVE_CRYPT_R, 1, [Define if you have the crypt_r() function.])],
|
||||
[])
|
||||
)
|
||||
+LIBS=$LIBS_SAVE
|
||||
|
||||
AC_CHECK_FUNCS(clock_gettime, [], [
|
||||
AC_CHECK_LIB(rt, clock_gettime, [
|
||||
--
|
||||
2.25.1
|
||||
|
@ -3,10 +3,10 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic AND VCPKG_CRT_LINKAGE STREQUAL static
|
||||
set(VCPKG_LIBRARY_LINKAGE static)
|
||||
endif()
|
||||
|
||||
set(PYTHON_VERSION_MAJOR 3)
|
||||
set(PYTHON_VERSION_MINOR 10)
|
||||
set(PYTHON_VERSION_PATCH 7)
|
||||
set(PYTHON_VERSION ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.${PYTHON_VERSION_PATCH})
|
||||
string(REGEX MATCH "^([0-9]+)\\.([0-9]+)\\.([0-9]+)" PYTHON_VERSION "${VERSION}")
|
||||
set(PYTHON_VERSION_MAJOR "${CMAKE_MATCH_1}")
|
||||
set(PYTHON_VERSION_MINOR "${CMAKE_MATCH_2}")
|
||||
set(PYTHON_VERSION_PATCH "${CMAKE_MATCH_3}")
|
||||
|
||||
set(PATCHES
|
||||
0001-only-build-required-projects.patch
|
||||
@ -14,10 +14,8 @@ set(PATCHES
|
||||
0004-devendor-external-dependencies.patch
|
||||
0005-dont-copy-vcruntime.patch
|
||||
0008-python.pc.patch
|
||||
0009-bz2d.patch
|
||||
0010-dont-skip-rpath.patch
|
||||
0012-force-disable-curses.patch
|
||||
0013-configure-no-libcrypt.patch # https://github.com/python/cpython/pull/28881
|
||||
0014-fix-get-python-inc-output.patch
|
||||
)
|
||||
|
||||
@ -52,7 +50,7 @@ vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO python/cpython
|
||||
REF v${PYTHON_VERSION}
|
||||
SHA512 88bf6efef632a7dad7306a59b7d5da159947d6675f0d264f1f33aa49a5703b4e4595011de52098eb839cc648994ae143f668507be7209f6bf3fe8ae0ec6a9125
|
||||
SHA512 de64f0d09bf2c08873bb3d99bb95c0b675895ed05f8ac5f7bc071322c051ad537c61ea9df9b65bb67d74c4e5b3ab8a75f83da101b22046ee41ba4f77cf0bc549
|
||||
HEAD_REF master
|
||||
PATCHES ${PATCHES}
|
||||
)
|
||||
@ -78,7 +76,7 @@ function(make_python_pkgconfig)
|
||||
file(WRITE ${out_full_path} "${pkgconfig_file}")
|
||||
endfunction()
|
||||
|
||||
if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP)
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
# Due to the way Python handles C extension modules on Windows, a static python core cannot
|
||||
# load extension modules.
|
||||
if(PYTHON_ALLOW_EXTENSIONS)
|
||||
@ -147,6 +145,10 @@ if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP)
|
||||
vcpkg_add_to_path("${CURRENT_INSTALLED_DIR}/debug/bin")
|
||||
endif()
|
||||
|
||||
vcpkg_find_acquire_program(PYTHON3)
|
||||
get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY)
|
||||
set(ENV{PythonForBuild} "${PYTHON3_DIR}/python.exe") # PythonForBuild is what's used on windows, despite the readme
|
||||
|
||||
vcpkg_install_msbuild(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
PROJECT_SUBPATH "PCbuild/pcbuild.proj"
|
||||
@ -234,10 +236,26 @@ else()
|
||||
list(APPEND OPTIONS "LIBS=-liconv -lintl")
|
||||
endif()
|
||||
|
||||
# The version of the build Python must match the version of the cross compiled host Python.
|
||||
# https://docs.python.org/3/using/configure.html#cross-compiling-options
|
||||
if(VCPKG_CROSSCOMPILING)
|
||||
set(_python_for_build "${CURRENT_HOST_INSTALLED_DIR}/tools/python3/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")
|
||||
list(APPEND OPTIONS "--with-build-python=${_python_for_build}")
|
||||
else()
|
||||
vcpkg_find_acquire_program(PYTHON3)
|
||||
list(APPEND OPTIONS "ac_cv_prog_PYTHON_FOR_REGEN=${PYTHON3}")
|
||||
endif()
|
||||
|
||||
vcpkg_configure_make(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS ${OPTIONS}
|
||||
OPTIONS_DEBUG "--with-pydebug"
|
||||
AUTOCONFIG
|
||||
OPTIONS
|
||||
${OPTIONS}
|
||||
OPTIONS_DEBUG
|
||||
"--with-pydebug"
|
||||
"vcpkg_rpath=${CURRENT_INSTALLED_DIR}/debug/lib"
|
||||
OPTIONS_RELEASE
|
||||
"vcpkg_rpath=${CURRENT_INSTALLED_DIR}/lib"
|
||||
)
|
||||
vcpkg_install_make(ADD_BIN_TO_PATH INSTALL_TARGET altinstall)
|
||||
|
||||
@ -294,6 +312,7 @@ if(VCPKG_TARGET_IS_WINDOWS)
|
||||
else()
|
||||
file(READ "${CMAKE_CURRENT_LIST_DIR}/usage.unix" usage_extra)
|
||||
endif()
|
||||
string(REPLACE "@PYTHON_VERSION_MINOR@" "${PYTHON_VERSION_MINOR}" usage_extra "${usage_extra}")
|
||||
file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" "${usage}\n${usage_extra}")
|
||||
|
||||
function(_generate_finder)
|
||||
@ -313,6 +332,7 @@ _generate_finder(DIRECTORY "pythoninterp" PREFIX "PYTHON" NO_OVERRIDE)
|
||||
if (NOT VCPKG_TARGET_IS_WINDOWS)
|
||||
function(replace_dirs_in_config_file python_config_file)
|
||||
vcpkg_replace_string("${python_config_file}" "${CURRENT_INSTALLED_DIR}" "' + _base + '")
|
||||
vcpkg_replace_string("${python_config_file}" "${CURRENT_HOST_INSTALLED_DIR}" "' + _base + '/../${HOST_TRIPLET}")
|
||||
vcpkg_replace_string("${python_config_file}" "${CURRENT_PACKAGES_DIR}" "' + _base + '")
|
||||
vcpkg_replace_string("${python_config_file}" "${CURRENT_BUILDTREES_DIR}" "not/existing")
|
||||
endfunction()
|
||||
|
@ -1,6 +1,6 @@
|
||||
The package python3 provides a python interpreter that supports virtual environments:
|
||||
|
||||
$ tools/python3/python3.10 -m venv /path/to/venv
|
||||
$ tools/python3/python3.@PYTHON_VERSION_MINOR@ -m venv /path/to/venv
|
||||
$ export VIRTUAL_ENV=/path/to/venv
|
||||
$ export PATH=/path/to/venv/bin:$PATH
|
||||
$ export -n PYTHONHOME
|
||||
|
@ -1,6 +1,6 @@
|
||||
The package python3 provides a python interpreter that supports virtual environments:
|
||||
|
||||
>tools\python3\python3.10 -m venv c:\path\to\venv
|
||||
>tools\python3\python.exe -m venv c:\path\to\venv
|
||||
>set VIRTUAL_ENV=c:\path\to\venv
|
||||
>set PATH=c:\path\to\venv\bin;%PATH%
|
||||
>set PYTHONHOME=
|
||||
|
@ -1,7 +1,6 @@
|
||||
{
|
||||
"name": "python3",
|
||||
"version": "3.10.7",
|
||||
"port-version": 7,
|
||||
"version": "3.11.4",
|
||||
"description": "The Python programming language",
|
||||
"homepage": "https://github.com/python/cpython",
|
||||
"license": "Python-2.0",
|
||||
|
@ -7,18 +7,11 @@ vcpkg_from_github(
|
||||
PATCHES find_python_and_no_copy_dll.patch
|
||||
)
|
||||
|
||||
find_library(PYTHON_RELEASE NAMES python310 PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH)
|
||||
find_library(PYTHON_DEBUG NAMES python310_d python310 PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)
|
||||
include(SelectLibraryConfigurations)
|
||||
select_library_configurations(PYTHON)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
DISABLE_PARALLEL_CONFIGURE
|
||||
OPTIONS
|
||||
-DSHIVA_BUILD_TESTS=OFF
|
||||
"-DPYTHON_LIBRARY=${PYTHON_LIBRARIES}"
|
||||
"-DPYTHON_LIBRARIES=${PYTHON_LIBRARIES}"
|
||||
"-DPYTHON_EXECUTABLE=${CURRENT_INSTALLED_DIR}/tools/python3/python${VCPKG_EXECUTABLE_SUFFIX}"
|
||||
)
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "shiva",
|
||||
"version": "1.0",
|
||||
"port-version": 6,
|
||||
"port-version": 7,
|
||||
"description": "Modern C++ Game Engine",
|
||||
"homepage": "https://github.com/Milerius/shiva",
|
||||
"license": "MIT",
|
||||
|
@ -2,7 +2,6 @@ file(COPY
|
||||
"${CMAKE_CURRENT_LIST_DIR}/vcpkg-port-config.cmake"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/copyright"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/x_vcpkg_get_python_packages.cmake"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/python310._pth"
|
||||
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/x_vcpkg_get_python_packages.cmake")
|
||||
|
@ -1,7 +0,0 @@
|
||||
python310.zip
|
||||
Lib
|
||||
Lib/site-packages
|
||||
.
|
||||
|
||||
# Uncomment to run site.main() automatically
|
||||
#import site
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vcpkg-get-python-packages",
|
||||
"version-date": "2022-06-30",
|
||||
"version-date": "2023-07-28",
|
||||
"documentation": "https://vcpkg.io/en/docs/README.html",
|
||||
"license": "MIT",
|
||||
"supports": "native"
|
||||
|
@ -18,6 +18,10 @@ function(x_vcpkg_get_python_packages)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(arg_PYTHON_VERSION STREQUAL "3")
|
||||
set(PYTHON_VERSION_MINOR 11)
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED arg_OUT_PYTHON_VAR)
|
||||
set(arg_OUT_PYTHON_VAR "PYTHON${arg_PYTHON_VERSION}")
|
||||
endif()
|
||||
@ -32,9 +36,6 @@ function(x_vcpkg_get_python_packages)
|
||||
get_filename_component(python_dir "${arg_PYTHON_EXECUTABLE}" DIRECTORY)
|
||||
set(ENV{PYTHONNOUSERSITE} "1")
|
||||
if("${python_dir}" MATCHES "(${DOWNLOADS}|${CURRENT_HOST_INSTALLED_DIR})" AND CMAKE_HOST_WIN32) # inside vcpkg and windows host.
|
||||
#if(NOT EXISTS "${python_dir}/python310._pth" AND PYTHON_EXECUTABLE MATCHES "python3")
|
||||
# file(COPY "${CURRENT_HOST_INSTALLED_DIR}/share/vcpkg-get-python-packages/python310._pth" DESTINATION "${python_dir}")
|
||||
#endif()
|
||||
if(NOT EXISTS "${python_dir}/easy_install${VCPKG_HOST_EXECUTABLE_SUFFIX}")
|
||||
if(NOT EXISTS "${python_dir}/Scripts/pip${VCPKG_HOST_EXECUTABLE_SUFFIX}")
|
||||
if(arg_PYTHON_VERSION STREQUAL 3)
|
||||
@ -75,7 +76,7 @@ function(x_vcpkg_get_python_packages)
|
||||
set(python_sub_path /Scripts)
|
||||
set(python_venv virtualenv)
|
||||
if(arg_PYTHON_VERSION STREQUAL 3)
|
||||
file(COPY "${python_dir}/python310.zip" DESTINATION "${venv_path}/Scripts")
|
||||
file(COPY "${python_dir}/python3${PYTHON_VERSION_MINOR}.zip" DESTINATION "${venv_path}/Scripts")
|
||||
endif()
|
||||
set(python_venv_options "--app-data" "${venv_path}/data")
|
||||
else()
|
||||
|
@ -21,7 +21,10 @@ endif()
|
||||
|
||||
set(python_ver "")
|
||||
if(NOT VCPKG_TARGET_IS_WINDOWS)
|
||||
set(python_ver 3.10)
|
||||
file(GLOB _py3_include_path "${CURRENT_HOST_INSTALLED_DIR}/include/python3*")
|
||||
string(REGEX MATCH "python3\\.([0-9]+)" _python_version_tmp ${_py3_include_path})
|
||||
set(PYTHON_VERSION_MINOR "${CMAKE_MATCH_1}")
|
||||
set(python_ver "3.${PYTHON_VERSION_MINOR}")
|
||||
endif()
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "vtk-dicom",
|
||||
"version": "0.8.14",
|
||||
"port-version": 1,
|
||||
"port-version": 2,
|
||||
"description": "DICOM for VTK",
|
||||
"homepage": "https://github.com/dgobbi/vtk-dicom",
|
||||
"license": "BSD-3-Clause",
|
||||
|
@ -12,6 +12,20 @@ vcpkg_download_distfile(
|
||||
SHA512 c5ccb1193e4e61cf78b63802f87ffb09349c5566ad8a4d51418133953f7acd6b4a206f8d41a426a9eb9be3cf1fd95242e6402973252d7979e5a9cb5e5e480d78
|
||||
)
|
||||
|
||||
vcpkg_download_distfile(
|
||||
MPI4PY_PATCH_1
|
||||
URLS https://gitlab.kitware.com/vtk/vtk/-/commit/c938d30634a284fad026f6ae25c30bc84cadc07e.diff
|
||||
FILENAME vtk-mpi4py-update-part1-c938d3.diff
|
||||
SHA512 5704c1dd124075bd8f37b0734c5cebd48b470902c74bc23774fd4b69025dbc6bfddf48b7c4511520ed07f03bd666a444d6390569f02a0ab68b5d966ddde3a989
|
||||
)
|
||||
|
||||
vcpkg_download_distfile(
|
||||
MPI4PY_PATCH_2
|
||||
URLS https://gitlab.kitware.com/vtk/vtk/-/commit/53e6ce92ae4591552e7e00344d69803117d56bfe.diff
|
||||
FILENAME vtk-mpi4py-update-part2-53e6ce.diff
|
||||
SHA512 794a25bff6168fda94d920a6837c3a690bd6d79284ec34dcd67666c55de78962cc7b73c0f074ce58ed78198bb149eab6bf59b2822f29cbfa792e2fe667c9327c
|
||||
)
|
||||
|
||||
# =============================================================================
|
||||
# Clone & patch
|
||||
vcpkg_from_github(
|
||||
@ -38,7 +52,9 @@ vcpkg_from_github(
|
||||
vtkioss.patch
|
||||
jsoncpp.patch
|
||||
iotr.patch
|
||||
${STRING_PATCH}
|
||||
"${STRING_PATCH}"
|
||||
"${MPI4PY_PATCH_1}"
|
||||
"${MPI4PY_PATCH_2}"
|
||||
9690.diff
|
||||
missing-include-fixes.patch
|
||||
)
|
||||
@ -130,7 +146,10 @@ endif()
|
||||
if("python" IN_LIST FEATURES)
|
||||
set(python_ver "")
|
||||
if(NOT VCPKG_TARGET_IS_WINDOWS)
|
||||
set(python_ver 3.10)
|
||||
file(GLOB _py3_include_path "${CURRENT_HOST_INSTALLED_DIR}/include/python3*")
|
||||
string(REGEX MATCH "python3\\.([0-9]+)" _python_version_tmp ${_py3_include_path})
|
||||
set(PYTHON_VERSION_MINOR "${CMAKE_MATCH_1}")
|
||||
set(python_ver "3.${PYTHON_VERSION_MINOR}")
|
||||
endif()
|
||||
list(APPEND ADDITIONAL_OPTIONS
|
||||
-DVTK_WRAP_PYTHON=ON
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "vtk",
|
||||
"version-semver": "9.2.0-pv5.11.0",
|
||||
"port-version": 8,
|
||||
"port-version": 9,
|
||||
"description": "Software system for 3D computer graphics, image processing, and visualization",
|
||||
"homepage": "https://github.com/Kitware/VTK",
|
||||
"license": "BSD-3-Clause",
|
||||
|
@ -1,19 +1,20 @@
|
||||
if(CMAKE_HOST_WIN32)
|
||||
set(program_name python)
|
||||
set(program_version 3.10.7)
|
||||
set(program_version 3.11.4)
|
||||
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
|
||||
set(tool_subdirectory "python-${program_version}-x86")
|
||||
set(download_urls "https://www.python.org/ftp/python/${program_version}/python-${program_version}-embed-win32.zip")
|
||||
set(download_filename "python-${program_version}-embed-win32.zip")
|
||||
set(download_sha512 a69445906a909ce5f2554c544fe4251a8ab9c5028b531975b8c78fa8e98295b2bf06e1840f346a3c0edf485a7792c40c9d318bffd36b9c7829ac72b7cf8697bc)
|
||||
set(download_sha512 4cdbb2efdc7764a87edfb7370716c1caf660d38bce37a280ec59b7aecab5672c5798aabe19a8ae395224bea7dfe644bd92656f0bbc44348717981b45a909c024)
|
||||
else()
|
||||
set(tool_subdirectory "python-${program_version}-x64")
|
||||
set(download_urls "https://www.python.org/ftp/python/${program_version}/python-${program_version}-embed-amd64.zip")
|
||||
set(download_filename "python-${program_version}-embed-amd64.zip")
|
||||
set(download_sha512 29b47f8073b54c092a2c8b39b09ab392f757a8c09149e8d2de043907fffb250b5f6801175e16fedb4fae7b6555822acdc57d81d13c2fea95ef0f6ed717f86cb9)
|
||||
set(download_sha512 3f93c2a16764b9ea6343315b70c0c6319aac8edaefbf4e21206fb30eff365e8fe37264a9133bebe12e664ea5d8fd232d587a5603a51fd96e1252a2fc01a2e550)
|
||||
endif()
|
||||
|
||||
set(paths_to_search "${DOWNLOADS}/tools/python/${tool_subdirectory}")
|
||||
vcpkg_list(SET post_install_command "${CMAKE_COMMAND}" -E rm python310._pth)
|
||||
vcpkg_list(SET post_install_command "${CMAKE_COMMAND}" -E rm python311._pth)
|
||||
else()
|
||||
set(program_name python3)
|
||||
set(brew_package_name "python")
|
||||
|
@ -1,18 +1,18 @@
|
||||
<?xml version="1.0"?>
|
||||
<tools version="2">
|
||||
<tool name="python3" os="windows">
|
||||
<version>3.10.7</version>
|
||||
<version>3.11.4</version>
|
||||
<exeRelativePath>python.exe</exeRelativePath>
|
||||
<url>https://www.python.org/ftp/python/3.10.7/python-3.10.7-embed-win32.zip</url>
|
||||
<sha512>a69445906a909ce5f2554c544fe4251a8ab9c5028b531975b8c78fa8e98295b2bf06e1840f346a3c0edf485a7792c40c9d318bffd36b9c7829ac72b7cf8697bc</sha512>
|
||||
<archiveName>python-3.10.7-embed-win32.zip</archiveName>
|
||||
<url>https://www.python.org/ftp/python/3.11.4/python-3.11.4-embed-win32.zip</url>
|
||||
<sha512>4cdbb2efdc7764a87edfb7370716c1caf660d38bce37a280ec59b7aecab5672c5798aabe19a8ae395224bea7dfe644bd92656f0bbc44348717981b45a909c024</sha512>
|
||||
<archiveName>python-3.11.4-embed-win32.zip</archiveName>
|
||||
</tool>
|
||||
<tool name="python3_with_venv" os="windows">
|
||||
<version>3.10.7</version>
|
||||
<version>3.11.4</version>
|
||||
<exeRelativePath>tools\python.exe</exeRelativePath>
|
||||
<url>https://www.nuget.org/api/v2/package/python/3.10.7</url>
|
||||
<sha512>dc763c4f3e9594619173a99740a6b54686c768c240efe316d4d3f8914383bd06420c0802781baf983ea840c49412b8330c1af93f31d2c73eb0ea22a55e71aa13</sha512>
|
||||
<archiveName>python-3.10.7.nupkg.zip</archiveName>
|
||||
<url>https://www.nuget.org/api/v2/package/python/3.11.4</url>
|
||||
<sha512>3f311506440238103a3ed5f2b5c62f8fe5f935e24c7a44bd5aac588c9e0383a2eb7651cb3ee18e5873c2edf5718019c8648955bdedb9efe3101c1041776fc31e</sha512>
|
||||
<archiveName>python-3.11.4.nupkg.zip</archiveName>
|
||||
</tool>
|
||||
<tool name="cmake" os="windows">
|
||||
<version>3.27.1</version>
|
||||
|
@ -2954,7 +2954,7 @@
|
||||
},
|
||||
"gobject-introspection": {
|
||||
"baseline": "1.72.0",
|
||||
"port-version": 3
|
||||
"port-version": 4
|
||||
},
|
||||
"google-cloud-cpp": {
|
||||
"baseline": "2.14.0",
|
||||
@ -4486,7 +4486,7 @@
|
||||
},
|
||||
"libpq": {
|
||||
"baseline": "15.3",
|
||||
"port-version": 0
|
||||
"port-version": 1
|
||||
},
|
||||
"libpqxx": {
|
||||
"baseline": "7.7.4",
|
||||
@ -5266,7 +5266,7 @@
|
||||
},
|
||||
"mdl-sdk": {
|
||||
"baseline": "2021.1.2",
|
||||
"port-version": 1
|
||||
"port-version": 2
|
||||
},
|
||||
"mdns": {
|
||||
"baseline": "1.4.2",
|
||||
@ -5910,7 +5910,7 @@
|
||||
},
|
||||
"omniorb": {
|
||||
"baseline": "4.3.0",
|
||||
"port-version": 1
|
||||
"port-version": 2
|
||||
},
|
||||
"ompl": {
|
||||
"baseline": "1.5.1",
|
||||
@ -6238,7 +6238,7 @@
|
||||
},
|
||||
"paraview": {
|
||||
"baseline": "5.11.0",
|
||||
"port-version": 2
|
||||
"port-version": 3
|
||||
},
|
||||
"parmetis": {
|
||||
"baseline": "2022-07-27",
|
||||
@ -6597,8 +6597,8 @@
|
||||
"port-version": 6
|
||||
},
|
||||
"python3": {
|
||||
"baseline": "3.10.7",
|
||||
"port-version": 7
|
||||
"baseline": "3.11.4",
|
||||
"port-version": 0
|
||||
},
|
||||
"qca": {
|
||||
"baseline": "2.3.5",
|
||||
@ -7562,7 +7562,7 @@
|
||||
},
|
||||
"shiva": {
|
||||
"baseline": "1.0",
|
||||
"port-version": 6
|
||||
"port-version": 7
|
||||
},
|
||||
"shiva-sfml": {
|
||||
"baseline": "1.0",
|
||||
@ -8493,7 +8493,7 @@
|
||||
"port-version": 0
|
||||
},
|
||||
"vcpkg-get-python-packages": {
|
||||
"baseline": "2022-06-30",
|
||||
"baseline": "2023-07-28",
|
||||
"port-version": 0
|
||||
},
|
||||
"vcpkg-gfortran": {
|
||||
@ -8606,11 +8606,11 @@
|
||||
},
|
||||
"vtk": {
|
||||
"baseline": "9.2.0-pv5.11.0",
|
||||
"port-version": 8
|
||||
"port-version": 9
|
||||
},
|
||||
"vtk-dicom": {
|
||||
"baseline": "0.8.14",
|
||||
"port-version": 1
|
||||
"port-version": 2
|
||||
},
|
||||
"vtk-m": {
|
||||
"baseline": "1.9.0",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "097d9982b8667ff8d67107e9de262d3900e59631",
|
||||
"version": "1.72.0",
|
||||
"port-version": 4
|
||||
},
|
||||
{
|
||||
"git-tree": "47ab422de57e980b1294daf095a942d3ea36ae98",
|
||||
"version": "1.72.0",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "a62f65ad38aa981b6ff7474e16f739a3ffbc622b",
|
||||
"version": "15.3",
|
||||
"port-version": 1
|
||||
},
|
||||
{
|
||||
"git-tree": "d5388715a119316e407f15a6612bf05d2292d73d",
|
||||
"version": "15.3",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "04186cc5442b20b27d3a47f901dfd4c7eef16353",
|
||||
"version": "2021.1.2",
|
||||
"port-version": 2
|
||||
},
|
||||
{
|
||||
"git-tree": "7b540090b50df32e1bdcab5953994590e0fb37bd",
|
||||
"version": "2021.1.2",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "cca89d0b204e2a74c3e822ef7f8b4878886239d4",
|
||||
"version": "4.3.0",
|
||||
"port-version": 2
|
||||
},
|
||||
{
|
||||
"git-tree": "a03b9df1f3ad5b4d5de0b3bc278af0ff52d06703",
|
||||
"version": "4.3.0",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "ef783841125e47d511ecc6d0108e7b1ecaef1469",
|
||||
"version": "5.11.0",
|
||||
"port-version": 3
|
||||
},
|
||||
{
|
||||
"git-tree": "1b93a58c420dc6478318aba2958a0334a7759b36",
|
||||
"version": "5.11.0",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "1ed9aa74ea44d2e4457410ad732d165317c6f8aa",
|
||||
"version": "3.11.4",
|
||||
"port-version": 0
|
||||
},
|
||||
{
|
||||
"git-tree": "a0f1ead9323b9521f3c3016469f028be712c0252",
|
||||
"version": "3.10.7",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "f3ad56d6d26b5b6003846ded935d9e5727ed725b",
|
||||
"version": "1.0",
|
||||
"port-version": 7
|
||||
},
|
||||
{
|
||||
"git-tree": "1f99562a0a906db852e4ff3a7caf03ad4c4fbcab",
|
||||
"version": "1.0",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "80e0cf9d38d72126b34eb1ee9b33f936c778a696",
|
||||
"version-date": "2023-07-28",
|
||||
"port-version": 0
|
||||
},
|
||||
{
|
||||
"git-tree": "e65762bfef05a4d380bb171409c48a694fb35435",
|
||||
"version-date": "2022-06-30",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "bbe795fdb0d7be6e03dbe99b4d0670237f088b67",
|
||||
"version": "0.8.14",
|
||||
"port-version": 2
|
||||
},
|
||||
{
|
||||
"git-tree": "96d043efb89eb2522af31366de52c340ca5c5193",
|
||||
"version": "0.8.14",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "a2a544c0f17d33ceb785ecd4b263f6f540562974",
|
||||
"version-semver": "9.2.0-pv5.11.0",
|
||||
"port-version": 9
|
||||
},
|
||||
{
|
||||
"git-tree": "8f707a1fc800b17b84e545a4aa5b9f2c3c28c6d6",
|
||||
"version-semver": "9.2.0-pv5.11.0",
|
||||
|
Loading…
Reference in New Issue
Block a user