Skip to content

Commit ce613c4

Browse files
authored
[python3] Update to 3.12.9, drop Windows 7 support (#40996)
1 parent e1877ab commit ce613c4

29 files changed

+124
-554
lines changed

ports/gobject-introspection/0001-g-ir-tool-template.in.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--- a/tools/g-ir-tool-template.in 2021-09-17 23:02:42.601052000 +0700
22
+++ b/tools/g-ir-tool-template.in 2021-12-29 21:41:52.987141900 +0700
33
@@ -59,7 +59,7 @@
4-
builtins.__dict__['GIRDIR'] = [girdir]
4+
builtins.__dict__['GIR_DIR'] = gir_dir
55

66
# Again, relative paths first so that the installation prefix is relocatable
77
-pylibdir = os.path.abspath(os.path.join(filedir, '..', 'lib', 'gobject-introspection'))

ports/gobject-introspection/0002-cross-build.patch

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--- a/gir/meson.build 2021-09-17 23:02:42.502052000 +0700
22
+++ b/gir/meson.build 2022-01-05 02:31:25.960457800 +0700
33
@@ -42,7 +42,7 @@
4-
install_data(gir_files, install_dir: girdir)
4+
install_data(installed_gir_files, install_dir: girdir)
55

66
scanner_command = [
77
- find_program('g-ir-scanner', native: true),
@@ -15,11 +15,11 @@
1515
typelibs = []
1616
+gircompiler = find_program('g-ir-compiler')
1717
if get_option('gi_cross_binary_wrapper') != ''
18-
gircompiler_command = [get_option('gi_cross_binary_wrapper'), gircompiler.full_path(), ]
18+
gircompiler_command = [get_option('gi_cross_binary_wrapper'), gircompiler.full_path(), ]
1919
else
2020
@@ -510,7 +511,7 @@
21-
typelibs += custom_target('generate-typelib-@0@'.format(gir).underscorify(),
22-
input: gir,
21+
typelibs += custom_target(
22+
input: gir.get('file'),
2323
output: '@[email protected]',
2424
- depends: [gobject_gir, gircompiler, ],
2525
+ depends: [gobject_gir, ],
@@ -39,7 +39,7 @@
3939

4040
girgenerate = executable('g-ir-generate', 'generate.c',
4141
dependencies: [
42-
@@ -74,11 +76,15 @@
42+
@@ -74,14 +76,18 @@
4343
install: true,
4444
c_args: custom_c_args,
4545
)
@@ -49,7 +49,10 @@
4949
+endif
5050

5151
girinspect = executable('g-ir-inspect', 'g-ir-inspect.c',
52-
dependencies: girepo_dep,
52+
dependencies: [
53+
girepo_dep,
54+
gio_dep,
55+
],
5356
install: true,
5457
c_args: custom_c_args,
5558
)

ports/gobject-introspection/0003-fix-paths.patch

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,15 @@ index 75c35a7..499ed01 100644
1111
# Fallback to hard-coded paths if the relocatable paths are wrong
1212
if not os.path.isdir(os.path.join(datadir, 'gir-1.0')):
1313
datadir = "@datarootdir@"
14-
@@ -55,7 +55,7 @@ builtins.__dict__['DATADIR'] = datadir
14+
@@ -53,10 +53,7 @@ builtins.__dict__['DATADIR'] = datadir
1515

16-
# Respect gir_dir_prefix
17-
girdir = ''
18-
-girdir = os.path.abspath(os.path.join(filedir, '..', '@gir_dir_prefix@'))
19-
+girdir = datadir
20-
builtins.__dict__['GIRDIR'] = [girdir]
16+
builtins.__dict__['DATADIR'] = datadir
17+
18+
-gir_dir = os.path.abspath(os.path.join(filedir, '..', '@gir_dir_prefix@', 'gir-1.0'))
19+
-# Fallback to hard-coded paths if the relocatable paths are wrong
20+
-if not os.path.isdir(gir_dir):
21+
- gir_dir = "@GIR_DIR@"
22+
+gir_dir = datadir
23+
24+
builtins.__dict__['GIR_DIR'] = gir_dir
2125

22-
# Again, relative paths first so that the installation prefix is relocatable
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/giscanner/scannerlexer.l b/giscanner/scannerlexer.l
2+
index 38e21534edfa6c92f2ecb6c8a68b6d0360c21c64..4ca62d21f8fa8e663db152415d0ef85cfe6107f5 100644
3+
--- a/giscanner/scannerlexer.l
4+
+++ b/giscanner/scannerlexer.l
5+
@@ -193,6 +193,7 @@ stringtext ([^\\\"])|(\\.)
6+
"__declspec(deprecated(".*"))" { /* Ignore */ }
7+
"__declspec"[\t ]*"("[a-z\t ]+")" { /* Ignore */ }
8+
"__stdcall" { /* ignore */ }
9+
+"__fastcall" { /* ignore */ }
10+
"__w64" { /* ignore */ }
11+
12+
"G_GINT64_CONSTANT" { return INTL_CONST; }

ports/gobject-introspection/fix-pkgconfig.patch

Lines changed: 0 additions & 11 deletions
This file was deleted.

ports/gobject-introspection/portfile.cmake

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
2-
set(GI_MAJOR_MINOR 1.72)
1+
# vcpkg_from_* is not used because the project uses submodules.
2+
string(REGEX MATCH "^([0-9]*[.][0-9]*)" GI_MAJOR_MINOR "${VERSION}")
33
set(GI_PATCH 0)
44

55
vcpkg_download_distfile(ARCHIVE
6-
URLS "https://download.gnome.org/sources/gobject-introspection/${GI_MAJOR_MINOR}/gobject-introspection-${GI_MAJOR_MINOR}.${GI_PATCH}.tar.xz"
7-
FILENAME "gobject-introspection-${GI_MAJOR_MINOR}.${GI_PATCH}.tar.xz"
8-
SHA512 b8fba2bd12e93776c55228acf3487bef36ee40b1abdc7f681b827780ac94a8bfa1f59b0c30d60fa5a1fea2f610de78b9e52029f411128067808f17eb6374cdc5
6+
URLS "https://download.gnome.org/sources/gobject-introspection/${GI_MAJOR_MINOR}/gobject-introspection-${VERSION}.tar.xz"
7+
FILENAME "gobject-introspection-${VERSION}.tar.xz"
8+
SHA512 e139fadb4174c72b648914f3774d89fc0e5eaee45bba0c13edf05de883664dad8276dbc34006217bb09871ed4bad23adab51ff232a17b9eb131329b2926cafb7
99
)
1010

1111
vcpkg_extract_source_archive(
@@ -15,7 +15,7 @@ vcpkg_extract_source_archive(
1515
0001-g-ir-tool-template.in.patch
1616
0002-cross-build.patch
1717
0003-fix-paths.patch
18-
fix-pkgconfig.patch
18+
0004-fastcall.patch # https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/498
1919
)
2020

2121
vcpkg_find_acquire_program(FLEX)
@@ -34,6 +34,18 @@ else()
3434
endif()
3535
endif()
3636

37+
find_file(INITIAL_PYTHON3
38+
NAMES "python3${VCPKG_HOST_EXECUTABLE_SUFFIX}" "python${VCPKG_HOST_EXECUTABLE_SUFFIX}"
39+
PATHS "${PYTHON_DIR}/tools/python3"
40+
NO_DEFAULT_PATH
41+
REQUIRED
42+
)
43+
x_vcpkg_get_python_packages(OUT_PYTHON_VAR PYTHON3
44+
PYTHON_EXECUTABLE "${INITIAL_PYTHON3}"
45+
PYTHON_VERSION "3"
46+
PACKAGES setuptools
47+
)
48+
3749
vcpkg_configure_meson(
3850
SOURCE_PATH "${SOURCE_PATH}"
3951
OPTIONS_DEBUG
@@ -46,7 +58,7 @@ vcpkg_configure_meson(
4658
g-ir-annotation-tool='${CURRENT_HOST_INSTALLED_DIR}/tools/gobject-introspection/g-ir-annotation-tool'
4759
g-ir-compiler='${CURRENT_HOST_INSTALLED_DIR}/tools/gobject-introspection/g-ir-compiler${VCPKG_HOST_EXECUTABLE_SUFFIX}'
4860
g-ir-scanner='${CURRENT_HOST_INSTALLED_DIR}/tools/gobject-introspection/g-ir-scanner'
49-
python='${PYTHON_DIR}/tools/python3/python${VCPKG_HOST_EXECUTABLE_SUFFIX}'
61+
python='${PYTHON3}'
5062
)
5163

5264
vcpkg_host_path_list(APPEND ENV{PKG_CONFIG_PATH} "${CURRENT_INSTALLED_DIR}/lib/pkgconfig")

ports/gobject-introspection/vcpkg.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"name": "gobject-introspection",
3-
"version": "1.72.0",
4-
"port-version": 9,
3+
"version": "1.82.0",
54
"description": "A middleware layer between C libraries (using GObject) and language bindings.",
65
"homepage": "https://gi.readthedocs.io/en/latest/",
76
"license": null,
@@ -31,6 +30,10 @@
3130
"host": true,
3231
"platform": "!(windows & x86)"
3332
},
33+
{
34+
"name": "vcpkg-get-python-packages",
35+
"host": true
36+
},
3437
{
3538
"name": "vcpkg-tool-meson",
3639
"host": true

ports/omniorb/portfile.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
vcpkg_download_distfile(ARCHIVE
2-
URLS "https://netcologne.dl.sourceforge.net/project/omniorb/omniORB/omniORB-4.3.0/omniORB-4.3.0.tar.bz2"
2+
URLS "https://netcologne.dl.sourceforge.net/project/omniorb/omniORB/omniORB-${VERSION}/omniORB-${VERSION}.tar.bz2"
33
FILENAME "omniORB-${VERSION}.tar.bz2"
44
SHA512 b081c1acbea3c7bee619a288fec209a0705b7d436f8e5fd4743675046356ef271a8c75882334fcbde4ff77d15f54d2da55f6cfcd117b01e42919d04fd29bfe2f
55
)

ports/omniorb/python-fixes.patch

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@ diff --git a/mk/python.mk b/mk/python.mk
22
index 1380018..fb321a5 100644
33
--- a/mk/python.mk
44
+++ b/mk/python.mk
5-
@@ -4,7 +4,7 @@
5+
@@ -3,10 +3,10 @@
6+
#############################################################################
67

78
PYVERSION := $(shell $(PYTHON) -c 'import sys; sys.stdout.write(".".join(sys.version.split(".")[:2]))')
8-
PYPREFIX := $(shell $(PYTHON) -c 'import sys; sys.stdout.write(sys.exec_prefix.replace("\\","/"))')
9+
-PYPREFIX := $(shell $(PYTHON) -c 'import sys; sys.stdout.write(sys.exec_prefix.replace("\\","/"))')
910
-PYINCDIR := $(shell $(PYTHON) -c 'import sys, distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_inc().replace("\\","/"))')
11+
+PYPREFIX := $(shell $(PYTHON) -c 'import sys; sys.stdout.write(sys.exec_prefix.replace("\\","/").replace(" ","\\ "))')
1012
+PYINCDIR := $(includedir)/python$(PYVERSION)
1113

12-
PythonSHAREDLIB_SUFFIX = $(shell $(PYTHON) -c 'import sys, distutils.sysconfig; sys.stdout.write((distutils.sysconfig.get_config_var("SO") or ".so").lstrip("."))')
14+
-PythonSHAREDLIB_SUFFIX = $(shell $(PYTHON) -c 'import sys, distutils.sysconfig; sys.stdout.write((distutils.sysconfig.get_config_var("SO") or ".so").lstrip("."))')
15+
+PythonSHAREDLIB_SUFFIX = $(shell $(PYTHON) -c 'import sys, sysconfig; sys.stdout.write((sysconfig.get_config_var("SO") or ".so").lstrip("."))')
16+
17+
PY_MODULE_SUFFIX := $(shell $(PYTHON) -c 'import sys; sys.stdout.write((sys.hexversion < 0x3000000 and not hasattr(sys, "pypy_version_info")) and "module" or "")')
1318

1419
diff --git a/src/tool/omniidl/cxx/idlpython.cc b/src/tool/omniidl/cxx/idlpython.cc
1520
index 639515105..27ad3ee0e 100644

ports/omniorb/vcpkg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "omniorb",
33
"version": "4.3.0",
4-
"port-version": 3,
4+
"port-version": 4,
55
"description": "omniORB is a robust high performance CORBA ORB for C++",
66
"homepage": "https://omniorb.sourceforge.io/",
77
"license": "LGPL-2.1-or-later",

ports/python3/0001-only-build-required-projects.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ index 4d416c589e..ede9868a8f 100644
3636
- <Projects Include="pyshellext.vcxproj" />
3737
+ <Projects Include="pyshellext.vcxproj" Condition="false" />
3838
<!-- Extension modules -->
39-
<ExtensionModules Include="_asyncio;_zoneinfo;_decimal;_elementtree;_msi;_multiprocessing;_overlapped;pyexpat;_queue;select;unicodedata;winsound;_uuid" />
39+
<ExtensionModules Include="_asyncio;_zoneinfo;_decimal;_elementtree;_msi;_multiprocessing;_overlapped;pyexpat;_queue;select;unicodedata;winsound;_uuid;_wmi" />
4040
<ExtensionModules Include="_ctypes" Condition="$(IncludeCTypes)" />
4141
<!-- Extension modules that require external sources -->
4242
<ExternalModules Include="_bz2;_lzma;_sqlite3" />

ports/python3/0002-static-library.patch

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,6 @@ builds the pythoncore as a static library instead of a DLL
99
PCbuild/pythoncore.vcxproj | 4 ++--
1010
2 files changed, 11 insertions(+), 2 deletions(-)
1111

12-
diff --git a/Modules/getpath.c b/Modules/getpath.c
13-
index d7d3cf081e..34269f0b75 100644
14-
--- a/Modules/getpath.c
15-
+++ b/Modules/getpath.c
16-
@@ -801,10 +801,12 @@ static int
17-
library_to_dict(PyObject *dict, const char *key)
18-
{
19-
#ifdef MS_WINDOWS
20-
+#ifdef Py_ENABLE_SHARED
21-
extern HMODULE PyWin_DLLhModule;
22-
if (PyWin_DLLhModule) {
23-
return winmodule_to_dict(dict, key, PyWin_DLLhModule);
24-
}
25-
+#endif
26-
#elif defined(WITH_NEXT_FRAMEWORK)
27-
static char modPath[MAXPATHLEN + 1];
28-
static int modPathInitialized = -1;
2912
diff --git a/PC/pyconfig.h b/PC/pyconfig.h
3013
index d7d3cf081e..34269f0b75 100644
3114
--- a/PC/pyconfig.h
@@ -55,7 +38,7 @@ index d7d3cf081e..34269f0b75 100644
5538
+# endif /* Py_WINVER */
5639
#endif /* MS_COREDLL */
5740

58-
#if defined(MS_WIN64)
41+
#ifdef MS_WIN64
5942
diff --git a/PCbuild/pcbuild.proj b/PCbuild/pcbuild.proj
6043
index 70c336a9d3..ba797e8afd 100644
6144
--- a/PCbuild/pcbuild.proj
@@ -84,7 +67,7 @@ index 2625d0293d..2f8bdaa931 100644
8467
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
8568
@@ -102,7 +102,7 @@
8669
<AdditionalOptions>/Zm200 %(AdditionalOptions)</AdditionalOptions>
87-
<AdditionalIncludeDirectories>$(PySourcePath)Python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
70+
<AdditionalIncludeDirectories>$(PySourcePath)Modules\_hacl\include;$(PySourcePath)Modules\_hacl\internal;$(PySourcePath)Python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
8871
<AdditionalIncludeDirectories Condition="$(IncludeExternals)">$(zlibDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
8972
- <PreprocessorDefinitions>_USRDLL;Py_BUILD_CORE;Py_BUILD_CORE_BUILTIN;Py_ENABLE_SHARED;MS_DLL_ID="$(SysWinVer)";%(PreprocessorDefinitions)</PreprocessorDefinitions>
9073
+ <PreprocessorDefinitions>_USRDLL;Py_BUILD_CORE;Py_BUILD_CORE_BUILTIN;MS_DLL_ID="$(SysWinVer)";%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -104,36 +87,6 @@ index 2625d0293d..2f8bdaa931 100644
10487
<Optimization>Disabled</Optimization>
10588
<WholeProgramOptimization>false</WholeProgramOptimization>
10689
</ClCompile>
107-
diff --git a/Python/dynload_win.c b/Python/dynload_win.c
108-
index ac49f7867a..f3583345ff 100644
109-
--- a/Python/dynload_win.c
110-
+++ b/Python/dynload_win.c
111-
@@ -163,6 +163,7 @@ static char *GetPythonImport (HINSTANCE hModule)
112-
return NULL;
113-
}
114-
115-
+#ifdef Py_ENABLE_SHARED
116-
/* Load python3.dll before loading any extension module that might refer
117-
to it. That way, we can be sure that always the python3.dll corresponding
118-
to this python DLL is loaded, not a python3.dll that might be on the path
119-
@@ -216,6 +217,7 @@ _Py_CheckPython3(void)
120-
return hPython3 != NULL;
121-
#undef MAXPATHLEN
122-
}
123-
+#endif /* Py_ENABLE_SHARED */
124-
125-
dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix,
126-
const char *shortname,
127-
@@ -224,7 +226,9 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix,
128-
dl_funcptr p;
129-
char funcname[258], *import_python;
130-
131-
+#ifdef Py_ENABLE_SHARED
132-
_Py_CheckPython3();
133-
+#endif /* Py_ENABLE_SHARED */
134-
135-
#if USE_UNICODE_WCHAR_CACHE
136-
const wchar_t *wpathname = _PyUnicode_AsUnicode(pathname);
13790
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
13891
index ac49f7867a..f3583345ff 100644
13992
--- a/Python/sysmodule.c

0 commit comments

Comments
 (0)