Skip to content

Commit 46068e8

Browse files
authored
[python3] Upgrade to 3.9.0 (#14510)
* [python3] Bump to 3.8.6. * [python3] Bump to 3.9.0. * [itk] Correct python artifact names. * [pybind11] Update python artifact names. * [vcpkg_find_acquire_program] Bump PYTHON3 to 3.9.0.
1 parent e803bf1 commit 46068e8

File tree

9 files changed

+57
-30
lines changed

9 files changed

+57
-30
lines changed

ports/itk/portfile.cmake

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,17 @@ if("python" IN_LIST FEATURES)
110110
)
111111
# Due to ITKs internal shenanigans with the variables ......
112112
if(VCPKG_TARGET_IS_WINDOWS)
113-
list(APPEND ADDITIONAL_OPTIONS "-DPython3_LIBRARY_RELEASE:PATH=${CURRENT_INSTALLED_DIR}/lib/python38.lib"
114-
"-DPython3_LIBRARY_DEBUG:PATH=${CURRENT_INSTALLED_DIR}/debug/lib/python38_d.lib"
115-
"-DPython3_INCLUDE_DIR:PATH=${CURRENT_INSTALLED_DIR}/include/python3.8")
116-
list(APPEND OPTIONS_DEBUG "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/debug/lib/python38_d.lib")
117-
list(APPEND OPTIONS_RELEASE "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/lib/python38.lib")
113+
list(APPEND ADDITIONAL_OPTIONS "-DPython3_LIBRARY_RELEASE:PATH=${CURRENT_INSTALLED_DIR}/lib/python39.lib"
114+
"-DPython3_LIBRARY_DEBUG:PATH=${CURRENT_INSTALLED_DIR}/debug/lib/python39_d.lib"
115+
"-DPython3_INCLUDE_DIR:PATH=${CURRENT_INSTALLED_DIR}/include/python3.9")
116+
list(APPEND OPTIONS_DEBUG "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/debug/lib/python39_d.lib")
117+
list(APPEND OPTIONS_RELEASE "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/lib/python39.lib")
118118
elseif(VCPKG_TARGET_IS_LINUX)
119-
list(APPEND ADDITIONAL_OPTIONS "-DPython3_LIBRARY_RELEASE:PATH=${CURRENT_INSTALLED_DIR}/lib/libpython38m.a"
120-
"-DPython3_LIBRARY_DEBUG:PATH=${CURRENT_INSTALLED_DIR}/debug/lib/libpython38md.a"
121-
"-DPython3_INCLUDE_DIR:PATH=${CURRENT_INSTALLED_DIR}/include/python3.8m")
122-
list(APPEND OPTIONS_DEBUG "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/debug/lib/libpython38md.a")
123-
list(APPEND OPTIONS_RELEASE "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/lib/libpython38m.a")
119+
list(APPEND ADDITIONAL_OPTIONS "-DPython3_LIBRARY_RELEASE:PATH=${CURRENT_INSTALLED_DIR}/lib/libpython39m.a"
120+
"-DPython3_LIBRARY_DEBUG:PATH=${CURRENT_INSTALLED_DIR}/debug/lib/libpython39md.a"
121+
"-DPython3_INCLUDE_DIR:PATH=${CURRENT_INSTALLED_DIR}/include/python3.9m")
122+
list(APPEND OPTIONS_DEBUG "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/debug/lib/libpython39md.a")
123+
list(APPEND OPTIONS_RELEASE "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/lib/libpython39m.a")
124124
elseif(VCPKG_TARGET_IS_OSX)
125125
#Need Python3 information on OSX within VCPKG
126126
endif()

ports/itk/vcpkg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "itk",
33
"version-string": "5.1.0",
4-
"port-version": 3,
4+
"port-version": 4,
55
"description": "Insight Segmentation and Registration Toolkit (ITK) is used for image processing and analysis.",
66
"homepage": "https://github.com/InsightSoftwareConsortium/ITK",
77
"dependencies": [

ports/pybind11/CONTROL

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Source: pybind11
22
Version: 2.6.0
3+
Port-Version: 1
34
Homepage: https://github.com/pybind/pybind11
45
Description: pybind11 is a lightweight header-only library that exposes C++ types in Python and vice versa, mainly to create Python bindings of existing C++ code.
56
Build-Depends: python3 (windows)

ports/pybind11/portfile.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ vcpkg_configure_cmake(
2020
-DPYTHON_MODULE_EXTENSION=.dll
2121
OPTIONS_RELEASE
2222
-DPYTHON_IS_DEBUG=OFF
23-
-DPYTHON_LIBRARIES=${CURRENT_INSTALLED_DIR}/lib/python36.lib
23+
-DPYTHON_LIBRARIES=${CURRENT_INSTALLED_DIR}/lib/python39.lib
2424
OPTIONS_DEBUG
2525
-DPYTHON_IS_DEBUG=ON
26-
-DPYTHON_LIBRARIES=${CURRENT_INSTALLED_DIR}/debug/lib/python36_d.lib
26+
-DPYTHON_LIBRARIES=${CURRENT_INSTALLED_DIR}/debug/lib/python39_d.lib
2727
)
2828

2929
vcpkg_install_cmake()

ports/python3/0001-static-library.patch

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,27 @@
1+
From dffd6c572fb60f955bf3d98a87e5739163ab8f3f Mon Sep 17 00:00:00 2001
2+
From: Adam Johnson <[email protected]>
3+
Date: Thu, 28 May 2020 17:25:21 -0400
4+
Subject: [PATCH 1/2] static library
5+
6+
builds the pythoncore as a static library instead of a DLL
7+
---
8+
PC/pyconfig.h | 6 ++++++
9+
PCbuild/pythoncore.vcxproj | 16 ++++++++++++++--
10+
2 files changed, 20 insertions(+), 2 deletions(-)
11+
112
diff --git a/PC/pyconfig.h b/PC/pyconfig.h
2-
index b6b8d445869bc..35b329f307c12 100644
13+
index 02216b5068..d359c884e2 100644
314
--- a/PC/pyconfig.h
415
+++ b/PC/pyconfig.h
5-
@@ -257,6 +257,7 @@ typedef int pid_t;
16+
@@ -252,6 +252,7 @@ typedef int pid_t;
617

718
/* For Windows the Python core is in a DLL by default. Test
819
Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
920
+#define Py_NO_ENABLE_SHARED
1021
#if !defined(MS_NO_COREDLL) && !defined(Py_NO_ENABLE_SHARED)
1122
# define Py_ENABLE_SHARED 1 /* standard symbol for shared library */
1223
# define MS_COREDLL /* deprecated old symbol */
13-
@@ -282,6 +283,11 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
24+
@@ -277,6 +278,11 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
1425
# endif /* _DEBUG */
1526
# endif /* _MSC_VER */
1627
# endif /* Py_BUILD_CORE */
@@ -23,7 +34,7 @@ index b6b8d445869bc..35b329f307c12 100644
2334

2435
#if defined(MS_WIN64)
2536
diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj
26-
index 0666b90f66cc9..ca83b82d8a0fe 100644
37+
index 2625d0293d..dbe236829a 100644
2738
--- a/PCbuild/pythoncore.vcxproj
2839
+++ b/PCbuild/pythoncore.vcxproj
2940
@@ -73,7 +73,7 @@
@@ -44,7 +55,7 @@ index 0666b90f66cc9..ca83b82d8a0fe 100644
4455
<PreprocessorDefinitions Condition="$(IncludeExternals)">_Py_HAVE_ZLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
4556
</ClCompile>
4657
<Link>
47-
<AdditionalDependencies>version.lib;shlwapi.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
58+
<AdditionalDependencies>version.lib;shlwapi.lib;ws2_32.lib;pathcch.lib;%(AdditionalDependencies)</AdditionalDependencies>
4859
</Link>
4960
+ <Lib>
5061
+ <TargetMachine Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">MachineX86</TargetMachine>
@@ -60,4 +71,7 @@ index 0666b90f66cc9..ca83b82d8a0fe 100644
6071
+ </Lib>
6172
</ItemDefinitionGroup>
6273
<ItemGroup>
63-
<ClInclude Include="..\Include\abstract.h" />
74+
<ClInclude Include="..\Include\Python-ast.h" />
75+
--
76+
2.28.0.windows.1
77+

ports/python3/0002-static-crt.patch

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1+
From 28fe1e90fc4d34381553b7faf2f4c331bcaef669 Mon Sep 17 00:00:00 2001
2+
From: Adam Johnson <[email protected]>
3+
Date: Thu, 28 May 2020 17:36:31 -0400
4+
Subject: [PATCH 2/2] static crt
5+
6+
changes crt linkage of pythoncore to static.
7+
---
8+
PCbuild/pythoncore.vcxproj | 4 ++++
9+
1 file changed, 4 insertions(+)
10+
111
diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj
2-
index ca83b82d8a0fe..b925a26a96e5e 100644
12+
index dbe236829a..1a4ddb5cea 100644
313
--- a/PCbuild/pythoncore.vcxproj
414
+++ b/PCbuild/pythoncore.vcxproj
515
@@ -104,6 +104,10 @@
@@ -12,4 +22,7 @@ index ca83b82d8a0fe..b925a26a96e5e 100644
1222
+ <RuntimeLibrary Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MultiThreaded</RuntimeLibrary>
1323
</ClCompile>
1424
<Link>
15-
<AdditionalDependencies>version.lib;shlwapi.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
25+
<AdditionalDependencies>version.lib;shlwapi.lib;ws2_32.lib;pathcch.lib;%(AdditionalDependencies)</AdditionalDependencies>
26+
--
27+
2.28.0.windows.1
28+

ports/python3/CONTROL

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
Source: python3
2-
Version: 3.8.3
3-
Port-Version: 2
2+
Version: 3.9.0
43
Homepage: https://github.com/python/cpython
54
Description: The Python programming language as an embeddable library
65
Build-Depends: libffi, openssl, zlib (!uwp&!windows)

ports/python3/portfile.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic AND VCPKG_CRT_LINKAGE STREQUAL static
44
endif()
55

66
set(PYTHON_VERSION_MAJOR 3)
7-
set(PYTHON_VERSION_MINOR 8)
8-
set(PYTHON_VERSION_PATCH 3)
7+
set(PYTHON_VERSION_MINOR 9)
8+
set(PYTHON_VERSION_PATCH 0)
99
set(PYTHON_VERSION ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.${PYTHON_VERSION_PATCH})
1010

1111
if(VCPKG_TARGET_IS_WINDOWS)
@@ -21,7 +21,7 @@ vcpkg_from_github(
2121
OUT_SOURCE_PATH TEMP_SOURCE_PATH
2222
REPO python/cpython
2323
REF v${PYTHON_VERSION}
24-
SHA512 eb264a858ef55f2f61b53f663454be6e99ffe9035d8fcdb3366d7a08fd3b295613e5d15e93e2e4b9b18ad297d8c17139bde5e90e396db04fe04c6f441a443fd2
24+
SHA512 39d304cae181674c4872c63768c0e5aeace2c92eb6d5ea550428d65c8571bc60922b3a3d484b51c46b466aadb7e27500559cafec13a489b48613bbb3fe6a5a5d
2525
HEAD_REF master
2626
PATCHES ${PATCHES}
2727
)

scripts/cmake/vcpkg_find_acquire_program.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,20 +147,20 @@ function(vcpkg_find_acquire_program VAR)
147147
elseif(VAR MATCHES "PYTHON3")
148148
if(CMAKE_HOST_WIN32)
149149
set(PROGNAME python)
150-
set(PYTHON_VERSION 3.8.3)
150+
set(PYTHON_VERSION 3.9.0)
151151
if (VCPKG_TARGET_ARCHITECTURE STREQUAL x86)
152152
set(SUBDIR "python-${PYTHON_VERSION}-x86")
153153
set(URL "https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-embed-win32.zip")
154154
set(ARCHIVE "python-${PYTHON_VERSION}-embed-win32.zip")
155-
set(HASH 8c9078f55b1b5d694e0e809eee6ccf8a6e15810dd4649e8ae1209bff30e102d49546ce970a5d519349ca7759d93146f459c316dc440737171f018600255dcd0a)
155+
set(HASH 1501ad0b3ed1053466bef303e639c4d5cd9c270beacd07d70fb631db15503ea9e1f9de054cafe8759403e77aa898cd8b8878bf9024add4c081b28a4c5a9947ed)
156156
else()
157157
set(SUBDIR "python-${PYTHON_VERSION}-x64")
158158
set(URL "https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-embed-amd64.zip")
159159
set(ARCHIVE "python-${PYTHON_VERSION}-embed-amd64.zip")
160-
set(HASH a322fc925167edb1897764297cf47e294ad3f52c109a05f8911412807eb83e104f780e9fe783b17fe0d9b18b7838797c15e9b0805dab759829f77a9bc0159424)
160+
set(HASH e969622b74ea79a6adcf41b4d628bd80c9320df2f3d797905872610172838f1ab70d9bb0c70fcf7da396e03c3a73de96fa69a4b212b26f97de0e4f3366accf51)
161161
endif()
162162
set(PATHS ${DOWNLOADS}/tools/python/${SUBDIR})
163-
set(POST_INSTALL_COMMAND ${CMAKE_COMMAND} -E remove python38._pth)
163+
set(POST_INSTALL_COMMAND ${CMAKE_COMMAND} -E rm python39._pth)
164164
else()
165165
set(PROGNAME python3)
166166
set(BREW_PACKAGE_NAME "python")

0 commit comments

Comments
 (0)