Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[python3] Upgrade to 3.9.0 #14510

Merged
merged 7 commits into from
Nov 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions ports/itk/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,17 @@ if("python" IN_LIST FEATURES)
)
# Due to ITKs internal shenanigans with the variables ......
if(VCPKG_TARGET_IS_WINDOWS)
list(APPEND ADDITIONAL_OPTIONS "-DPython3_LIBRARY_RELEASE:PATH=${CURRENT_INSTALLED_DIR}/lib/python38.lib"
"-DPython3_LIBRARY_DEBUG:PATH=${CURRENT_INSTALLED_DIR}/debug/lib/python38_d.lib"
"-DPython3_INCLUDE_DIR:PATH=${CURRENT_INSTALLED_DIR}/include/python3.8")
list(APPEND OPTIONS_DEBUG "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/debug/lib/python38_d.lib")
list(APPEND OPTIONS_RELEASE "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/lib/python38.lib")
list(APPEND ADDITIONAL_OPTIONS "-DPython3_LIBRARY_RELEASE:PATH=${CURRENT_INSTALLED_DIR}/lib/python39.lib"
"-DPython3_LIBRARY_DEBUG:PATH=${CURRENT_INSTALLED_DIR}/debug/lib/python39_d.lib"
"-DPython3_INCLUDE_DIR:PATH=${CURRENT_INSTALLED_DIR}/include/python3.9")
list(APPEND OPTIONS_DEBUG "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/debug/lib/python39_d.lib")
list(APPEND OPTIONS_RELEASE "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/lib/python39.lib")
elseif(VCPKG_TARGET_IS_LINUX)
list(APPEND ADDITIONAL_OPTIONS "-DPython3_LIBRARY_RELEASE:PATH=${CURRENT_INSTALLED_DIR}/lib/libpython38m.a"
"-DPython3_LIBRARY_DEBUG:PATH=${CURRENT_INSTALLED_DIR}/debug/lib/libpython38md.a"
"-DPython3_INCLUDE_DIR:PATH=${CURRENT_INSTALLED_DIR}/include/python3.8m")
list(APPEND OPTIONS_DEBUG "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/debug/lib/libpython38md.a")
list(APPEND OPTIONS_RELEASE "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/lib/libpython38m.a")
list(APPEND ADDITIONAL_OPTIONS "-DPython3_LIBRARY_RELEASE:PATH=${CURRENT_INSTALLED_DIR}/lib/libpython39m.a"
"-DPython3_LIBRARY_DEBUG:PATH=${CURRENT_INSTALLED_DIR}/debug/lib/libpython39md.a"
"-DPython3_INCLUDE_DIR:PATH=${CURRENT_INSTALLED_DIR}/include/python3.9m")
list(APPEND OPTIONS_DEBUG "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/debug/lib/libpython39md.a")
list(APPEND OPTIONS_RELEASE "-DPython3_LIBRARY=${CURRENT_INSTALLED_DIR}/lib/libpython39m.a")
elseif(VCPKG_TARGET_IS_OSX)
#Need Python3 information on OSX within VCPKG
endif()
Expand Down
2 changes: 1 addition & 1 deletion ports/itk/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "itk",
"version-string": "5.1.0",
"port-version": 3,
"port-version": 4,
"description": "Insight Segmentation and Registration Toolkit (ITK) is used for image processing and analysis.",
"homepage": "https://github.com/InsightSoftwareConsortium/ITK",
"dependencies": [
Expand Down
1 change: 1 addition & 0 deletions ports/pybind11/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Source: pybind11
Version: 2.6.0
Port-Version: 1
Homepage: https://github.com/pybind/pybind11
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.
Build-Depends: python3 (windows)
4 changes: 2 additions & 2 deletions ports/pybind11/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ vcpkg_configure_cmake(
-DPYTHON_MODULE_EXTENSION=.dll
OPTIONS_RELEASE
-DPYTHON_IS_DEBUG=OFF
-DPYTHON_LIBRARIES=${CURRENT_INSTALLED_DIR}/lib/python36.lib
-DPYTHON_LIBRARIES=${CURRENT_INSTALLED_DIR}/lib/python39.lib
OPTIONS_DEBUG
-DPYTHON_IS_DEBUG=ON
-DPYTHON_LIBRARIES=${CURRENT_INSTALLED_DIR}/debug/lib/python36_d.lib
-DPYTHON_LIBRARIES=${CURRENT_INSTALLED_DIR}/debug/lib/python39_d.lib
)

vcpkg_install_cmake()
Expand Down
26 changes: 20 additions & 6 deletions ports/python3/0001-static-library.patch
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
From dffd6c572fb60f955bf3d98a87e5739163ab8f3f Mon Sep 17 00:00:00 2001
From: Adam Johnson <[email protected]>
Date: Thu, 28 May 2020 17:25:21 -0400
Subject: [PATCH 1/2] static library

builds the pythoncore as a static library instead of a DLL
---
PC/pyconfig.h | 6 ++++++
PCbuild/pythoncore.vcxproj | 16 ++++++++++++++--
2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/PC/pyconfig.h b/PC/pyconfig.h
index b6b8d445869bc..35b329f307c12 100644
index 02216b5068..d359c884e2 100644
--- a/PC/pyconfig.h
+++ b/PC/pyconfig.h
@@ -257,6 +257,7 @@ typedef int pid_t;
@@ -252,6 +252,7 @@ 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 */
+#define Py_NO_ENABLE_SHARED
#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 */
@@ -282,6 +283,11 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
@@ -277,6 +278,11 @@ 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 */
Expand All @@ -23,7 +34,7 @@ index b6b8d445869bc..35b329f307c12 100644

#if defined(MS_WIN64)
diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj
index 0666b90f66cc9..ca83b82d8a0fe 100644
index 2625d0293d..dbe236829a 100644
--- a/PCbuild/pythoncore.vcxproj
+++ b/PCbuild/pythoncore.vcxproj
@@ -73,7 +73,7 @@
Expand All @@ -44,7 +55,7 @@ index 0666b90f66cc9..ca83b82d8a0fe 100644
<PreprocessorDefinitions Condition="$(IncludeExternals)">_Py_HAVE_ZLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalDependencies>version.lib;shlwapi.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>version.lib;shlwapi.lib;ws2_32.lib;pathcch.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
+ <Lib>
+ <TargetMachine Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">MachineX86</TargetMachine>
Expand All @@ -60,4 +71,7 @@ index 0666b90f66cc9..ca83b82d8a0fe 100644
+ </Lib>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\Include\abstract.h" />
<ClInclude Include="..\Include\Python-ast.h" />
--
2.28.0.windows.1

17 changes: 15 additions & 2 deletions ports/python3/0002-static-crt.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
From 28fe1e90fc4d34381553b7faf2f4c331bcaef669 Mon Sep 17 00:00:00 2001
From: Adam Johnson <[email protected]>
Date: Thu, 28 May 2020 17:36:31 -0400
Subject: [PATCH 2/2] static crt

changes crt linkage of pythoncore to static.
---
PCbuild/pythoncore.vcxproj | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj
index ca83b82d8a0fe..b925a26a96e5e 100644
index dbe236829a..1a4ddb5cea 100644
--- a/PCbuild/pythoncore.vcxproj
+++ b/PCbuild/pythoncore.vcxproj
@@ -104,6 +104,10 @@
Expand All @@ -12,4 +22,7 @@ index ca83b82d8a0fe..b925a26a96e5e 100644
+ <RuntimeLibrary Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<AdditionalDependencies>version.lib;shlwapi.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>version.lib;shlwapi.lib;ws2_32.lib;pathcch.lib;%(AdditionalDependencies)</AdditionalDependencies>
--
2.28.0.windows.1

3 changes: 1 addition & 2 deletions ports/python3/CONTROL
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Source: python3
Version: 3.8.3
Port-Version: 2
Version: 3.9.0
Homepage: https://github.com/python/cpython
Description: The Python programming language as an embeddable library
Build-Depends: libffi, openssl, zlib (!uwp&!windows)
Expand Down
6 changes: 3 additions & 3 deletions ports/python3/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic AND VCPKG_CRT_LINKAGE STREQUAL static
endif()

set(PYTHON_VERSION_MAJOR 3)
set(PYTHON_VERSION_MINOR 8)
set(PYTHON_VERSION_PATCH 3)
set(PYTHON_VERSION_MINOR 9)
set(PYTHON_VERSION_PATCH 0)
set(PYTHON_VERSION ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.${PYTHON_VERSION_PATCH})

if(VCPKG_TARGET_IS_WINDOWS)
Expand All @@ -21,7 +21,7 @@ vcpkg_from_github(
OUT_SOURCE_PATH TEMP_SOURCE_PATH
REPO python/cpython
REF v${PYTHON_VERSION}
SHA512 eb264a858ef55f2f61b53f663454be6e99ffe9035d8fcdb3366d7a08fd3b295613e5d15e93e2e4b9b18ad297d8c17139bde5e90e396db04fe04c6f441a443fd2
SHA512 39d304cae181674c4872c63768c0e5aeace2c92eb6d5ea550428d65c8571bc60922b3a3d484b51c46b466aadb7e27500559cafec13a489b48613bbb3fe6a5a5d
HEAD_REF master
PATCHES ${PATCHES}
)
Expand Down
8 changes: 4 additions & 4 deletions scripts/cmake/vcpkg_find_acquire_program.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -147,20 +147,20 @@ function(vcpkg_find_acquire_program VAR)
elseif(VAR MATCHES "PYTHON3")
if(CMAKE_HOST_WIN32)
set(PROGNAME python)
set(PYTHON_VERSION 3.8.3)
set(PYTHON_VERSION 3.9.0)
if (VCPKG_TARGET_ARCHITECTURE STREQUAL x86)
set(SUBDIR "python-${PYTHON_VERSION}-x86")
set(URL "https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-embed-win32.zip")
set(ARCHIVE "python-${PYTHON_VERSION}-embed-win32.zip")
set(HASH 8c9078f55b1b5d694e0e809eee6ccf8a6e15810dd4649e8ae1209bff30e102d49546ce970a5d519349ca7759d93146f459c316dc440737171f018600255dcd0a)
set(HASH 1501ad0b3ed1053466bef303e639c4d5cd9c270beacd07d70fb631db15503ea9e1f9de054cafe8759403e77aa898cd8b8878bf9024add4c081b28a4c5a9947ed)
else()
set(SUBDIR "python-${PYTHON_VERSION}-x64")
set(URL "https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-embed-amd64.zip")
set(ARCHIVE "python-${PYTHON_VERSION}-embed-amd64.zip")
set(HASH a322fc925167edb1897764297cf47e294ad3f52c109a05f8911412807eb83e104f780e9fe783b17fe0d9b18b7838797c15e9b0805dab759829f77a9bc0159424)
set(HASH e969622b74ea79a6adcf41b4d628bd80c9320df2f3d797905872610172838f1ab70d9bb0c70fcf7da396e03c3a73de96fa69a4b212b26f97de0e4f3366accf51)
endif()
set(PATHS ${DOWNLOADS}/tools/python/${SUBDIR})
set(POST_INSTALL_COMMAND ${CMAKE_COMMAND} -E remove python38._pth)
set(POST_INSTALL_COMMAND ${CMAKE_COMMAND} -E rm python39._pth)
else()
set(PROGNAME python3)
set(BREW_PACKAGE_NAME "python")
Expand Down