From 0445fd0a1e8a1f8ae6efb163bd6d8315cd50f1ef Mon Sep 17 00:00:00 2001 From: Osyotr Date: Tue, 30 May 2023 02:42:26 +0300 Subject: [PATCH 01/36] [python3] Update to 3.11.3 --- .../0001-only-build-required-projects.patch | 4 +- ports/python3/0003-use-vcpkg-zlib.patch | 8 +- .../0004-devendor-external-dependencies.patch | 2 +- .../0006-restore-support-for-windows-7.patch | 313 ++++++++++++------ ports/python3/0009-bz2d.patch | 32 -- ports/python3/0010-dont-skip-rpath.patch | 170 ---------- ports/python3/0012-force-disable-curses.patch | 6 +- .../python3/0013-configure-no-libcrypt.patch | 55 --- ports/python3/portfile.cmake | 13 +- ports/python3/vcpkg.json | 3 +- 10 files changed, 230 insertions(+), 376 deletions(-) delete mode 100644 ports/python3/0009-bz2d.patch delete mode 100644 ports/python3/0010-dont-skip-rpath.patch delete mode 100644 ports/python3/0013-configure-no-libcrypt.patch diff --git a/ports/python3/0001-only-build-required-projects.patch b/ports/python3/0001-only-build-required-projects.patch index 952f8daebeb423..1c9f047d4b209d 100644 --- a/ports/python3/0001-only-build-required-projects.patch +++ b/ports/python3/0001-only-build-required-projects.patch @@ -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 @@ @@ -49,7 +49,7 @@ index 4d416c589e..ede9868a8f 100644 + + + - + -- diff --git a/ports/python3/0003-use-vcpkg-zlib.patch b/ports/python3/0003-use-vcpkg-zlib.patch index 2f619949a223c1..af0b4fa806c948 100644 --- a/ports/python3/0003-use-vcpkg-zlib.patch +++ b/ports/python3/0003-use-vcpkg-zlib.patch @@ -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 @@ - - +@@ -540,8 +540,10 @@ + + - + @@ -25,7 +25,7 @@ index dbe236829a..5f30a35eb3 100644 -@@ -556,7 +558,7 @@ +@@ -593,7 +595,7 @@ diff --git a/ports/python3/0004-devendor-external-dependencies.patch b/ports/python3/0004-devendor-external-dependencies.patch index 25e3a1489a8fa5..ad31c1eea7bd92 100644 --- a/ports/python3/0004-devendor-external-dependencies.patch +++ b/ports/python3/0004-devendor-external-dependencies.patch @@ -97,7 +97,7 @@ index b2d9f5d57d..4efb826a05 100644 - + $(PySourcePath)Modules\expat;%(AdditionalIncludeDirectories) - _CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;HAVE_EXPAT_H;XML_STATIC;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;PYEXPAT_EXPORTS;XML_STATIC;%(PreprocessorDefinitions) - diff --git a/ports/python3/0006-restore-support-for-windows-7.patch b/ports/python3/0006-restore-support-for-windows-7.patch index cf8ed0a023c88b..24dc97cf4d4d30 100644 --- a/ports/python3/0006-restore-support-for-windows-7.patch +++ b/ports/python3/0006-restore-support-for-windows-7.patch @@ -28,19 +28,100 @@ 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/getpath.c b/Modules/getpath.c +index bc730fc..7d3d559 100644 +--- a/Modules/getpath.c ++++ b/Modules/getpath.c +@@ -11,7 +11,7 @@ + + #ifdef MS_WINDOWS + # include // GetFullPathNameW(), MAX_PATH +-# include ++# include + #endif + + #ifdef __APPLE__ +@@ -217,6 +217,10 @@ getpath_isfile(PyObject *Py_UNUSED(self), PyObject *args) + return r; + } + ++static int _PathCchFindExtension_Initialized = 0; ++typedef HRESULT (__stdcall *PPathCchFindExtension) (PCWSTR pszPath, size_t cchPath, PCWSTR *ppszExt); ++static PPathCchFindExtension _PathCchFindExtension; ++ + + 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 -@@ -20,7 +20,7 @@ - - FSCTL_GET_REPARSE_POINT is not exported with WIN32_LEAN_AND_MEAN. */ +@@ -15,7 +15,7 @@ + // whereas pycore_condvar.h defines the WIN32_LEAN_AND_MEAN macro. + #ifdef MS_WINDOWS # include -# include +# include - #endif - - #ifdef __VXWORKS__ -@@ -4410,6 +4410,10 @@ os__getvolumepathname_impl(PyObject *module, path_t *path) + # include // UNLEN + # include "osdefs.h" // SEP + # define HAVE_SYMLINK +@@ -4471,6 +4471,10 @@ os__getvolumepathname_impl(PyObject *module, path_t *path) return result; } @@ -51,7 +132,7 @@ diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c /*[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 +152,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,119 +168,153 @@ 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 +diff --git a/PC/pyconfig.h b/PC/pyconfig.h +index d7d3cf0..6e9c090 100644 +--- a/PC/pyconfig.h ++++ b/PC/pyconfig.h +@@ -130,8 +130,8 @@ WIN32 is still required for the locale module. - #include --#include -+#include + /* set the version macros for the windows headers */ + /* Python 3.9+ requires Windows 8 or greater */ +-#define Py_WINVER 0x0602 /* _WIN32_WINNT_WIN8 */ +-#define Py_NTDDI NTDDI_WIN8 ++#define Py_WINVER 0x0601 /* _WIN32_WINNT_WIN7 */ ++#define Py_NTDDI NTDDI_WIN7 - #ifdef HAVE_SYS_TYPES_H - #include -@@ -249,14 +249,43 @@ ismodule(wchar_t *filename, int update_filename) - stuff as fits will be appended. - */ + /* 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 @@ + + + Console +- version.lib;ws2_32.lib;pathcch.lib;bcrypt.lib;%(AdditionalDependencies) ++ version.lib;ws2_32.lib;shlwapi.lib;bcrypt.lib;%(AdditionalDependencies) + Default + + +diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj +index c39ba3e1a9..0ef3a05fb6 100644 +--- a/PCbuild/pythoncore.vcxproj ++++ b/PCbuild/pythoncore.vcxproj +@@ -106,7 +106,7 @@ + _Py_HAVE_ZLIB;%(PreprocessorDefinitions) + + +- version.lib;ws2_32.lib;pathcch.lib;bcrypt.lib;%(AdditionalDependencies) ++ version.lib;ws2_32.lib;shlwapi.lib;bcrypt.lib;%(AdditionalDependencies) + + + +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 + # include +-# include // PathCchCombineEx ++# include + extern int winerror_to_errno(int); + #endif +@@ -1999,13 +1999,44 @@ _Py_wrealpath(const wchar_t *path, + } + #endif + ++static int _PathCchSkipRoot_Initialized = 0; ++typedef HRESULT (__stdcall *PPathCchSkipRoot) (PCWSTR pszPath, PCWSTR *ppszRootEnd); ++static PPathCchSkipRoot _PathCchSkipRoot; + -+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) ++#ifndef PATHCCH_ALLOW_LONG_PATHS ++#define PATHCCH_ALLOW_LONG_PATHS 0x00000001 ++#endif + + int + _Py_isabs(const wchar_t *path) { -- if (FAILED(PathCchCombineEx(buffer, MAXPATHLEN+1, buffer, stuff, 0))) { -- Py_FatalError("buffer overflow in getpathp.c's join()"); -+ if (_PathCchCombineEx_Initialized == 0) { + #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) { -+ _PathCchCombineEx = (PPathCchCombineEx)GetProcAddress(pathapi, "PathCchCombineEx"); -+ } -+ else { -+ _PathCchCombineEx = NULL; ++ _PathCchSkipRoot = (PPathCchSkipRoot)GetProcAddress(pathapi, "PathCchSkipRoot"); ++ } else { ++ _PathCchSkipRoot = NULL; + } -+ _PathCchCombineEx_Initialized = 1; ++ ++ _PathCchSkipRoot_Initialized = 1; + } -+ if (_PathCchCombineEx) { -+ if (FAILED(_PathCchCombineEx(buffer, MAXPATHLEN+1, buffer, stuff, 0))) { -+ Py_FatalError("buffer overflow in getpathp.c's join()"); -+ } ++ ++ HRESULT hr; + const wchar_t *tail; +- HRESULT hr = PathCchSkipRoot(path, &tail); ++ if (_PathCchSkipRoot) { ++ hr = _PathCchSkipRoot(path, &tail); + } else { -+ if (!PathCombineW(buffer, buffer, stuff)) { -+ Py_FatalError("buffer overflow in getpathp.c's join()"); ++ tail = PathSkipRootW(path); ++ if (!tail) { ++ hr = E_FAIL; ++ } else { ++ hr = S_OK; + } ++ } ++ + if (FAILED(hr) || path == tail) { + return 0; } +@@ -2086,6 +2117,9 @@ _Py_abspath(const wchar_t *path, wchar_t **abspath_p) + #endif } -+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(); - } ++static int _PathCchCombineEx_Initialized = 0; ++typedef HRESULT (__stdcall *PPathCchCombineEx) (PWSTR pszPathOut, size_t cchPathOut, PCWSTR pszPathIn, PCWSTR pszMore, ULONG dwFlags); ++static PPathCchCombineEx _PathCchCombineEx; -- if (FAILED(PathCchCanonicalizeEx(buffer, MAXPATHLEN + 1, path, 0))) { -- return INIT_ERR_BUFFER_OVERFLOW(); -+ if (_PathCchCanonicalizeEx_Initialized == 0) { + // 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) { -+ _PathCchCanonicalizeEx = (PPathCchCanonicalizeEx)GetProcAddress(pathapi, "PathCchCanonicalizeEx"); -+ } -+ else { -+ _PathCchCanonicalizeEx = NULL; ++ _PathCchCombineEx = (PPathCchCombineEx)GetProcAddress(pathapi, "PathCchCombineEx"); ++ } else { ++ _PathCchCombineEx = NULL; + } -+ _PathCchCanonicalizeEx_Initialized = 1; ++ ++ _PathCchCombineEx_Initialized = 1; + } -+ if (_PathCchCanonicalizeEx) { -+ if (FAILED(_PathCchCanonicalizeEx(buffer, MAXPATHLEN + 1, path, 0))) { -+ return INIT_ERR_BUFFER_OVERFLOW(); ++ ++ if (_PathCchCombineEx) { ++ if (FAILED(_PathCchCombineEx(buffer, bufsize, dirname, relfile, ++ PATHCCH_ALLOW_LONG_PATHS))) { ++ return -1; + } + } + else { -+ if (!PathCanonicalizeW(buffer, path)) { -+ return INIT_ERR_BUFFER_OVERFLOW(); ++ 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; } - 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. - - /* set the version macros for the windows headers */ - /* Python 3.9+ requires Windows 8 or greater */ --#define Py_WINVER 0x0602 /* _WIN32_WINNT_WIN8 */ --#define Py_NTDDI NTDDI_WIN8 -+#define Py_WINVER 0x0601 /* _WIN32_WINNT_WIN7 */ -+#define Py_NTDDI NTDDI_WIN7 - - /* 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/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj -index c39ba3e1a9..0ef3a05fb6 100644 ---- a/PCbuild/pythoncore.vcxproj -+++ b/PCbuild/pythoncore.vcxproj -@@ -106,7 +106,7 @@ - _Py_HAVE_ZLIB;%(PreprocessorDefinitions) - - -- version.lib;ws2_32.lib;pathcch.lib;%(AdditionalDependencies) -+ version.lib;ws2_32.lib;shlwapi.lib;%(AdditionalDependencies) - - - + #else + assert(!_Py_isabs(relfile)); diff --git a/ports/python3/0009-bz2d.patch b/ports/python3/0009-bz2d.patch deleted file mode 100644 index 70e1b925b4ddd5..00000000000000 --- a/ports/python3/0009-bz2d.patch +++ /dev/null @@ -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 - diff --git a/ports/python3/0010-dont-skip-rpath.patch b/ports/python3/0010-dont-skip-rpath.patch deleted file mode 100644 index 400cd61a32e229..00000000000000 --- a/ports/python3/0010-dont-skip-rpath.patch +++ /dev/null @@ -1,170 +0,0 @@ -From f7439eae9b2f8d91b6689efbf01292a044f3a3fe Mon Sep 17 00:00:00 2001 -From: Osyotr -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(-) - -diff --git a/setup.py b/setup.py -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)) - - --- -2.37.3.windows.1 - diff --git a/ports/python3/0012-force-disable-curses.patch b/ports/python3/0012-force-disable-curses.patch index 01e5dcf15bb3bc..65e99c82445ce3 100644 --- a/ports/python3/0012-force-disable-curses.patch +++ b/ports/python3/0012-force-disable-curses.patch @@ -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 diff --git a/ports/python3/0013-configure-no-libcrypt.patch b/ports/python3/0013-configure-no-libcrypt.patch deleted file mode 100644 index f75ac86c3004c6..00000000000000 --- a/ports/python3/0013-configure-no-libcrypt.patch +++ /dev/null @@ -1,55 +0,0 @@ -From f2c5695f17ec59f4badd374daabccf362bbd5f24 Mon Sep 17 00:00:00 2001 -From: Billy Robert O'Neal III -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 - diff --git a/ports/python3/portfile.cmake b/ports/python3/portfile.cmake index bc07fbdea13f9f..4bafef68618cce 100644 --- a/ports/python3/portfile.cmake +++ b/ports/python3/portfile.cmake @@ -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,7 @@ 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 +49,7 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO python/cpython REF v${PYTHON_VERSION} - SHA512 88bf6efef632a7dad7306a59b7d5da159947d6675f0d264f1f33aa49a5703b4e4595011de52098eb839cc648994ae143f668507be7209f6bf3fe8ae0ec6a9125 + SHA512 58290251f3597964f1002cd06470f9c533b92db9cc9f217d41436d3acd1f80603112235a539dd479b496c96f6b0a226d61e5fbe2d13737820b3c7afe1e821f6c HEAD_REF master PATCHES ${PATCHES} ) diff --git a/ports/python3/vcpkg.json b/ports/python3/vcpkg.json index 41d65148f7aed9..f0b6c51b7c7ce9 100644 --- a/ports/python3/vcpkg.json +++ b/ports/python3/vcpkg.json @@ -1,7 +1,6 @@ { "name": "python3", - "version": "3.10.7", - "port-version": 6, + "version": "3.11.3", "description": "The Python programming language", "homepage": "https://github.com/python/cpython", "license": "Python-2.0", From 9a0b7f5ceaec010f80a0f8eaffeee6f819f69110 Mon Sep 17 00:00:00 2001 From: Osyotr Date: Wed, 31 May 2023 10:55:15 +0300 Subject: [PATCH 02/36] Force set PythonForBuild on windows --- ports/python3/portfile.cmake | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/ports/python3/portfile.cmake b/ports/python3/portfile.cmake index 4bafef68618cce..fa69d3ab69fe20 100644 --- a/ports/python3/portfile.cmake +++ b/ports/python3/portfile.cmake @@ -75,7 +75,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) @@ -144,6 +144,16 @@ if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP) vcpkg_add_to_path("${CURRENT_INSTALLED_DIR}/debug/bin") endif() + # PythonForBuild is what's used on windows, despite the readme + vcpkg_backup_env_variables(VARS PythonForBuild) + if(VCPKG_CROSSCOMPILING) + set(ENV{PythonForBuild} "${CURRENT_HOST_INSTALLED_DIR}/tools/python3/python.exe") + else() + vcpkg_find_acquire_program(PYTHON3) + get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY) + set(ENV{PythonForBuild} "${PYTHON3_DIR}/python.exe") + endif() + vcpkg_install_msbuild( SOURCE_PATH "${SOURCE_PATH}" PROJECT_SUBPATH "PCbuild/pcbuild.proj" @@ -153,6 +163,8 @@ if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP) SKIP_CLEAN ) + vcpkg_restore_env_variables(VARS PythonForBuild) + # The extension modules must be placed in the DLLs directory, so we can't use vcpkg_copy_tools() if(PYTHON_ALLOW_EXTENSIONS) file(GLOB_RECURSE PYTHON_EXTENSIONS "${CURRENT_BUILDTREES_DIR}/*.pyd") From 2b8c3e7d79f62095e933e737a2bbfb44f7cda235 Mon Sep 17 00:00:00 2001 From: Osyotr Date: Wed, 31 May 2023 10:56:36 +0300 Subject: [PATCH 03/36] Set LD_LIBRARY_PATH on unix --- ports/python3/portfile.cmake | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ports/python3/portfile.cmake b/ports/python3/portfile.cmake index fa69d3ab69fe20..85704b06645386 100644 --- a/ports/python3/portfile.cmake +++ b/ports/python3/portfile.cmake @@ -240,10 +240,19 @@ else() list(APPEND OPTIONS "LIBS=-liconv -lintl") endif() + # Python tries to import its modules as part of the build process + # LD_LIBRARY_PATH must be set correctly for it to find *.so files + set(LD_LIBRARY_PATH_DEBUG "${CURRENT_INSTALLED_DIR}/debug/lib:$ENV{LD_LIBRARY_PATH}") + set(LD_LIBRARY_PATH_RELEASE "${CURRENT_INSTALLED_DIR}/lib:$ENV{LD_LIBRARY_PATH}") + vcpkg_configure_make( SOURCE_PATH "${SOURCE_PATH}" - OPTIONS ${OPTIONS} - OPTIONS_DEBUG "--with-pydebug" + OPTIONS + ${OPTIONS} + OPTIONS_DEBUG + "--with-pydebug" + CONFIG_DEPENDENT_ENVIRONMENT + LD_LIBRARY_PATH ) vcpkg_install_make(ADD_BIN_TO_PATH INSTALL_TARGET altinstall) From 3b8499524cab94b318ce69848f8e7730eac1ca1d Mon Sep 17 00:00:00 2001 From: Osyotr Date: Thu, 1 Jun 2023 12:47:41 +0300 Subject: [PATCH 04/36] Always use vcpkg_find_acquire_program(PYTHON3) on windows --- ports/python3/portfile.cmake | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/ports/python3/portfile.cmake b/ports/python3/portfile.cmake index 85704b06645386..a5f52363e1b9f5 100644 --- a/ports/python3/portfile.cmake +++ b/ports/python3/portfile.cmake @@ -144,15 +144,9 @@ if(VCPKG_TARGET_IS_WINDOWS) vcpkg_add_to_path("${CURRENT_INSTALLED_DIR}/debug/bin") endif() - # PythonForBuild is what's used on windows, despite the readme - vcpkg_backup_env_variables(VARS PythonForBuild) - if(VCPKG_CROSSCOMPILING) - set(ENV{PythonForBuild} "${CURRENT_HOST_INSTALLED_DIR}/tools/python3/python.exe") - else() - vcpkg_find_acquire_program(PYTHON3) - get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY) - set(ENV{PythonForBuild} "${PYTHON3_DIR}/python.exe") - 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}" @@ -163,8 +157,6 @@ if(VCPKG_TARGET_IS_WINDOWS) SKIP_CLEAN ) - vcpkg_restore_env_variables(VARS PythonForBuild) - # The extension modules must be placed in the DLLs directory, so we can't use vcpkg_copy_tools() if(PYTHON_ALLOW_EXTENSIONS) file(GLOB_RECURSE PYTHON_EXTENSIONS "${CURRENT_BUILDTREES_DIR}/*.pyd") From 03e3afcc14fadec840f711cc1aed3eedad90a485 Mon Sep 17 00:00:00 2001 From: Osyotr Date: Thu, 1 Jun 2023 12:48:19 +0300 Subject: [PATCH 05/36] Remove LD_LIBRARY_PATH shenanigans --- ports/python3/portfile.cmake | 7 ------- 1 file changed, 7 deletions(-) diff --git a/ports/python3/portfile.cmake b/ports/python3/portfile.cmake index a5f52363e1b9f5..7ecb42cab2bd5c 100644 --- a/ports/python3/portfile.cmake +++ b/ports/python3/portfile.cmake @@ -232,19 +232,12 @@ else() list(APPEND OPTIONS "LIBS=-liconv -lintl") endif() - # Python tries to import its modules as part of the build process - # LD_LIBRARY_PATH must be set correctly for it to find *.so files - set(LD_LIBRARY_PATH_DEBUG "${CURRENT_INSTALLED_DIR}/debug/lib:$ENV{LD_LIBRARY_PATH}") - set(LD_LIBRARY_PATH_RELEASE "${CURRENT_INSTALLED_DIR}/lib:$ENV{LD_LIBRARY_PATH}") - vcpkg_configure_make( SOURCE_PATH "${SOURCE_PATH}" OPTIONS ${OPTIONS} OPTIONS_DEBUG "--with-pydebug" - CONFIG_DEPENDENT_ENVIRONMENT - LD_LIBRARY_PATH ) vcpkg_install_make(ADD_BIN_TO_PATH INSTALL_TARGET altinstall) From 6e510019f2b4d2171ce9e36e70f407425f5d2190 Mon Sep 17 00:00:00 2001 From: Osyotr Date: Thu, 1 Jun 2023 17:07:04 +0300 Subject: [PATCH 06/36] [vtk] Parse python version from include folder --- ports/vtk/portfile.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ports/vtk/portfile.cmake b/ports/vtk/portfile.cmake index 72eeb48307cce7..22b0212d4c8eca 100644 --- a/ports/vtk/portfile.cmake +++ b/ports/vtk/portfile.cmake @@ -130,7 +130,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 From 379c1e82db2e69daffcedc40c2e3ed79b5bd6533 Mon Sep 17 00:00:00 2001 From: Osyotr Date: Thu, 1 Jun 2023 23:34:02 +0300 Subject: [PATCH 07/36] Fix static builds on windows --- ports/python3/0002-static-library.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ports/python3/0002-static-library.patch b/ports/python3/0002-static-library.patch index bf40a2de135276..7dd1adf2c45ca2 100644 --- a/ports/python3/0002-static-library.patch +++ b/ports/python3/0002-static-library.patch @@ -71,6 +71,19 @@ index 2625d0293d..2f8bdaa931 100644 _Py_HAVE_ZLIB;%(PreprocessorDefinitions) +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 @@ + + + +- Py_NO_ENABLE_SHARED;Py_BUILD_CORE;_CONSOLE;%(PreprocessorDefinitions) ++ Py_NO_ENABLE_SHARED;Py_BUILD_CORE;_CONSOLE;MS_DLL_ID="$(SysWinVer)";%(PreprocessorDefinitions) + Disabled + false + diff --git a/Python/sysmodule.c b/Python/sysmodule.c index ac49f7867a..f3583345ff 100644 --- a/Python/sysmodule.c From 87cfd06511081ef6cfbf848c9523810ebeda82c4 Mon Sep 17 00:00:00 2001 From: Osyotr Date: Fri, 2 Jun 2023 01:53:49 +0300 Subject: [PATCH 08/36] Pass --with-build-python on unix --- ports/python3/portfile.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ports/python3/portfile.cmake b/ports/python3/portfile.cmake index 7ecb42cab2bd5c..ffad4bd8035920 100644 --- a/ports/python3/portfile.cmake +++ b/ports/python3/portfile.cmake @@ -232,6 +232,16 @@ 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 @@ -313,6 +323,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() From 753ea87d9586c4561ac2c0ad4926d755ee49e308 Mon Sep 17 00:00:00 2001 From: Osyotr Date: Fri, 2 Jun 2023 01:58:41 +0300 Subject: [PATCH 09/36] [omniorb] Fix python version in patch --- ports/omniorb/python-fixes.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/omniorb/python-fixes.patch b/ports/omniorb/python-fixes.patch index e35613602c23a1..3555db758f724e 100644 --- a/ports/omniorb/python-fixes.patch +++ b/ports/omniorb/python-fixes.patch @@ -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("."))') From 387742ed39156abbc0b61eb0a685d393e9db3061 Mon Sep 17 00:00:00 2001 From: Osyotr Date: Fri, 2 Jun 2023 02:30:55 +0300 Subject: [PATCH 10/36] Resurrect rpath patch --- ports/python3/0010-dont-skip-rpath.patch | 29 ++++++++++++++++++++++++ ports/python3/portfile.cmake | 5 ++++ 2 files changed, 34 insertions(+) create mode 100644 ports/python3/0010-dont-skip-rpath.patch diff --git a/ports/python3/0010-dont-skip-rpath.patch b/ports/python3/0010-dont-skip-rpath.patch new file mode 100644 index 00000000000000..2061ce0439fbc6 --- /dev/null +++ b/ports/python3/0010-dont-skip-rpath.patch @@ -0,0 +1,29 @@ +From f7439eae9b2f8d91b6689efbf01292a044f3a3fe Mon Sep 17 00:00:00 2001 +From: Osyotr +Date: Thu, 4 Aug 2022 23:49:06 +0300 +Subject: [PATCH 10/11] dont skip rpath + +--- + configure.ac | 6 ++++++ + 1 file changed, 6 insertions(+), 0 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 61b3266..4c2cfb4 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -49,6 +49,12 @@ [$1] + [RESTORE_ENV] + )dnl + ++AS_VAR_IF([GNULD], [yes], [ ++ LDFLAGS="-Wl,--enable-new-dtags,-rpath=$vcpkg_rpath" ++], [ ++ LDFLAGS="-Wl,-rpath=$vcpkg_rpath" ++]) ++ + 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 + diff --git a/ports/python3/portfile.cmake b/ports/python3/portfile.cmake index ffad4bd8035920..9fde304c883f89 100644 --- a/ports/python3/portfile.cmake +++ b/ports/python3/portfile.cmake @@ -14,6 +14,7 @@ set(PATCHES 0004-devendor-external-dependencies.patch 0005-dont-copy-vcruntime.patch 0008-python.pc.patch + 0010-dont-skip-rpath.patch 0012-force-disable-curses.patch 0014-fix-get-python-inc-output.patch ) @@ -244,10 +245,14 @@ else() vcpkg_configure_make( SOURCE_PATH "${SOURCE_PATH}" + 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) From 07b5dafb33d13f269df0e58c4085f59b7ced2b16 Mon Sep 17 00:00:00 2001 From: Osyotr Date: Sun, 4 Jun 2023 23:36:28 +0300 Subject: [PATCH 11/36] [python3] fix usage --- ports/python3/portfile.cmake | 1 + ports/python3/usage.unix | 2 +- ports/python3/usage.win | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ports/python3/portfile.cmake b/ports/python3/portfile.cmake index 9fde304c883f89..a1004980a8845b 100644 --- a/ports/python3/portfile.cmake +++ b/ports/python3/portfile.cmake @@ -309,6 +309,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) diff --git a/ports/python3/usage.unix b/ports/python3/usage.unix index 614292c2ff7c25..fc2a575ebf968d 100644 --- a/ports/python3/usage.unix +++ b/ports/python3/usage.unix @@ -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 diff --git a/ports/python3/usage.win b/ports/python3/usage.win index 3fcc343ed8b688..dcbb71747dcb9c 100644 --- a/ports/python3/usage.win +++ b/ports/python3/usage.win @@ -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= From c359012832fc3a20c8ea6d43f919613c3ca50ead Mon Sep 17 00:00:00 2001 From: Osyotr Date: Sun, 4 Jun 2023 23:54:52 +0300 Subject: [PATCH 12/36] [gobject-introspection] don't hardcode python version --- ports/gobject-introspection/python.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/gobject-introspection/python.patch b/ports/gobject-introspection/python.patch index 5a196ae6525319..95e7f8163acda1 100644 --- a/ports/gobject-introspection/python.patch +++ b/ports/gobject-introspection/python.patch @@ -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) From 6cf722e7aa29b0a71e3e6254ada3e1c5936a6fd3 Mon Sep 17 00:00:00 2001 From: Osyotr Date: Sun, 4 Jun 2023 23:55:45 +0300 Subject: [PATCH 13/36] Update vcpkg_find_aquire_program(PYTHON3) This is also required for gobject-introspection --- .../vcpkg_find_acquire_program(PYTHON3).cmake | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/cmake/vcpkg_find_acquire_program(PYTHON3).cmake b/scripts/cmake/vcpkg_find_acquire_program(PYTHON3).cmake index 063839f7ffa9b0..ceaf42140ae097 100644 --- a/scripts/cmake/vcpkg_find_acquire_program(PYTHON3).cmake +++ b/scripts/cmake/vcpkg_find_acquire_program(PYTHON3).cmake @@ -1,19 +1,24 @@ if(CMAKE_HOST_WIN32) set(program_name python) - set(program_version 3.10.7) + set(program_version 3.11.3) 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) - else() + set(download_sha512 5d6f4be40c849bcb186e31b0b7e42f0e49188b6fc94dc6d1e27a5b7519931d5fa421b82181daef87dbb9dba7b8dbe1663ab7ec833ece0e18d2935e92b56b25bb) + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") 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 d0449f8450adf052b4f7c8fe94444482f1fd59f7dff4de38ddef1741061c60163af310edd0b1ffd93d322da3b4db9cb553a574a949ae4fcb0004594f25881501) + else(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") + set(tool_subdirectory "python-${program_version}-arm64") + set(download_urls "https://www.python.org/ftp/python/${program_version}/python-${program_version}-embed-arm64.zip") + set(download_filename "python-${program_version}-embed-amd64.zip") + set(download_sha512 0b08f6c5eea999b11370ab339064bb8c16c43e134ddbb6f708e82e9f0638cb4a0609a6fc8b993d7d100ae5cb6c7d4bc66b626e73497e490234e1314f9cad362f) 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") From 7996ca0ba80fc059583ac1115cacd85f189e0cc9 Mon Sep 17 00:00:00 2001 From: Osyotr Date: Sun, 4 Jun 2023 23:56:02 +0300 Subject: [PATCH 14/36] [paraview] don't hardcode python version --- ports/paraview/portfile.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ports/paraview/portfile.cmake b/ports/paraview/portfile.cmake index 9b9c38d1f2e8eb..6cdac7bb8b77c4 100644 --- a/ports/paraview/portfile.cmake +++ b/ports/paraview/portfile.cmake @@ -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 From 0006e0eae12fd740277e80e591f9ca24973da8ae Mon Sep 17 00:00:00 2001 From: Osyotr Date: Sun, 4 Jun 2023 23:56:17 +0300 Subject: [PATCH 15/36] [vtk-dicom] don't hardcode python version --- ports/vtk-dicom/portfile.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ports/vtk-dicom/portfile.cmake b/ports/vtk-dicom/portfile.cmake index 9647dfd97a05a7..5c701162f0b1cd 100644 --- a/ports/vtk-dicom/portfile.cmake +++ b/ports/vtk-dicom/portfile.cmake @@ -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( From 131b2cb7c45fd9069076e570f8e014bf05d33102 Mon Sep 17 00:00:00 2001 From: Osyotr Date: Mon, 5 Jun 2023 00:04:10 +0300 Subject: [PATCH 16/36] Update python in vcpkgTools.xml --- scripts/vcpkgTools.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index 831c9be01c2f1c..c723b16c144648 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -1,18 +1,18 @@ - 3.10.7 + 3.11.3 python.exe - https://www.python.org/ftp/python/3.10.7/python-3.10.7-embed-win32.zip - a69445906a909ce5f2554c544fe4251a8ab9c5028b531975b8c78fa8e98295b2bf06e1840f346a3c0edf485a7792c40c9d318bffd36b9c7829ac72b7cf8697bc - python-3.10.7-embed-win32.zip + https://www.python.org/ftp/python/3.11.3/python-3.11.3-embed-win32.zip + 5d6f4be40c849bcb186e31b0b7e42f0e49188b6fc94dc6d1e27a5b7519931d5fa421b82181daef87dbb9dba7b8dbe1663ab7ec833ece0e18d2935e92b56b25bb + python-3.11.3-embed-win32.zip - 3.10.7 + 3.11.3 tools\python.exe - https://www.nuget.org/api/v2/package/python/3.10.7 - dc763c4f3e9594619173a99740a6b54686c768c240efe316d4d3f8914383bd06420c0802781baf983ea840c49412b8330c1af93f31d2c73eb0ea22a55e71aa13 - python-3.10.7.nupkg.zip + https://www.nuget.org/api/v2/package/python/3.11.3 + a41606540366b82e39312cfbda51032995c3996737fb726a48d01cddb76a4b5c6ee07a7e2a5dd9f23ead1f215ccc6af486e1e9b922e74b88ea82a672ba660ca7 + python-3.11.3.nupkg.zip 3.25.1 From 8874d2ec0d60babf6f7d513f6c93008aacaf9145 Mon Sep 17 00:00:00 2001 From: Osyotr Date: Mon, 5 Jun 2023 22:54:23 +0300 Subject: [PATCH 17/36] Fix host arch detection in vcpkg_find_acquire_program(PYTHON3) --- .../vcpkg_find_acquire_program(PYTHON3).cmake | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/scripts/cmake/vcpkg_find_acquire_program(PYTHON3).cmake b/scripts/cmake/vcpkg_find_acquire_program(PYTHON3).cmake index ceaf42140ae097..9c1edcbf97748c 100644 --- a/scripts/cmake/vcpkg_find_acquire_program(PYTHON3).cmake +++ b/scripts/cmake/vcpkg_find_acquire_program(PYTHON3).cmake @@ -1,22 +1,31 @@ if(CMAKE_HOST_WIN32) set(program_name python) set(program_version 3.11.3) - if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + + if(DEFINED ENV{PROCESSOR_ARCHITEW6432}) + set(_host_arch $ENV{PROCESSOR_ARCHITEW6432}) + else() + set(_host_arch $ENV{PROCESSOR_ARCHITECTURE}) + endif() + + if(_host_arch MATCHES "(x|X)86") 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 5d6f4be40c849bcb186e31b0b7e42f0e49188b6fc94dc6d1e27a5b7519931d5fa421b82181daef87dbb9dba7b8dbe1663ab7ec833ece0e18d2935e92b56b25bb) - elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") + elseif(_host_arch MATCHES "(amd|AMD)64") 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 d0449f8450adf052b4f7c8fe94444482f1fd59f7dff4de38ddef1741061c60163af310edd0b1ffd93d322da3b4db9cb553a574a949ae4fcb0004594f25881501) - else(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") + elseif(_host_arch MATCHES "^(ARM|arm)64$") set(tool_subdirectory "python-${program_version}-arm64") set(download_urls "https://www.python.org/ftp/python/${program_version}/python-${program_version}-embed-arm64.zip") - set(download_filename "python-${program_version}-embed-amd64.zip") + set(download_filename "python-${program_version}-embed-arm64.zip") set(download_sha512 0b08f6c5eea999b11370ab339064bb8c16c43e134ddbb6f708e82e9f0638cb4a0609a6fc8b993d7d100ae5cb6c7d4bc66b626e73497e490234e1314f9cad362f) endif() + unset(_host_arch) + set(paths_to_search "${DOWNLOADS}/tools/python/${tool_subdirectory}") vcpkg_list(SET post_install_command "${CMAKE_COMMAND}" -E rm python311._pth) else() From f1cf57dd73f228765a0100939ff5c41351422e25 Mon Sep 17 00:00:00 2001 From: Osyotr Date: Sun, 11 Jun 2023 23:35:15 +0300 Subject: [PATCH 18/36] [libpq] Don't hardcode python version --- ports/libpq/build-msvc.cmake | 2 +- ports/libpq/portfile.cmake | 6 ++++++ ports/libpq/unix/python.patch | 2 +- ports/libpq/vcpkg-libs.props.in | 4 ++-- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ports/libpq/build-msvc.cmake b/ports/libpq/build-msvc.cmake index 7857b11e3a9ed9..34d9694879578c 100644 --- a/ports/libpq/build-msvc.cmake +++ b/ports/libpq/build-msvc.cmake @@ -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}") diff --git a/ports/libpq/portfile.cmake b/ports/libpq/portfile.cmake index b03f3a996dab04..841cd28662dc3b 100644 --- a/ports/libpq/portfile.cmake +++ b/ports/libpq/portfile.cmake @@ -20,6 +20,12 @@ 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]+)" p_version ${p}) +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() diff --git a/ports/libpq/unix/python.patch b/ports/libpq/unix/python.patch index 6466746ed433b6..c83458025b455d 100644 --- a/ports/libpq/unix/python.patch +++ b/ports/libpq/unix/python.patch @@ -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//')] diff --git a/ports/libpq/vcpkg-libs.props.in b/ports/libpq/vcpkg-libs.props.in index 4c777561c7ff4a..a05aefb4f43026 100644 --- a/ports/libpq/vcpkg-libs.props.in +++ b/ports/libpq/vcpkg-libs.props.in @@ -5,7 +5,7 @@ @CURRENT_INSTALLED_DIR@/debug/lib/lz4d.lib @CURRENT_INSTALLED_DIR@/debug/lib/intl.lib;@CURRENT_INSTALLED_DIR@/debug/lib/iconv.lib;@CURRENT_INSTALLED_DIR@/debug/lib/charset.lib @CURRENT_INSTALLED_DIR@/debug/lib/libssl.lib;@CURRENT_INSTALLED_DIR@/debug/lib/libcrypto.lib;crypt32.lib;ws2_32.lib;secur32.lib - @CURRENT_INSTALLED_DIR@/debug/lib/python310_d.lib + @CURRENT_INSTALLED_DIR@/debug/lib/python3@PYTHON_VERSION_MINOR@_d.lib @CURRENT_INSTALLED_DIR@/debug/lib/tcl90g.lib @CURRENT_INSTALLED_DIR@/debug/lib/tcl90sg.lib @CURRENT_INSTALLED_DIR@/debug/lib/tcl90sgx.lib @@ -19,7 +19,7 @@ @CURRENT_INSTALLED_DIR@/lib/lz4.lib @CURRENT_INSTALLED_DIR@/lib/intl.lib;@CURRENT_INSTALLED_DIR@/lib/iconv.lib;@CURRENT_INSTALLED_DIR@/lib/charset.lib @CURRENT_INSTALLED_DIR@/lib/libssl.lib;@CURRENT_INSTALLED_DIR@/lib/libcrypto.lib;crypt32.lib;ws2_32.lib;secur32.lib - @CURRENT_INSTALLED_DIR@/lib/python310.lib + @CURRENT_INSTALLED_DIR@/lib/python33@PYTHON_VERSION_MINOR@.lib @CURRENT_INSTALLED_DIR@/lib/tcl90.lib @CURRENT_INSTALLED_DIR@/lib/tcl90s.lib @CURRENT_INSTALLED_DIR@/lib/tcl90sx.lib From 1f72bb1b585e4bbfa7b06725c858ac9147d2862e Mon Sep 17 00:00:00 2001 From: Osyotr Date: Sun, 11 Jun 2023 23:37:14 +0300 Subject: [PATCH 19/36] [shiva] Don't pass python variables --- ports/shiva/portfile.cmake | 7 ------- 1 file changed, 7 deletions(-) diff --git a/ports/shiva/portfile.cmake b/ports/shiva/portfile.cmake index 884a8de108656c..ca407f76235258 100644 --- a/ports/shiva/portfile.cmake +++ b/ports/shiva/portfile.cmake @@ -7,18 +7,11 @@ vcpkg_from_github( PATCHES 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}" ) From caa5574f72546b6d4ebcd5beb4fab8bf3da30e98 Mon Sep 17 00:00:00 2001 From: Osyotr Date: Sun, 11 Jun 2023 23:38:23 +0300 Subject: [PATCH 20/36] [vcpkg-get-python-packages] Delete unused file, update hardcoded python version --- ports/vcpkg-get-python-packages/portfile.cmake | 1 - ports/vcpkg-get-python-packages/python310._pth | 7 ------- .../x_vcpkg_get_python_packages.cmake | 6 ++---- 3 files changed, 2 insertions(+), 12 deletions(-) delete mode 100644 ports/vcpkg-get-python-packages/python310._pth diff --git a/ports/vcpkg-get-python-packages/portfile.cmake b/ports/vcpkg-get-python-packages/portfile.cmake index 7935b09b423c2a..4bc168627e1c6a 100644 --- a/ports/vcpkg-get-python-packages/portfile.cmake +++ b/ports/vcpkg-get-python-packages/portfile.cmake @@ -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") diff --git a/ports/vcpkg-get-python-packages/python310._pth b/ports/vcpkg-get-python-packages/python310._pth deleted file mode 100644 index f53ed18de1a0a4..00000000000000 --- a/ports/vcpkg-get-python-packages/python310._pth +++ /dev/null @@ -1,7 +0,0 @@ -python310.zip -Lib -Lib/site-packages -. - -# Uncomment to run site.main() automatically -#import site diff --git a/ports/vcpkg-get-python-packages/x_vcpkg_get_python_packages.cmake b/ports/vcpkg-get-python-packages/x_vcpkg_get_python_packages.cmake index 8b0a016462d3f5..026bece3d9634c 100644 --- a/ports/vcpkg-get-python-packages/x_vcpkg_get_python_packages.cmake +++ b/ports/vcpkg-get-python-packages/x_vcpkg_get_python_packages.cmake @@ -13,6 +13,7 @@ function(x_vcpkg_get_python_packages) elseif(NOT DEFINED arg_PYTHON_VERSION) if(arg_PYTHON_EXECUTABLE MATCHES "(python3|python-3)") set(arg_PYTHON_VERSION 3) + set(arg_PYTHON_VERSION_MINOR 11) else() set(arg_PYTHON_VERSION 2) endif() @@ -32,9 +33,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 +73,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${arg_PYTHON_VERSION_MINOR}.zip" DESTINATION "${venv_path}/Scripts") endif() set(python_venv_options "--app-data" "${venv_path}/data") else() From aae4df318f89cd5983ceaa0ccdc54b7406a1d5b0 Mon Sep 17 00:00:00 2001 From: Osyotr Date: Sun, 11 Jun 2023 23:55:01 +0300 Subject: [PATCH 21/36] [python3] update to 3.11.4 --- ports/python3/portfile.cmake | 2 +- ports/python3/vcpkg.json | 2 +- .../vcpkg_find_acquire_program(PYTHON3).cmake | 8 ++++---- scripts/vcpkgTools.xml | 16 ++++++++-------- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ports/python3/portfile.cmake b/ports/python3/portfile.cmake index a1004980a8845b..c8a0ae39d4393c 100644 --- a/ports/python3/portfile.cmake +++ b/ports/python3/portfile.cmake @@ -50,7 +50,7 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO python/cpython REF v${PYTHON_VERSION} - SHA512 58290251f3597964f1002cd06470f9c533b92db9cc9f217d41436d3acd1f80603112235a539dd479b496c96f6b0a226d61e5fbe2d13737820b3c7afe1e821f6c + SHA512 de64f0d09bf2c08873bb3d99bb95c0b675895ed05f8ac5f7bc071322c051ad537c61ea9df9b65bb67d74c4e5b3ab8a75f83da101b22046ee41ba4f77cf0bc549 HEAD_REF master PATCHES ${PATCHES} ) diff --git a/ports/python3/vcpkg.json b/ports/python3/vcpkg.json index f0b6c51b7c7ce9..18a769273ee49c 100644 --- a/ports/python3/vcpkg.json +++ b/ports/python3/vcpkg.json @@ -1,6 +1,6 @@ { "name": "python3", - "version": "3.11.3", + "version": "3.11.4", "description": "The Python programming language", "homepage": "https://github.com/python/cpython", "license": "Python-2.0", diff --git a/scripts/cmake/vcpkg_find_acquire_program(PYTHON3).cmake b/scripts/cmake/vcpkg_find_acquire_program(PYTHON3).cmake index 9c1edcbf97748c..ecc1255052e7e2 100644 --- a/scripts/cmake/vcpkg_find_acquire_program(PYTHON3).cmake +++ b/scripts/cmake/vcpkg_find_acquire_program(PYTHON3).cmake @@ -1,6 +1,6 @@ if(CMAKE_HOST_WIN32) set(program_name python) - set(program_version 3.11.3) + set(program_version 3.11.4) if(DEFINED ENV{PROCESSOR_ARCHITEW6432}) set(_host_arch $ENV{PROCESSOR_ARCHITEW6432}) @@ -12,17 +12,17 @@ if(CMAKE_HOST_WIN32) 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 5d6f4be40c849bcb186e31b0b7e42f0e49188b6fc94dc6d1e27a5b7519931d5fa421b82181daef87dbb9dba7b8dbe1663ab7ec833ece0e18d2935e92b56b25bb) + set(download_sha512 4cdbb2efdc7764a87edfb7370716c1caf660d38bce37a280ec59b7aecab5672c5798aabe19a8ae395224bea7dfe644bd92656f0bbc44348717981b45a909c024) elseif(_host_arch MATCHES "(amd|AMD)64") 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 d0449f8450adf052b4f7c8fe94444482f1fd59f7dff4de38ddef1741061c60163af310edd0b1ffd93d322da3b4db9cb553a574a949ae4fcb0004594f25881501) + set(download_sha512 3f93c2a16764b9ea6343315b70c0c6319aac8edaefbf4e21206fb30eff365e8fe37264a9133bebe12e664ea5d8fd232d587a5603a51fd96e1252a2fc01a2e550) elseif(_host_arch MATCHES "^(ARM|arm)64$") set(tool_subdirectory "python-${program_version}-arm64") set(download_urls "https://www.python.org/ftp/python/${program_version}/python-${program_version}-embed-arm64.zip") set(download_filename "python-${program_version}-embed-arm64.zip") - set(download_sha512 0b08f6c5eea999b11370ab339064bb8c16c43e134ddbb6f708e82e9f0638cb4a0609a6fc8b993d7d100ae5cb6c7d4bc66b626e73497e490234e1314f9cad362f) + set(download_sha512 65db185ccd2cfeb54f65d568dc857699d47ad8c181be6697d60acf76695a9229e14b77b62c431227d46531c07dba54f4442cae98792f46e64faa053fe0e25b6a) endif() unset(_host_arch) diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index c723b16c144648..b55db47087e1be 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -1,18 +1,18 @@ - 3.11.3 + 3.11.4 python.exe - https://www.python.org/ftp/python/3.11.3/python-3.11.3-embed-win32.zip - 5d6f4be40c849bcb186e31b0b7e42f0e49188b6fc94dc6d1e27a5b7519931d5fa421b82181daef87dbb9dba7b8dbe1663ab7ec833ece0e18d2935e92b56b25bb - python-3.11.3-embed-win32.zip + https://www.python.org/ftp/python/3.11.4/python-3.11.4-embed-win32.zip + 4cdbb2efdc7764a87edfb7370716c1caf660d38bce37a280ec59b7aecab5672c5798aabe19a8ae395224bea7dfe644bd92656f0bbc44348717981b45a909c024 + python-3.11.4-embed-win32.zip - 3.11.3 + 3.11.4 tools\python.exe - https://www.nuget.org/api/v2/package/python/3.11.3 - a41606540366b82e39312cfbda51032995c3996737fb726a48d01cddb76a4b5c6ee07a7e2a5dd9f23ead1f215ccc6af486e1e9b922e74b88ea82a672ba660ca7 - python-3.11.3.nupkg.zip + https://www.nuget.org/api/v2/package/python/3.11.4 + 3f311506440238103a3ed5f2b5c62f8fe5f935e24c7a44bd5aac588c9e0383a2eb7651cb3ee18e5873c2edf5718019c8648955bdedb9efe3101c1041776fc31e + python-3.11.4.nupkg.zip 3.25.1 From 4515ed97b1e887a5dc3dc11f7fdf1048e313b55e Mon Sep 17 00:00:00 2001 From: Osyotr Date: Mon, 12 Jun 2023 00:02:19 +0300 Subject: [PATCH 22/36] [omniorb] Use PREPEND in vcpkg_add_to_path So that python from vcpkg is picked before system python --- ports/omniorb/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/omniorb/portfile.cmake b/ports/omniorb/portfile.cmake index 768716f5652bfa..d78e14addeae38 100644 --- a/ports/omniorb/portfile.cmake +++ b/ports/omniorb/portfile.cmake @@ -29,7 +29,7 @@ vcpkg_extract_source_archive( ${PATCHES} ) -vcpkg_add_to_path("${CURRENT_HOST_INSTALLED_DIR}/tools/python3") # port ask python distutils for info. +vcpkg_add_to_path(PREPEND "${CURRENT_HOST_INSTALLED_DIR}/tools/python3") # port ask python distutils for info. 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() From d9531b8d766a8f68b8ca41a1bb9287be14be61bb Mon Sep 17 00:00:00 2001 From: Osyotr Date: Mon, 12 Jun 2023 00:10:34 +0300 Subject: [PATCH 23/36] libpq quickfix --- ports/libpq/portfile.cmake | 2 +- ports/libpq/vcpkg-libs.props.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/libpq/portfile.cmake b/ports/libpq/portfile.cmake index 841cd28662dc3b..ceb52ccb41ffb1 100644 --- a/ports/libpq/portfile.cmake +++ b/ports/libpq/portfile.cmake @@ -21,7 +21,7 @@ vcpkg_extract_source_archive( ) file(GLOB _py3_include_path "${CURRENT_HOST_INSTALLED_DIR}/include/python3*") -string(REGEX MATCH "python3\\.([0-9]+)" p_version ${p}) +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}") diff --git a/ports/libpq/vcpkg-libs.props.in b/ports/libpq/vcpkg-libs.props.in index a05aefb4f43026..cb7e5f92c13e38 100644 --- a/ports/libpq/vcpkg-libs.props.in +++ b/ports/libpq/vcpkg-libs.props.in @@ -19,7 +19,7 @@ @CURRENT_INSTALLED_DIR@/lib/lz4.lib @CURRENT_INSTALLED_DIR@/lib/intl.lib;@CURRENT_INSTALLED_DIR@/lib/iconv.lib;@CURRENT_INSTALLED_DIR@/lib/charset.lib @CURRENT_INSTALLED_DIR@/lib/libssl.lib;@CURRENT_INSTALLED_DIR@/lib/libcrypto.lib;crypt32.lib;ws2_32.lib;secur32.lib - @CURRENT_INSTALLED_DIR@/lib/python33@PYTHON_VERSION_MINOR@.lib + @CURRENT_INSTALLED_DIR@/lib/python3@PYTHON_VERSION_MINOR@.lib @CURRENT_INSTALLED_DIR@/lib/tcl90.lib @CURRENT_INSTALLED_DIR@/lib/tcl90s.lib @CURRENT_INSTALLED_DIR@/lib/tcl90sx.lib From 938cad325196c809dca11b1f1725df74c6462cef Mon Sep 17 00:00:00 2001 From: Osyotr Date: Mon, 12 Jun 2023 09:41:12 +0300 Subject: [PATCH 24/36] re-fix libpq --- ports/libpq/portfile.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ports/libpq/portfile.cmake b/ports/libpq/portfile.cmake index ceb52ccb41ffb1..5593f7702363fd 100644 --- a/ports/libpq/portfile.cmake +++ b/ports/libpq/portfile.cmake @@ -21,9 +21,8 @@ vcpkg_extract_source_archive( ) file(GLOB _py3_include_path "${CURRENT_HOST_INSTALLED_DIR}/include/python3*") -string(REGEX MATCH "python3\\.([0-9]+)" _python_version_tmp ${_py3_include_path}) +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) From 711730d406ca23e30e0a3d206f2793d41609f041 Mon Sep 17 00:00:00 2001 From: Osyotr Date: Mon, 12 Jun 2023 09:41:28 +0300 Subject: [PATCH 25/36] fix vcpkg-get-python-packages --- .../x_vcpkg_get_python_packages.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ports/vcpkg-get-python-packages/x_vcpkg_get_python_packages.cmake b/ports/vcpkg-get-python-packages/x_vcpkg_get_python_packages.cmake index 026bece3d9634c..c67fb1e0bfa791 100644 --- a/ports/vcpkg-get-python-packages/x_vcpkg_get_python_packages.cmake +++ b/ports/vcpkg-get-python-packages/x_vcpkg_get_python_packages.cmake @@ -13,12 +13,15 @@ function(x_vcpkg_get_python_packages) elseif(NOT DEFINED arg_PYTHON_VERSION) if(arg_PYTHON_EXECUTABLE MATCHES "(python3|python-3)") set(arg_PYTHON_VERSION 3) - set(arg_PYTHON_VERSION_MINOR 11) else() set(arg_PYTHON_VERSION 2) 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() @@ -73,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}/python3${arg_PYTHON_VERSION_MINOR}.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() From 8632d98f5c1889039f1d8bae2b0bd3c4aa822f46 Mon Sep 17 00:00:00 2001 From: Osyotr Date: Tue, 27 Jun 2023 14:43:15 +0300 Subject: [PATCH 26/36] Make windows 7 patch compatible with unix builds --- .../0006-restore-support-for-windows-7.patch | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/ports/python3/0006-restore-support-for-windows-7.patch b/ports/python3/0006-restore-support-for-windows-7.patch index 24dc97cf4d4d30..d3aa09e667a679 100644 --- a/ports/python3/0006-restore-support-for-windows-7.patch +++ b/ports/python3/0006-restore-support-for-windows-7.patch @@ -41,14 +41,15 @@ index bc730fc..7d3d559 100644 #endif #ifdef __APPLE__ -@@ -217,6 +217,10 @@ getpath_isfile(PyObject *Py_UNUSED(self), PyObject *args) +@@ -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) @@ -121,15 +122,16 @@ diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c # include // UNLEN # include "osdefs.h" // SEP # define HAVE_SYMLINK -@@ -4471,6 +4471,10 @@ os__getvolumepathname_impl(PyObject *module, path_t *path) +@@ -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 @@ -4489,6 +4493,19 @@ os__path_splitroot_impl(PyObject *module, path_t *path) @@ -222,16 +224,18 @@ index c86ed40..6b1535d 100644 extern int winerror_to_errno(int); #endif -@@ -1999,13 +1999,44 @@ _Py_wrealpath(const wchar_t *path, +@@ -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 @@ -268,13 +272,15 @@ index c86ed40..6b1535d 100644 if (FAILED(hr) || path == tail) { return 0; } -@@ -2086,6 +2117,9 @@ _Py_abspath(const wchar_t *path, wchar_t **abspath_p) +@@ -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 From d4a1299ff92fd8dfb0e678b2cfbb4756aa8b2921 Mon Sep 17 00:00:00 2001 From: Osyotr Date: Tue, 27 Jun 2023 14:44:22 +0300 Subject: [PATCH 27/36] Copy pyd files to bin Also fixes copying files that do not belong to current build tree --- ports/python3/portfile.cmake | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ports/python3/portfile.cmake b/ports/python3/portfile.cmake index c8a0ae39d4393c..fb2d9b7c56b5b8 100644 --- a/ports/python3/portfile.cmake +++ b/ports/python3/portfile.cmake @@ -160,11 +160,14 @@ if(VCPKG_TARGET_IS_WINDOWS) # The extension modules must be placed in the DLLs directory, so we can't use vcpkg_copy_tools() if(PYTHON_ALLOW_EXTENSIONS) - file(GLOB_RECURSE PYTHON_EXTENSIONS "${CURRENT_BUILDTREES_DIR}/*.pyd") - list(FILTER PYTHON_EXTENSIONS EXCLUDE REGEX [[.*_d\.pyd]]) - file(COPY ${PYTHON_EXTENSIONS} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}/DLLs") + file(GLOB_RECURSE PYTHON_EXTENSIONS_RELEASE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.pyd") + file(COPY ${PYTHON_EXTENSIONS_RELEASE} DESTINATION "${CURRENT_PACKAGES_DIR}/bin") + file(COPY ${PYTHON_EXTENSIONS_RELEASE} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}/DLLs") vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}/DLLs") file(REMOVE "${CURRENT_PACKAGES_DIR}/tools/${PORT}/DLLs/python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}.dll") + + file(GLOB_RECURSE PYTHON_EXTENSIONS_DEBUG "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.pyd") + file(COPY ${PYTHON_EXTENSIONS_DEBUG} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin") endif() file(COPY "${SOURCE_PATH}/Include/" "${SOURCE_PATH}/PC/pyconfig.h" From 129fa83c92d577185a8e17a214f282cd896138bb Mon Sep 17 00:00:00 2001 From: Osyotr Date: Wed, 28 Jun 2023 20:36:17 +0300 Subject: [PATCH 28/36] Fix static builds --- ports/python3/0002-static-library.patch | 54 ++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/ports/python3/0002-static-library.patch b/ports/python3/0002-static-library.patch index 7dd1adf2c45ca2..10bb2c0c7b7b26 100644 --- a/ports/python3/0002-static-library.patch +++ b/ports/python3/0002-static-library.patch @@ -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 */ @@ -84,6 +104,36 @@ index 2625d0293d..2f8bdaa931 100644 Disabled false +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 From 969d0959c8f66dc59041e4ffd9d1ebc0e8f80df8 Mon Sep 17 00:00:00 2001 From: Osyotr Date: Tue, 4 Jul 2023 22:59:11 +0300 Subject: [PATCH 29/36] Speculatively fix osx regression --- ports/python3/0010-dont-skip-rpath.patch | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ports/python3/0010-dont-skip-rpath.patch b/ports/python3/0010-dont-skip-rpath.patch index 2061ce0439fbc6..5d0b9dea6bb026 100644 --- a/ports/python3/0010-dont-skip-rpath.patch +++ b/ports/python3/0010-dont-skip-rpath.patch @@ -11,15 +11,17 @@ diff --git a/configure.ac b/configure.ac index 61b3266..4c2cfb4 100644 --- a/configure.ac +++ b/configure.ac -@@ -49,6 +49,12 @@ [$1] +@@ -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,--enable-new-dtags,-rpath,$vcpkg_rpath" +], [ -+ LDFLAGS="-Wl,-rpath=$vcpkg_rpath" ++ LDFLAGS="-Wl,-rpath,$vcpkg_rpath" +]) ++fi + dnl PY_CHECK_FUNC(FUNCTION, [INCLUDES], [AC_DEFINE-VAR]) AC_DEFUN([PY_CHECK_FUNC], From 08674373b75553aa9e6a5b71953b650e5ca63673 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 5 Jul 2023 10:55:59 +0300 Subject: [PATCH 30/36] Fix omniorb on unix --- ports/omniorb/portfile.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ports/omniorb/portfile.cmake b/ports/omniorb/portfile.cmake index d78e14addeae38..67c57931c7ee17 100644 --- a/ports/omniorb/portfile.cmake +++ b/ports/omniorb/portfile.cmake @@ -29,11 +29,18 @@ vcpkg_extract_source_archive( ${PATCHES} ) -vcpkg_add_to_path(PREPEND "${CURRENT_HOST_INSTALLED_DIR}/tools/python3") # port ask python distutils for info. +vcpkg_add_to_path("${CURRENT_HOST_INSTALLED_DIR}/tools/python3") # port ask python distutils for info. 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}") From cb8e1e0e210ca92e7bd612f4ffb0eb04f99e0a39 Mon Sep 17 00:00:00 2001 From: Osyotr Date: Fri, 7 Jul 2023 01:48:09 +0300 Subject: [PATCH 31/36] [gobject-introspection] fix windows builds --- ports/gobject-introspection/portfile.cmake | 52 +++++++++++++++++----- 1 file changed, 42 insertions(+), 10 deletions(-) diff --git a/ports/gobject-introspection/portfile.cmake b/ports/gobject-introspection/portfile.cmake index 1d64ab1ec36a50..0447d763ce1906 100644 --- a/ports/gobject-introspection/portfile.cmake +++ b/ports/gobject-introspection/portfile.cmake @@ -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 @@ -21,15 +21,44 @@ vcpkg_extract_source_archive( vcpkg_find_acquire_program(FLEX) vcpkg_find_acquire_program(BISON) -set(OPTIONS_DEBUG -Dbuild_introspection_data=false) -set(OPTIONS_RELEASE -Dbuild_introspection_data=true) -if(VCPKG_CROSSCOMPILING AND - NOT (CMAKE_HOST_WIN32 AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")) - list(APPEND OPTIONS_RELEASE -Dgi_cross_use_prebuilt_gi=true) +if(VCPKG_TARGET_IS_WINDOWS) + # This is the same check that is used in vcpkg_find_acquire_program(PYTHON3) + if(DEFINED ENV{PROCESSOR_ARCHITEW6432}) + set(_host_arch $ENV{PROCESSOR_ARCHITEW6432}) + else() + set(_host_arch $ENV{PROCESSOR_ARCHITECTURE}) + endif() + + if(_host_arch MATCHES "(x|X)86") + set(_vcpkg_python_host_arch "x86") + elseif(_host_arch MATCHES "(amd|AMD)64") + set(_vcpkg_python_host_arch "x64") + elseif(_host_arch MATCHES "^(ARM|arm)64$") + set(_vcpkg_python_host_arch "arm64") + else() + message(FATAL_ERROR "Unknown architecture ${_host_arch}") + endif() + + if("${_vcpkg_python_host_arch}" STREQUAL "${VCPKG_TARGET_ARCHITECTURE}") + set(_can_build_introspection_data TRUE) + endif() +else() + set(_can_build_introspection_data TRUE) +endif() + +list(APPEND OPTIONS_DEBUG -Dbuild_introspection_data=false) +if(_can_build_introspection_data) + # This option requires running target binaries on host machine) + list(APPEND OPTIONS_RELEASE + -Dbuild_introspection_data=true + -Dgi_cross_use_prebuilt_gi=true + ) +else() + list(APPEND OPTIONS_RELEASE -Dbuild_introspection_data=false) endif() vcpkg_configure_meson( - SOURCE_PATH ${SOURCE_PATH} + SOURCE_PATH "${SOURCE_PATH}" OPTIONS_DEBUG ${OPTIONS_DEBUG} OPTIONS_RELEASE @@ -50,8 +79,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 +101,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") From 24a30841f61d6461bc8132b4f2f7d2474aaafbd9 Mon Sep 17 00:00:00 2001 From: Osyotr Date: Wed, 26 Jul 2023 01:19:17 +0300 Subject: [PATCH 32/36] [vtk] Update vendored copy of mpi4py for python 3.11 support --- ports/vtk/portfile.cmake | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/ports/vtk/portfile.cmake b/ports/vtk/portfile.cmake index a812b3d32902b2..1b29c3d9aeb84c 100644 --- a/ports/vtk/portfile.cmake +++ b/ports/vtk/portfile.cmake @@ -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 ) From a20c1800de22cd865fff418138d8359ddab4b7d6 Mon Sep 17 00:00:00 2001 From: Osyotr Date: Wed, 26 Jul 2023 01:39:23 +0300 Subject: [PATCH 33/36] [mdl-sdk] Fix python --- ports/mdl-sdk/011-fix-python.patch | 11 +++++++++++ ports/mdl-sdk/portfile.cmake | 1 + 2 files changed, 12 insertions(+) create mode 100644 ports/mdl-sdk/011-fix-python.patch diff --git a/ports/mdl-sdk/011-fix-python.patch b/ports/mdl-sdk/011-fix-python.patch new file mode 100644 index 00000000000000..e0a9ff5fe187b2 --- /dev/null +++ b/ports/mdl-sdk/011-fix-python.patch @@ -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 + diff --git a/ports/mdl-sdk/portfile.cmake b/ports/mdl-sdk/portfile.cmake index 4d342e856d326e..8148fa1a6e7dd0 100644 --- a/ports/mdl-sdk/portfile.cmake +++ b/ports/mdl-sdk/portfile.cmake @@ -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) From 7fbd04d218692edf6a44b9a3ba579693dcf058ea Mon Sep 17 00:00:00 2001 From: Osyotr Date: Fri, 28 Jul 2023 00:21:16 +0300 Subject: [PATCH 34/36] [gobject-introspection] fix the fix of a fix... --- ports/gobject-introspection/portfile.cmake | 4 ---- ports/gobject-introspection/vcpkg.json | 13 +------------ 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/ports/gobject-introspection/portfile.cmake b/ports/gobject-introspection/portfile.cmake index 0447d763ce1906..dfe0abf4333f6b 100644 --- a/ports/gobject-introspection/portfile.cmake +++ b/ports/gobject-introspection/portfile.cmake @@ -51,7 +51,6 @@ if(_can_build_introspection_data) # This option requires running target binaries on host machine) list(APPEND OPTIONS_RELEASE -Dbuild_introspection_data=true - -Dgi_cross_use_prebuilt_gi=true ) else() list(APPEND OPTIONS_RELEASE -Dbuild_introspection_data=false) @@ -66,9 +65,6 @@ vcpkg_configure_meson( ADDITIONAL_BINARIES flex='${FLEX}' bison='${BISON}' - g-ir-annotation-tool='${CURRENT_HOST_INSTALLED_DIR}/tools/gobject-introspection/g-ir-annotation-tool' - g-ir-compiler='${CURRENT_HOST_INSTALLED_DIR}/tools/gobject-introspection/g-ir-compiler${VCPKG_HOST_EXECUTABLE_SUFFIX}' - g-ir-scanner='${CURRENT_HOST_INSTALLED_DIR}/tools/gobject-introspection/g-ir-scanner' ) vcpkg_host_path_list(APPEND ENV{PKG_CONFIG_PATH} "${CURRENT_INSTALLED_DIR}/lib/pkgconfig") diff --git a/ports/gobject-introspection/vcpkg.json b/ports/gobject-introspection/vcpkg.json index a391c9db8ebf28..0a2de8f3d5e083 100644 --- a/ports/gobject-introspection/vcpkg.json +++ b/ports/gobject-introspection/vcpkg.json @@ -5,20 +5,9 @@ "description": "A middleware layer between C libraries (using GObject) and language bindings.", "homepage": "https://gi.readthedocs.io/en/latest/", "license": null, - "supports": "!static & (native | (windows & x86))", + "supports": "!static & native", "dependencies": [ - { - "name": "cairo", - "default-features": false, - "features": [ - "gobject" - ] - }, "glib", - { - "name": "glib", - "host": true - }, { "name": "gobject-introspection", "host": true From e7225fecb19f5bf81cfb9c636064170435950f36 Mon Sep 17 00:00:00 2001 From: Osyotr Date: Fri, 28 Jul 2023 00:26:45 +0300 Subject: [PATCH 35/36] Update versions --- ports/gobject-introspection/vcpkg.json | 2 +- ports/libpq/vcpkg.json | 1 + ports/mdl-sdk/vcpkg.json | 2 +- ports/omniorb/vcpkg.json | 2 +- ports/paraview/vcpkg.json | 2 +- ports/shiva/vcpkg.json | 2 +- ports/vcpkg-get-python-packages/vcpkg.json | 2 +- ports/vtk-dicom/vcpkg.json | 2 +- ports/vtk/vcpkg.json | 2 +- versions/baseline.json | 22 +++++++++++----------- versions/g-/gobject-introspection.json | 5 +++++ versions/l-/libpq.json | 5 +++++ versions/m-/mdl-sdk.json | 5 +++++ versions/o-/omniorb.json | 5 +++++ versions/p-/paraview.json | 5 +++++ versions/p-/python3.json | 5 +++++ versions/s-/shiva.json | 5 +++++ versions/v-/vcpkg-get-python-packages.json | 5 +++++ versions/v-/vtk-dicom.json | 5 +++++ versions/v-/vtk.json | 5 +++++ 20 files changed, 70 insertions(+), 19 deletions(-) diff --git a/ports/gobject-introspection/vcpkg.json b/ports/gobject-introspection/vcpkg.json index 0a2de8f3d5e083..4aacb9d9d1e5f6 100644 --- a/ports/gobject-introspection/vcpkg.json +++ b/ports/gobject-introspection/vcpkg.json @@ -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, diff --git a/ports/libpq/vcpkg.json b/ports/libpq/vcpkg.json index 106e4694a9e65b..3dfcd11b0b3ba5 100644 --- a/ports/libpq/vcpkg.json +++ b/ports/libpq/vcpkg.json @@ -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", diff --git a/ports/mdl-sdk/vcpkg.json b/ports/mdl-sdk/vcpkg.json index 514e56b98490ec..a6d75c9c90227e 100644 --- a/ports/mdl-sdk/vcpkg.json +++ b/ports/mdl-sdk/vcpkg.json @@ -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", diff --git a/ports/omniorb/vcpkg.json b/ports/omniorb/vcpkg.json index 7107c9e1fa26c5..d409fe81694ae9 100644 --- a/ports/omniorb/vcpkg.json +++ b/ports/omniorb/vcpkg.json @@ -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", diff --git a/ports/paraview/vcpkg.json b/ports/paraview/vcpkg.json index a0983cd4d5d42f..03277763a36bf5 100644 --- a/ports/paraview/vcpkg.json +++ b/ports/paraview/vcpkg.json @@ -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", diff --git a/ports/shiva/vcpkg.json b/ports/shiva/vcpkg.json index 65107debfdee91..2b9f53608c5694 100644 --- a/ports/shiva/vcpkg.json +++ b/ports/shiva/vcpkg.json @@ -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", diff --git a/ports/vcpkg-get-python-packages/vcpkg.json b/ports/vcpkg-get-python-packages/vcpkg.json index f2e187d0d3a669..7a2873183ba649 100644 --- a/ports/vcpkg-get-python-packages/vcpkg.json +++ b/ports/vcpkg-get-python-packages/vcpkg.json @@ -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" diff --git a/ports/vtk-dicom/vcpkg.json b/ports/vtk-dicom/vcpkg.json index 3494381588dfbe..b1e6fb6dcb38e7 100644 --- a/ports/vtk-dicom/vcpkg.json +++ b/ports/vtk-dicom/vcpkg.json @@ -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", diff --git a/ports/vtk/vcpkg.json b/ports/vtk/vcpkg.json index 14c85b56d3f73e..cdb7b3f7249666 100644 --- a/ports/vtk/vcpkg.json +++ b/ports/vtk/vcpkg.json @@ -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", diff --git a/versions/baseline.json b/versions/baseline.json index 14180cea9054b6..da9073efda3e29 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2942,7 +2942,7 @@ }, "gobject-introspection": { "baseline": "1.72.0", - "port-version": 3 + "port-version": 4 }, "google-cloud-cpp": { "baseline": "2.13.0", @@ -4474,7 +4474,7 @@ }, "libpq": { "baseline": "15.3", - "port-version": 0 + "port-version": 1 }, "libpqxx": { "baseline": "7.7.4", @@ -5250,7 +5250,7 @@ }, "mdl-sdk": { "baseline": "2021.1.2", - "port-version": 1 + "port-version": 2 }, "mdns": { "baseline": "1.4.2", @@ -5890,7 +5890,7 @@ }, "omniorb": { "baseline": "4.3.0", - "port-version": 1 + "port-version": 2 }, "ompl": { "baseline": "1.5.1", @@ -6218,7 +6218,7 @@ }, "paraview": { "baseline": "5.11.0", - "port-version": 2 + "port-version": 3 }, "parmetis": { "baseline": "2022-07-27", @@ -6577,8 +6577,8 @@ "port-version": 6 }, "python3": { - "baseline": "3.10.7", - "port-version": 7 + "baseline": "3.11.4", + "port-version": 0 }, "qca": { "baseline": "2.3.5", @@ -7530,7 +7530,7 @@ }, "shiva": { "baseline": "1.0", - "port-version": 6 + "port-version": 7 }, "shiva-sfml": { "baseline": "1.0", @@ -8457,7 +8457,7 @@ "port-version": 0 }, "vcpkg-get-python-packages": { - "baseline": "2022-06-30", + "baseline": "2023-07-28", "port-version": 0 }, "vcpkg-gfortran": { @@ -8566,11 +8566,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", diff --git a/versions/g-/gobject-introspection.json b/versions/g-/gobject-introspection.json index 45f3f66d2259bc..c4b18e047e90a0 100644 --- a/versions/g-/gobject-introspection.json +++ b/versions/g-/gobject-introspection.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "20f3467285e0532a9c92d001971046aeefbe5640", + "version": "1.72.0", + "port-version": 4 + }, { "git-tree": "47ab422de57e980b1294daf095a942d3ea36ae98", "version": "1.72.0", diff --git a/versions/l-/libpq.json b/versions/l-/libpq.json index e8c2ad3e18c131..25b1740628cc26 100644 --- a/versions/l-/libpq.json +++ b/versions/l-/libpq.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "a62f65ad38aa981b6ff7474e16f739a3ffbc622b", + "version": "15.3", + "port-version": 1 + }, { "git-tree": "d5388715a119316e407f15a6612bf05d2292d73d", "version": "15.3", diff --git a/versions/m-/mdl-sdk.json b/versions/m-/mdl-sdk.json index b464e3f1aeac54..c470ea7750e017 100644 --- a/versions/m-/mdl-sdk.json +++ b/versions/m-/mdl-sdk.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "04186cc5442b20b27d3a47f901dfd4c7eef16353", + "version": "2021.1.2", + "port-version": 2 + }, { "git-tree": "7b540090b50df32e1bdcab5953994590e0fb37bd", "version": "2021.1.2", diff --git a/versions/o-/omniorb.json b/versions/o-/omniorb.json index 9d85a3b24ab71c..50dbc8ff6039b4 100644 --- a/versions/o-/omniorb.json +++ b/versions/o-/omniorb.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "cca89d0b204e2a74c3e822ef7f8b4878886239d4", + "version": "4.3.0", + "port-version": 2 + }, { "git-tree": "a03b9df1f3ad5b4d5de0b3bc278af0ff52d06703", "version": "4.3.0", diff --git a/versions/p-/paraview.json b/versions/p-/paraview.json index 1282e3075186ea..22ca71bcf73b8f 100644 --- a/versions/p-/paraview.json +++ b/versions/p-/paraview.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "ef783841125e47d511ecc6d0108e7b1ecaef1469", + "version": "5.11.0", + "port-version": 3 + }, { "git-tree": "1b93a58c420dc6478318aba2958a0334a7759b36", "version": "5.11.0", diff --git a/versions/p-/python3.json b/versions/p-/python3.json index 1948646117aa22..093119be4b232b 100644 --- a/versions/p-/python3.json +++ b/versions/p-/python3.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "1ed9aa74ea44d2e4457410ad732d165317c6f8aa", + "version": "3.11.4", + "port-version": 0 + }, { "git-tree": "a0f1ead9323b9521f3c3016469f028be712c0252", "version": "3.10.7", diff --git a/versions/s-/shiva.json b/versions/s-/shiva.json index 25094698859e7c..a476c4e3b65b96 100644 --- a/versions/s-/shiva.json +++ b/versions/s-/shiva.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "f3ad56d6d26b5b6003846ded935d9e5727ed725b", + "version": "1.0", + "port-version": 7 + }, { "git-tree": "1f99562a0a906db852e4ff3a7caf03ad4c4fbcab", "version": "1.0", diff --git a/versions/v-/vcpkg-get-python-packages.json b/versions/v-/vcpkg-get-python-packages.json index e9eced18e60cb1..289a729f8039f4 100644 --- a/versions/v-/vcpkg-get-python-packages.json +++ b/versions/v-/vcpkg-get-python-packages.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "80e0cf9d38d72126b34eb1ee9b33f936c778a696", + "version-date": "2023-07-28", + "port-version": 0 + }, { "git-tree": "e65762bfef05a4d380bb171409c48a694fb35435", "version-date": "2022-06-30", diff --git a/versions/v-/vtk-dicom.json b/versions/v-/vtk-dicom.json index 0dcb284a57b72d..2bd6584a1c72c0 100644 --- a/versions/v-/vtk-dicom.json +++ b/versions/v-/vtk-dicom.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "bbe795fdb0d7be6e03dbe99b4d0670237f088b67", + "version": "0.8.14", + "port-version": 2 + }, { "git-tree": "96d043efb89eb2522af31366de52c340ca5c5193", "version": "0.8.14", diff --git a/versions/v-/vtk.json b/versions/v-/vtk.json index 88b8dc7bfd909d..f9db0e29470dbd 100644 --- a/versions/v-/vtk.json +++ b/versions/v-/vtk.json @@ -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", From a4c1a7c61821a49fe7086390ea095311e7845367 Mon Sep 17 00:00:00 2001 From: Osyotr Date: Fri, 4 Aug 2023 01:44:44 +0300 Subject: [PATCH 36/36] Undo changes in gobject-introspection and vcpkg_find_aquire_program(PYTHON3) --- ports/gobject-introspection/portfile.cmake | 41 ++++--------------- ports/gobject-introspection/vcpkg.json | 13 +++++- .../vcpkg_find_acquire_program(PYTHON3).cmake | 17 +------- versions/g-/gobject-introspection.json | 2 +- 4 files changed, 23 insertions(+), 50 deletions(-) diff --git a/ports/gobject-introspection/portfile.cmake b/ports/gobject-introspection/portfile.cmake index dfe0abf4333f6b..a100fe08f8922d 100644 --- a/ports/gobject-introspection/portfile.cmake +++ b/ports/gobject-introspection/portfile.cmake @@ -21,39 +21,11 @@ vcpkg_extract_source_archive( vcpkg_find_acquire_program(FLEX) vcpkg_find_acquire_program(BISON) -if(VCPKG_TARGET_IS_WINDOWS) - # This is the same check that is used in vcpkg_find_acquire_program(PYTHON3) - if(DEFINED ENV{PROCESSOR_ARCHITEW6432}) - set(_host_arch $ENV{PROCESSOR_ARCHITEW6432}) - else() - set(_host_arch $ENV{PROCESSOR_ARCHITECTURE}) - endif() - - if(_host_arch MATCHES "(x|X)86") - set(_vcpkg_python_host_arch "x86") - elseif(_host_arch MATCHES "(amd|AMD)64") - set(_vcpkg_python_host_arch "x64") - elseif(_host_arch MATCHES "^(ARM|arm)64$") - set(_vcpkg_python_host_arch "arm64") - else() - message(FATAL_ERROR "Unknown architecture ${_host_arch}") - endif() - - if("${_vcpkg_python_host_arch}" STREQUAL "${VCPKG_TARGET_ARCHITECTURE}") - set(_can_build_introspection_data TRUE) - endif() -else() - set(_can_build_introspection_data TRUE) -endif() - -list(APPEND OPTIONS_DEBUG -Dbuild_introspection_data=false) -if(_can_build_introspection_data) - # This option requires running target binaries on host machine) - list(APPEND OPTIONS_RELEASE - -Dbuild_introspection_data=true - ) -else() - list(APPEND OPTIONS_RELEASE -Dbuild_introspection_data=false) +set(OPTIONS_DEBUG -Dbuild_introspection_data=false) +set(OPTIONS_RELEASE -Dbuild_introspection_data=true) +if(VCPKG_CROSSCOMPILING AND + NOT (CMAKE_HOST_WIN32 AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")) + list(APPEND OPTIONS_RELEASE -Dgi_cross_use_prebuilt_gi=true) endif() vcpkg_configure_meson( @@ -65,6 +37,9 @@ vcpkg_configure_meson( ADDITIONAL_BINARIES flex='${FLEX}' bison='${BISON}' + g-ir-annotation-tool='${CURRENT_HOST_INSTALLED_DIR}/tools/gobject-introspection/g-ir-annotation-tool' + g-ir-compiler='${CURRENT_HOST_INSTALLED_DIR}/tools/gobject-introspection/g-ir-compiler${VCPKG_HOST_EXECUTABLE_SUFFIX}' + g-ir-scanner='${CURRENT_HOST_INSTALLED_DIR}/tools/gobject-introspection/g-ir-scanner' ) vcpkg_host_path_list(APPEND ENV{PKG_CONFIG_PATH} "${CURRENT_INSTALLED_DIR}/lib/pkgconfig") diff --git a/ports/gobject-introspection/vcpkg.json b/ports/gobject-introspection/vcpkg.json index 4aacb9d9d1e5f6..783866dbd8eb58 100644 --- a/ports/gobject-introspection/vcpkg.json +++ b/ports/gobject-introspection/vcpkg.json @@ -5,9 +5,20 @@ "description": "A middleware layer between C libraries (using GObject) and language bindings.", "homepage": "https://gi.readthedocs.io/en/latest/", "license": null, - "supports": "!static & native", + "supports": "!static & (native | (windows & x86))", "dependencies": [ + { + "name": "cairo", + "default-features": false, + "features": [ + "gobject" + ] + }, "glib", + { + "name": "glib", + "host": true + }, { "name": "gobject-introspection", "host": true diff --git a/scripts/cmake/vcpkg_find_acquire_program(PYTHON3).cmake b/scripts/cmake/vcpkg_find_acquire_program(PYTHON3).cmake index ecc1255052e7e2..6734b0bb6d35b4 100644 --- a/scripts/cmake/vcpkg_find_acquire_program(PYTHON3).cmake +++ b/scripts/cmake/vcpkg_find_acquire_program(PYTHON3).cmake @@ -1,30 +1,17 @@ if(CMAKE_HOST_WIN32) set(program_name python) set(program_version 3.11.4) - - if(DEFINED ENV{PROCESSOR_ARCHITEW6432}) - set(_host_arch $ENV{PROCESSOR_ARCHITEW6432}) - else() - set(_host_arch $ENV{PROCESSOR_ARCHITECTURE}) - endif() - - if(_host_arch MATCHES "(x|X)86") + 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 4cdbb2efdc7764a87edfb7370716c1caf660d38bce37a280ec59b7aecab5672c5798aabe19a8ae395224bea7dfe644bd92656f0bbc44348717981b45a909c024) - elseif(_host_arch MATCHES "(amd|AMD)64") + 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 3f93c2a16764b9ea6343315b70c0c6319aac8edaefbf4e21206fb30eff365e8fe37264a9133bebe12e664ea5d8fd232d587a5603a51fd96e1252a2fc01a2e550) - elseif(_host_arch MATCHES "^(ARM|arm)64$") - set(tool_subdirectory "python-${program_version}-arm64") - set(download_urls "https://www.python.org/ftp/python/${program_version}/python-${program_version}-embed-arm64.zip") - set(download_filename "python-${program_version}-embed-arm64.zip") - set(download_sha512 65db185ccd2cfeb54f65d568dc857699d47ad8c181be6697d60acf76695a9229e14b77b62c431227d46531c07dba54f4442cae98792f46e64faa053fe0e25b6a) endif() - unset(_host_arch) set(paths_to_search "${DOWNLOADS}/tools/python/${tool_subdirectory}") vcpkg_list(SET post_install_command "${CMAKE_COMMAND}" -E rm python311._pth) diff --git a/versions/g-/gobject-introspection.json b/versions/g-/gobject-introspection.json index c4b18e047e90a0..7c8c7a13b398e5 100644 --- a/versions/g-/gobject-introspection.json +++ b/versions/g-/gobject-introspection.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "20f3467285e0532a9c92d001971046aeefbe5640", + "git-tree": "097d9982b8667ff8d67107e9de262d3900e59631", "version": "1.72.0", "port-version": 4 },