From aea0653a8bb1fc27401e711ad01b7d5e86b02e28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=BCller?= Date: Fri, 19 May 2017 23:31:04 +0200 Subject: Add port for Python 3 --- ports/python3/0001-Static-library.patch | 46 +++++++++++++ ports/python3/0002-Static-CRT.patch | 17 +++++ .../0003-Fix-header-for-static-linkage.patch | 14 ++++ ports/python3/CONTROL | 3 + ports/python3/portfile.cmake | 78 ++++++++++++++++++++++ 5 files changed, 158 insertions(+) create mode 100644 ports/python3/0001-Static-library.patch create mode 100644 ports/python3/0002-Static-CRT.patch create mode 100644 ports/python3/0003-Fix-header-for-static-linkage.patch create mode 100644 ports/python3/CONTROL create mode 100644 ports/python3/portfile.cmake (limited to 'ports/python3') diff --git a/ports/python3/0001-Static-library.patch b/ports/python3/0001-Static-library.patch new file mode 100644 index 000000000..4bc10af41 --- /dev/null +++ b/ports/python3/0001-Static-library.patch @@ -0,0 +1,46 @@ +diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj +index 6ea1848..4134d7b 100644 +--- a/PCbuild/pythoncore.vcxproj ++++ b/PCbuild/pythoncore.vcxproj +@@ -1,4 +1,4 @@ +- ++ + + + +@@ -41,7 +41,7 @@ + + + +- DynamicLibrary ++ StaticLibrary + false + + +@@ -66,12 +66,24 @@ + + /Zm200 %(AdditionalOptions) + $(PySourcePath)Python;$(PySourcePath)Modules\zlib;%(AdditionalIncludeDirectories) +- _USRDLL;Py_BUILD_CORE;Py_ENABLE_SHARED;MS_DLL_ID="$(SysWinVer)";%(PreprocessorDefinitions) ++ _USRDLL;Py_BUILD_CORE;Py_NO_ENABLE_SHARED;MS_DLL_ID="$(SysWinVer)";%(PreprocessorDefinitions) + + + version.lib;shlwapi.lib;ws2_32.lib;%(AdditionalDependencies) + 0x1e000000 + ++ ++ MachineX86 ++ ++ ++ MachineX86 ++ ++ ++ MachineX86 ++ ++ ++ MachineX86 ++ + + + +-- diff --git a/ports/python3/0002-Static-CRT.patch b/ports/python3/0002-Static-CRT.patch new file mode 100644 index 000000000..267d03d75 --- /dev/null +++ b/ports/python3/0002-Static-CRT.patch @@ -0,0 +1,17 @@ +diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj +index 4134d7b..ecbccf0 100644 +--- a/PCbuild/pythoncore.vcxproj ++++ b/PCbuild/pythoncore.vcxproj +@@ -67,6 +67,10 @@ + /Zm200 %(AdditionalOptions) + $(PySourcePath)Python;$(PySourcePath)Modules\zlib;%(AdditionalIncludeDirectories) + _USRDLL;Py_BUILD_CORE;Py_NO_ENABLE_SHARED;MS_DLL_ID="$(SysWinVer)";%(PreprocessorDefinitions) ++ MultiThreadedDebug ++ MultiThreadedDebug ++ MultiThreaded ++ MultiThreaded + + + version.lib;shlwapi.lib;ws2_32.lib;%(AdditionalDependencies) +-- + diff --git a/ports/python3/0003-Fix-header-for-static-linkage.patch b/ports/python3/0003-Fix-header-for-static-linkage.patch new file mode 100644 index 000000000..99e56d29c --- /dev/null +++ b/ports/python3/0003-Fix-header-for-static-linkage.patch @@ -0,0 +1,14 @@ +diff --git a/PC/pyconfig.h b/PC/pyconfig.h +index 64e7aec..aa36745 100644 +--- a/PC/pyconfig.h ++++ b/PC/pyconfig.h +@@ -274,6 +274,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 */ +-- + diff --git a/ports/python3/CONTROL b/ports/python3/CONTROL new file mode 100644 index 000000000..6cef24232 --- /dev/null +++ b/ports/python3/CONTROL @@ -0,0 +1,3 @@ +Source: python3 +Version: 3.6.1 +Description: The Python programming language as an embeddable library \ No newline at end of file diff --git a/ports/python3/portfile.cmake b/ports/python3/portfile.cmake new file mode 100644 index 000000000..d3ffbfa24 --- /dev/null +++ b/ports/python3/portfile.cmake @@ -0,0 +1,78 @@ +# Common Ambient Variables: +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# CURRENT_PORT DIR = ${VCPKG_ROOT_DIR}\ports\${PORT} +# PORT = current port name (zlib, etc) +# TARGET_TRIPLET = current triplet (x86-windows, x64-windows-static, etc) +# VCPKG_CRT_LINKAGE = C runtime linkage type (static, dynamic) +# VCPKG_LIBRARY_LINKAGE = target library linkage type (static, dynamic) +# VCPKG_ROOT_DIR = +# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm) +# + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src-${TARGET_TRIPLET}) +vcpkg_from_github( + OUT_SOURCE_PATH TEMP_SOURCE_PATH + REPO python/cpython + REF v3.6.1 + SHA512 1fdc1dc44d82762a793093fa19d6401c99fbc05375d8d7e378274ed5555a25dfb3537f93ef04e52ebbf95b42fda74303293dd37aba81ce0c4296a675ab75fa62 + HEAD_REF master + ) +# We need per-triplet directories because we need to patch the project files differently based on the linkage +file(REMOVE_RECURSE ${SOURCE_PATH}) +file(COPY ${TEMP_SOURCE_PATH} DESTINATION ${SOURCE_PATH}) +set(SOURCE_PATH ${SOURCE_PATH}/cpython-3.6.1) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/0001-Static-library.patch + ) +endif() +if (VCPKG_CRT_LINKAGE STREQUAL static) + vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/0002-Static-CRT.patch + ) +endif() + +if (VCPKG_TARGET_ARCHITECTURE MATCHES "x86") + set(BUILD_ARCH "Win32") + set(OUT_DIR "win32") +elseif (VCPKG_TARGET_ARCHITECTURE MATCHES "x64") + set(BUILD_ARCH "x64") + set(OUT_DIR "amd64") +else() + message(FATAL_ERROR "Unsupported architecture: ${VCPKG_TARGET_ARCHITECTURE}") +endif() + +vcpkg_build_msbuild( + PROJECT_PATH ${SOURCE_PATH}/PCBuild/pythoncore.vcxproj + PLATFORM ${BUILD_ARCH}) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/0003-Fix-header-for-static-linkage.patch + ) +endif() + +file(GLOB HEADERS ${SOURCE_PATH}/Include/*.h) +file(COPY ${HEADERS} ${SOURCE_PATH}/PC/pyconfig.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/python3.6) + +file(COPY ${SOURCE_PATH}/PCBuild/${OUT_DIR}/python36.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) +file(COPY ${SOURCE_PATH}/PCBuild/${OUT_DIR}/python36_d.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(COPY ${SOURCE_PATH}/PCBuild/${OUT_DIR}/python36.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin) + file(COPY ${SOURCE_PATH}/PCBuild/${OUT_DIR}/python36_d.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) +endif() + +# Handle copyright +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/python3) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/python3/LICENSE ${CURRENT_PACKAGES_DIR}/share/python3/copyright) + +vcpkg_copy_pdbs() \ No newline at end of file -- cgit v1.2.3 From 683d8a8820680fc017d0faef08bac490f68e781e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=BCller?= Date: Sat, 20 May 2017 10:58:30 +0200 Subject: Add warning for unsupported linkage combination Don't remove source directories Install Python's standard library --- ports/python3/portfile.cmake | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'ports/python3') diff --git a/ports/python3/portfile.cmake b/ports/python3/portfile.cmake index d3ffbfa24..19f04a15d 100644 --- a/ports/python3/portfile.cmake +++ b/ports/python3/portfile.cmake @@ -9,6 +9,13 @@ # VCPKG_ROOT_DIR = # VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm) # +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic AND VCPKG_CRT_LINKAGE STREQUAL static) + # Because the patches patch the same file, they have to be applied in the correct order + # In this scenario, only the second patch needs to be applied, which doesn't work + message(STATUS "Warning: Dynamic library with static CRT is not supported. Building static library.") + set(VCPKG_LIBRARY_LINKAGE static) +endif() + include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src-${TARGET_TRIPLET}) @@ -20,7 +27,6 @@ vcpkg_from_github( HEAD_REF master ) # We need per-triplet directories because we need to patch the project files differently based on the linkage -file(REMOVE_RECURSE ${SOURCE_PATH}) file(COPY ${TEMP_SOURCE_PATH} DESTINATION ${SOURCE_PATH}) set(SOURCE_PATH ${SOURCE_PATH}/cpython-3.6.1) @@ -64,6 +70,8 @@ endif() file(GLOB HEADERS ${SOURCE_PATH}/Include/*.h) file(COPY ${HEADERS} ${SOURCE_PATH}/PC/pyconfig.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/python3.6) +file(COPY ${SOURCE_PATH}/Lib DESTINATION ${CURRENT_PACKAGES_DIR}/share/python3) + file(COPY ${SOURCE_PATH}/PCBuild/${OUT_DIR}/python36.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) file(COPY ${SOURCE_PATH}/PCBuild/${OUT_DIR}/python36_d.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) -- cgit v1.2.3 From 23962328a4f0ea83de847d71a927ba1cc397b560 Mon Sep 17 00:00:00 2001 From: Albert Ziegenhagel Date: Thu, 4 Jan 2018 17:55:01 +0100 Subject: [python3] Update to 3.6.4 --- ports/python3/0001-Static-library.patch | 11 ++--------- ports/python3/0002-Static-CRT.patch | 4 +--- ports/python3/CONTROL | 2 +- ports/python3/portfile.cmake | 26 +++++++++++++++----------- 4 files changed, 19 insertions(+), 24 deletions(-) (limited to 'ports/python3') diff --git a/ports/python3/0001-Static-library.patch b/ports/python3/0001-Static-library.patch index 4bc10af41..b5666ba40 100644 --- a/ports/python3/0001-Static-library.patch +++ b/ports/python3/0001-Static-library.patch @@ -1,13 +1,5 @@ -diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj -index 6ea1848..4134d7b 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj -@@ -1,4 +1,4 @@ -- -+ - - - @@ -41,7 +41,7 @@ @@ -17,7 +9,7 @@ index 6ea1848..4134d7b 100644 false -@@ -66,12 +66,24 @@ +@@ -67,13 +67,25 @@ /Zm200 %(AdditionalOptions) $(PySourcePath)Python;$(PySourcePath)Modules\zlib;%(AdditionalIncludeDirectories) @@ -26,6 +18,7 @@ index 6ea1848..4134d7b 100644 version.lib;shlwapi.lib;ws2_32.lib;%(AdditionalDependencies) + %(AdditionalLibraryDirectories);$(PySourcePath)PC\external\$(PlatformToolset)\$(ArchName) 0x1e000000 + diff --git a/ports/python3/0002-Static-CRT.patch b/ports/python3/0002-Static-CRT.patch index 267d03d75..8f63aa092 100644 --- a/ports/python3/0002-Static-CRT.patch +++ b/ports/python3/0002-Static-CRT.patch @@ -1,8 +1,6 @@ -diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj -index 4134d7b..ecbccf0 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj -@@ -67,6 +67,10 @@ +@@ -68,6 +68,10 @@ /Zm200 %(AdditionalOptions) $(PySourcePath)Python;$(PySourcePath)Modules\zlib;%(AdditionalIncludeDirectories) _USRDLL;Py_BUILD_CORE;Py_NO_ENABLE_SHARED;MS_DLL_ID="$(SysWinVer)";%(PreprocessorDefinitions) diff --git a/ports/python3/CONTROL b/ports/python3/CONTROL index 6cef24232..0a730e517 100644 --- a/ports/python3/CONTROL +++ b/ports/python3/CONTROL @@ -1,3 +1,3 @@ Source: python3 -Version: 3.6.1 +Version: 3.6.4 Description: The Python programming language as an embeddable library \ No newline at end of file diff --git a/ports/python3/portfile.cmake b/ports/python3/portfile.cmake index 19f04a15d..9bb50b70c 100644 --- a/ports/python3/portfile.cmake +++ b/ports/python3/portfile.cmake @@ -16,19 +16,23 @@ 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 6) +set(PYTHON_VERSION_PATCH 4) +set(PYTHON_VERSION ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.${PYTHON_VERSION_PATCH}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src-${TARGET_TRIPLET}) vcpkg_from_github( OUT_SOURCE_PATH TEMP_SOURCE_PATH REPO python/cpython - REF v3.6.1 - SHA512 1fdc1dc44d82762a793093fa19d6401c99fbc05375d8d7e378274ed5555a25dfb3537f93ef04e52ebbf95b42fda74303293dd37aba81ce0c4296a675ab75fa62 + REF v${PYTHON_VERSION} + SHA512 32cca5e344ee66f08712ab5533e5518f724f978ec98d985f7612d0bd8d7f5cac25625363c9eead192faf1806d4ea3393515f72ba962a2a0bed26261e56d8c637 HEAD_REF master ) # We need per-triplet directories because we need to patch the project files differently based on the linkage file(COPY ${TEMP_SOURCE_PATH} DESTINATION ${SOURCE_PATH}) -set(SOURCE_PATH ${SOURCE_PATH}/cpython-3.6.1) +set(SOURCE_PATH ${SOURCE_PATH}/cpython-${PYTHON_VERSION}) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) vcpkg_apply_patches( @@ -68,19 +72,19 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) endif() file(GLOB HEADERS ${SOURCE_PATH}/Include/*.h) -file(COPY ${HEADERS} ${SOURCE_PATH}/PC/pyconfig.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/python3.6) +file(COPY ${HEADERS} ${SOURCE_PATH}/PC/pyconfig.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}) -file(COPY ${SOURCE_PATH}/Lib DESTINATION ${CURRENT_PACKAGES_DIR}/share/python3) +file(COPY ${SOURCE_PATH}/Lib DESTINATION ${CURRENT_PACKAGES_DIR}/share/python${PYTHON_VERSION_MAJOR}) -file(COPY ${SOURCE_PATH}/PCBuild/${OUT_DIR}/python36.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) -file(COPY ${SOURCE_PATH}/PCBuild/${OUT_DIR}/python36_d.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) +file(COPY ${SOURCE_PATH}/PCBuild/${OUT_DIR}/python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) +file(COPY ${SOURCE_PATH}/PCBuild/${OUT_DIR}/python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}_d.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - file(COPY ${SOURCE_PATH}/PCBuild/${OUT_DIR}/python36.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin) - file(COPY ${SOURCE_PATH}/PCBuild/${OUT_DIR}/python36_d.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + file(COPY ${SOURCE_PATH}/PCBuild/${OUT_DIR}/python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin) + file(COPY ${SOURCE_PATH}/PCBuild/${OUT_DIR}/python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}_d.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) endif() # Handle copyright -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/python3) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/python3/LICENSE ${CURRENT_PACKAGES_DIR}/share/python3/copyright) +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/python${PYTHON_VERSION_MAJOR}) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/python${PYTHON_VERSION_MAJOR}/LICENSE ${CURRENT_PACKAGES_DIR}/share/python${PYTHON_VERSION_MAJOR}/copyright) vcpkg_copy_pdbs() \ No newline at end of file -- cgit v1.2.3 From 56560864e9cca01645fa19c65db9742d85a3e381 Mon Sep 17 00:00:00 2001 From: Daniel Strommen Date: Sun, 18 Mar 2018 04:31:30 -0700 Subject: Include windows.h before including consoleapi.h (#3050) * Include windows.h before including consoleapi.h Issue: cpython fails to build against Windows Insider Preview SDK 17115 Root Cause: Failure to include windows.h before other Windows headers (consoleapi.h) Solution: Include windows.h before consoleapi.h If you don't include Windows.h before other Windows headers, then your code is likely to break with new versions of the Windows Platform SDK, as headers move around or new intraheader dependencies are added. That is what happened here. * Remove redundant consoleapi.h The documented header for all the console API's is windows.h, which includes wincon.h which includes consoleapi.h. Consoleapi.h used to also include windows.h, but this caused a circular dependency. So, adjusting this to only include windows.h and omit the consoleapi.h which is redundant. * [python3] formatting --- ports/python3/0004-Fix-iomodule-for-RS4-SDK.patch | 12 +++++++++++ ports/python3/portfile.cmake | 25 +++++++++-------------- 2 files changed, 22 insertions(+), 15 deletions(-) create mode 100644 ports/python3/0004-Fix-iomodule-for-RS4-SDK.patch (limited to 'ports/python3') diff --git a/ports/python3/0004-Fix-iomodule-for-RS4-SDK.patch b/ports/python3/0004-Fix-iomodule-for-RS4-SDK.patch new file mode 100644 index 000000000..a0efc8d1c --- /dev/null +++ b/ports/python3/0004-Fix-iomodule-for-RS4-SDK.patch @@ -0,0 +1,12 @@ +diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c +--- a/Modules/_io/_iomodule.c ++++ b/Modules/_io/_iomodule.c +@@ -21,7 +21,7 @@ + #endif /* HAVE_SYS_STAT_H */ + + #ifdef MS_WINDOWS +-#include ++#include + #endif + + /* Various interned strings */ diff --git a/ports/python3/portfile.cmake b/ports/python3/portfile.cmake index 9bb50b70c..6285f9a9b 100644 --- a/ports/python3/portfile.cmake +++ b/ports/python3/portfile.cmake @@ -1,17 +1,4 @@ -# Common Ambient Variables: -# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} -# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} -# CURRENT_PORT DIR = ${VCPKG_ROOT_DIR}\ports\${PORT} -# PORT = current port name (zlib, etc) -# TARGET_TRIPLET = current triplet (x86-windows, x64-windows-static, etc) -# VCPKG_CRT_LINKAGE = C runtime linkage type (static, dynamic) -# VCPKG_LIBRARY_LINKAGE = target library linkage type (static, dynamic) -# VCPKG_ROOT_DIR = -# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm) -# if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic AND VCPKG_CRT_LINKAGE STREQUAL static) - # Because the patches patch the same file, they have to be applied in the correct order - # In this scenario, only the second patch needs to be applied, which doesn't work message(STATUS "Warning: Dynamic library with static CRT is not supported. Building static library.") set(VCPKG_LIBRARY_LINKAGE static) endif() @@ -29,8 +16,16 @@ vcpkg_from_github( REF v${PYTHON_VERSION} SHA512 32cca5e344ee66f08712ab5533e5518f724f978ec98d985f7612d0bd8d7f5cac25625363c9eead192faf1806d4ea3393515f72ba962a2a0bed26261e56d8c637 HEAD_REF master - ) +) + +vcpkg_apply_patches( + SOURCE_PATH ${TEMP_SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/0004-Fix-iomodule-for-RS4-SDK.patch +) + # 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 file(COPY ${TEMP_SOURCE_PATH} DESTINATION ${SOURCE_PATH}) set(SOURCE_PATH ${SOURCE_PATH}/cpython-${PYTHON_VERSION}) @@ -87,4 +82,4 @@ endif() file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/python${PYTHON_VERSION_MAJOR}) file(RENAME ${CURRENT_PACKAGES_DIR}/share/python${PYTHON_VERSION_MAJOR}/LICENSE ${CURRENT_PACKAGES_DIR}/share/python${PYTHON_VERSION_MAJOR}/copyright) -vcpkg_copy_pdbs() \ No newline at end of file +vcpkg_copy_pdbs() -- cgit v1.2.3 From 5ab4a6f673ccce9796579a4132d397cddafa0916 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 20 Apr 2018 17:53:57 -0700 Subject: [python3] Fix folder handling --- ports/python3/CONTROL | 2 +- ports/python3/portfile.cmake | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'ports/python3') diff --git a/ports/python3/CONTROL b/ports/python3/CONTROL index 0a730e517..c8331f8cf 100644 --- a/ports/python3/CONTROL +++ b/ports/python3/CONTROL @@ -1,3 +1,3 @@ Source: python3 -Version: 3.6.4 +Version: 3.6.4-1 Description: The Python programming language as an embeddable library \ No newline at end of file diff --git a/ports/python3/portfile.cmake b/ports/python3/portfile.cmake index 6285f9a9b..16b3a3db3 100644 --- a/ports/python3/portfile.cmake +++ b/ports/python3/portfile.cmake @@ -9,12 +9,12 @@ set(PYTHON_VERSION_PATCH 4) set(PYTHON_VERSION ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.${PYTHON_VERSION_PATCH}) include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src-${TARGET_TRIPLET}) + vcpkg_from_github( OUT_SOURCE_PATH TEMP_SOURCE_PATH REPO python/cpython REF v${PYTHON_VERSION} - SHA512 32cca5e344ee66f08712ab5533e5518f724f978ec98d985f7612d0bd8d7f5cac25625363c9eead192faf1806d4ea3393515f72ba962a2a0bed26261e56d8c637 + SHA512 32cca5e344ee66f08712ab5533e5518f724f978ec98d985f7612d0bd8d7f5cac25625363c9eead192faf1806d4ea3393515f72ba962a2a0bed26261e56d8c637 HEAD_REF master ) @@ -26,8 +26,9 @@ vcpkg_apply_patches( # 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 -file(COPY ${TEMP_SOURCE_PATH} DESTINATION ${SOURCE_PATH}) -set(SOURCE_PATH ${SOURCE_PATH}/cpython-${PYTHON_VERSION}) +set(SOURCE_PATH "${TEMP_SOURCE_PATH}-Lib-${VCPKG_LIBRARY_LINKAGE}-crt-${VCPKG_CRT_LINKAGE}") +file(REMOVE_RECURSE ${SOURCE_PATH}) +file(RENAME "${TEMP_SOURCE_PATH}" ${SOURCE_PATH}) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) vcpkg_apply_patches( @@ -57,7 +58,7 @@ endif() vcpkg_build_msbuild( PROJECT_PATH ${SOURCE_PATH}/PCBuild/pythoncore.vcxproj PLATFORM ${BUILD_ARCH}) - + if (VCPKG_LIBRARY_LINKAGE STREQUAL static) vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} -- cgit v1.2.3