aboutsummaryrefslogtreecommitdiff
path: root/ports/python3
diff options
context:
space:
mode:
authorAdam Johnson <AdamJohnso@gmail.com>2020-06-12 01:23:26 -0400
committerGitHub <noreply@github.com>2020-06-11 22:23:26 -0700
commite1783c68c43bc59f545551071a2775971497c871 (patch)
treef6f4fc4e64b9e63d1717a398e11ee85702122e2c /ports/python3
parentca52d429b63391cbf7eb228cad4c7567200bee41 (diff)
downloadvcpkg-e1783c68c43bc59f545551071a2775971497c871.tar.gz
vcpkg-e1783c68c43bc59f545551071a2775971497c871.zip
[python3] Update to Python 3.8 (#11708)
* [python3] Update to Python 3.8.3. [vtk] Update to Python 3.8 and fix improper Python3 artifact specification. * [python3] Fix static linking, broken in 121faf2. * [hyperscan] Add missing build dependency (fixes CI on macOS).
Diffstat (limited to 'ports/python3')
-rw-r--r--ports/python3/0001-static-library.patch46
-rw-r--r--ports/python3/0002-static-crt.patch15
-rw-r--r--ports/python3/CONTROL5
-rw-r--r--ports/python3/portfile.cmake35
4 files changed, 83 insertions, 18 deletions
diff --git a/ports/python3/0001-static-library.patch b/ports/python3/0001-static-library.patch
new file mode 100644
index 000000000..46502130d
--- /dev/null
+++ b/ports/python3/0001-static-library.patch
@@ -0,0 +1,46 @@
+diff --git a/PC/pyconfig.h b/PC/pyconfig.h
+index b6b8d44586..35b329f307 100644
+--- a/PC/pyconfig.h
++++ b/PC/pyconfig.h
+@@ -257,6 +257,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 */
+ # endif /* _DEBUG */
+ # endif /* _MSC_VER */
+ # endif /* Py_BUILD_CORE */
++#else
++ /* So MSVC users need not specify the .lib file in their own config */
++# pragma comment(lib, "version.lib")
++# pragma comment(lib, "shlwapi.lib")
++# pragma comment(lib, "ws2_32.lib")
+ #endif /* MS_COREDLL */
+
+ #if defined(MS_WIN64)
+diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj
+index 0666b90f66..eb5ecffe71 100644
+--- a/PCbuild/pythoncore.vcxproj
++++ b/PCbuild/pythoncore.vcxproj
+@@ -73,7 +73,7 @@
+ <Import Project="python.props" />
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Label="Configuration">
+- <ConfigurationType>DynamicLibrary</ConfigurationType>
++ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+@@ -102,7 +102,7 @@
+ <AdditionalOptions>/Zm200 %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalIncludeDirectories>$(PySourcePath)Python;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories Condition="$(IncludeExternals)">$(zlibDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+- <PreprocessorDefinitions>_USRDLL;Py_BUILD_CORE;Py_BUILD_CORE_BUILTIN;Py_ENABLE_SHARED;MS_DLL_ID="$(SysWinVer)";%(PreprocessorDefinitions)</PreprocessorDefinitions>
++ <PreprocessorDefinitions>_USRDLL;Py_BUILD_CORE;Py_BUILD_CORE_BUILTIN;MS_DLL_ID="$(SysWinVer)";%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions Condition="$(IncludeExternals)">_Py_HAVE_ZLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
diff --git a/ports/python3/0002-static-crt.patch b/ports/python3/0002-static-crt.patch
new file mode 100644
index 000000000..82e2b36d2
--- /dev/null
+++ b/ports/python3/0002-static-crt.patch
@@ -0,0 +1,15 @@
+diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj
+index eb5ecffe71..2a7c819533 100644
+--- a/PCbuild/pythoncore.vcxproj
++++ b/PCbuild/pythoncore.vcxproj
+@@ -104,6 +104,10 @@
+ <AdditionalIncludeDirectories Condition="$(IncludeExternals)">$(zlibDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_USRDLL;Py_BUILD_CORE;Py_BUILD_CORE_BUILTIN;MS_DLL_ID="$(SysWinVer)";%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions Condition="$(IncludeExternals)">_Py_HAVE_ZLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
++ <RuntimeLibrary Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">MultiThreadedDebug</RuntimeLibrary>
++ <RuntimeLibrary Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">MultiThreadedDebug</RuntimeLibrary>
++ <RuntimeLibrary Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MultiThreaded</RuntimeLibrary>
++ <RuntimeLibrary Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>version.lib;shlwapi.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
diff --git a/ports/python3/CONTROL b/ports/python3/CONTROL
index 3c6ba8eb1..abb7bf23a 100644
--- a/ports/python3/CONTROL
+++ b/ports/python3/CONTROL
@@ -1,9 +1,8 @@
Source: python3
-Version: 3.7.3-3
+Version: 3.8.3
Homepage: https://github.com/python/cpython
Description: The Python programming language as an embeddable library
-Build-Depends: libffi, openssl
+Build-Depends: libffi, openssl, zlib (!uwp&!windows)
Feature: enable-shared
Description: Build shared libraries in addition to static ones built by default
-Build-Depends: zlib (!uwp&!windows)
diff --git a/ports/python3/portfile.cmake b/ports/python3/portfile.cmake
index 807b549d1..c680aeb2e 100644
--- a/ports/python3/portfile.cmake
+++ b/ports/python3/portfile.cmake
@@ -4,16 +4,26 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic AND VCPKG_CRT_LINKAGE STREQUAL static
endif()
set(PYTHON_VERSION_MAJOR 3)
-set(PYTHON_VERSION_MINOR 7)
+set(PYTHON_VERSION_MINOR 8)
set(PYTHON_VERSION_PATCH 3)
set(PYTHON_VERSION ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.${PYTHON_VERSION_PATCH})
+if(VCPKG_TARGET_IS_WINDOWS)
+ if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
+ list(APPEND PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001-static-library.patch)
+ endif()
+ if (VCPKG_CRT_LINKAGE STREQUAL static)
+ list(APPEND PATCHES ${CMAKE_CURRENT_LIST_DIR}/0002-static-crt.patch)
+ endif()
+endif()
+
vcpkg_from_github(
OUT_SOURCE_PATH TEMP_SOURCE_PATH
REPO python/cpython
REF v${PYTHON_VERSION}
- SHA512 023960a2f570fe7178d3901df0c3c33346466906b6d55c73ef7947c19619dbab62efc42c7262a0539bc5e31543b1113eb7a088d4615ad7557a0707bdaca27940
+ SHA512 eb264a858ef55f2f61b53f663454be6e99ffe9035d8fcdb3366d7a08fd3b295613e5d15e93e2e4b9b18ad297d8c17139bde5e90e396db04fe04c6f441a443fd2
HEAD_REF master
+ PATCHES ${PATCHES}
)
if("enable-shared" IN_LIST FEATURES)
@@ -33,9 +43,6 @@ if (VCPKG_TARGET_IS_WINDOWS)
file(REMOVE_RECURSE ${SOURCE_PATH})
file(RENAME "${TEMP_SOURCE_PATH}" ${SOURCE_PATH})
- # We need per-triplet directories because we need to patch the project files differently based on the linkage
- # Because the patches patch the same file, they have to be applied in the correct order
-
if (VCPKG_TARGET_ARCHITECTURE MATCHES "x86")
set(BUILD_ARCH "Win32")
set(OUT_DIR "win32")
@@ -50,12 +57,11 @@ if (VCPKG_TARGET_IS_WINDOWS)
PROJECT_PATH ${SOURCE_PATH}/PCBuild/pythoncore.vcxproj
PLATFORM ${BUILD_ARCH})
- file(GLOB HEADERS ${SOURCE_PATH}/Include/*.h)
file(INSTALL
- ${HEADERS}
+ "${SOURCE_PATH}/Include/"
"${SOURCE_PATH}/PC/pyconfig.h"
- DESTINATION
- "${CURRENT_PACKAGES_DIR}/include/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}"
+ DESTINATION "${CURRENT_PACKAGES_DIR}/include/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}"
+ FILES_MATCHING PATTERN *.h
)
file(INSTALL
"${SOURCE_PATH}/Lib"
@@ -149,10 +155,9 @@ elseif (VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX)
)
message(STATUS "Installing ${TARGET_TRIPLET}-rel headers...")
- file(GLOB HEADERS
- ${OUT_PATH_RELEASE}/include/*)
- file(INSTALL ${HEADERS} DESTINATION ${CURRENT_PACKAGES_DIR}/include
- PATTERN "*__pycache__*" EXCLUDE
+ file(INSTALL "${OUT_PATH_RELEASE}/include/"
+ DESTINATION ${CURRENT_PACKAGES_DIR}/include
+ FILES_MATCHING PATTERN *.h
)
message(STATUS "Installing ${TARGET_TRIPLET}-rel lib files...")
@@ -173,7 +178,7 @@ elseif (VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX)
message(STATUS "Installing ${TARGET_TRIPLET}-rel Python library files...")
file(GLOB LIBS
- ${OUT_PATH_RELEASE}/lib/libpython${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}m.*)
+ ${OUT_PATH_RELEASE}/lib/libpython${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.*)
file(INSTALL ${LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib
PATTERN "*.pyc" EXCLUDE
PATTERN "*__pycache__*" EXCLUDE
@@ -227,7 +232,7 @@ elseif (VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX)
message(STATUS "Installing ${TARGET_TRIPLET}-dbg Python library files...")
file(GLOB LIBS
- ${OUT_PATH_DEBUG}/lib/libpython${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}dm.*)
+ ${OUT_PATH_DEBUG}/lib/libpython${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}d.*)
file(INSTALL ${LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib
PATTERN "*.pyc" EXCLUDE
PATTERN "*__pycache__*" EXCLUDE