-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
add port vcpkg-tool-python2 #23431
Merged
Merged
add port vcpkg-tool-python2 #23431
Changes from 37 commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
8d4b8c7
add vcpkg-tool-lessmsi
96033d1
add vcpkg-tool-python2
3dd148b
adjust vcpkg_find_acquire_program
fbcf2b5
use python2 dependency in qt5-base
3a4868c
remove python2 from qt5-base
dfffbf8
add python2 to qt5-webengine
77d263f
use python3 instead of python2
56b2f32
add some deps on the new vcpkg-tool-python2
c6ae452
Apply suggestions from code review
Neumann-A 23e9ddf
add license field
Neumann-A aaa4d0d
fix test detection
Neumann-A efc27a9
error on failure to find python2
Neumann-A f22f03f
move logs to correct position.
Neumann-A af07821
add dep to qtwebengine
Neumann-A 5e728fa
Merge remote-tracking branch 'upstream/master' into add_vcpkg_tool_py…
Neumann-A 090a524
adjust pybind cmake config.
3ecdab2
fix shiva
b32919d
move python2 to manual-tools
1749587
format manifest
e72457c
use version-date
4e89c52
version stuff
6e2b0bc
replace version-string
709fda6
more version stuff
02756a5
fix search path and add supports expression
7a51292
version stuff
6eea6cd
shiva version
e165f5f
Merge branch 'master' of github.com:microsoft/vcpkg into add_vcpkg_to…
vicroms 2126e02
remove arm windows from support
c231f4c
reuse output_path
d06764d
version stuff
6a44c19
Fix x86 regression
Neumann-A 5a9dcb2
version stuff
Neumann-A 58c75b5
Merge branch 'master' of github.com:Microsoft/vcpkg into add_vcpkg_to…
vicroms ef87fce
Merge branch 'master' of github.com:microsoft/vcpkg into add_vcpkg_to…
vicroms b0e1344
Merge remote-tracking branch 'upstream/master' into add_vcpkg_tool_py…
Neumann-A a3c76a8
try fixing qtinterfaceframework
Neumann-A 867a22a
version stuff
Neumann-A d40242b
Merge remote-tracking branch 'upstream/master' into add_vcpkg_tool_py…
Neumann-A File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt | ||
index eef14ee87..d52a147d8 100644 | ||
--- a/modules/python/CMakeLists.txt | ||
+++ b/modules/python/CMakeLists.txt | ||
@@ -4,7 +4,7 @@ set(MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) | ||
find_package(pybind11 CONFIG REQUIRED) | ||
|
||
|
||
-if (WIN32) | ||
+if (WIN32 AND FALSE) | ||
## We need pyton dll | ||
file(GLOB PYTHON_DLL ${PYTHON_LIBRARIES}/../*.dll) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,30 @@ | ||
vcpkg_find_acquire_program(PYTHON2) | ||
|
||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO Milerius/shiva | ||
REF 1.0 | ||
SHA512 d1ce33e89b17fa8f82e21b51dfa1308e38c617fea52c34a20b7b6c8643318280df24c043238ddd73ba2dbc139c5b5de1c2cb3add1f5629a54694c78b415d73d1 | ||
HEAD_REF master | ||
PATCHES no_copy_dll.patch | ||
) | ||
|
||
vcpkg_configure_cmake( | ||
SOURCE_PATH ${SOURCE_PATH} | ||
PREFER_NINJA | ||
find_library(PYTHON_RELEASE NAMES python310 PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) | ||
find_library(PYTHON_DEBUG NAMES python310_d python310 PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) | ||
include(SelectLibraryConfigurations) | ||
select_library_configurations(PYTHON) | ||
|
||
vcpkg_cmake_configure( | ||
SOURCE_PATH "${SOURCE_PATH}" | ||
DISABLE_PARALLEL_CONFIGURE | ||
OPTIONS | ||
-DSHIVA_BUILD_TESTS=OFF | ||
-DPYTHON_EXECUTABLE=${PYTHON2} | ||
-DSHIVA_BUILD_TESTS=OFF | ||
"-DPYTHON_LIBRARY=${PYTHON_LIBRARIES}" | ||
"-DPYTHON_LIBRARIES=${PYTHON_LIBRARIES}" | ||
"-DPYTHON_EXECUTABLE=${CURRENT_INSTALLED_DIR}/tools/python3/python${VCPKG_EXECUTABLE_SUFFIX}" | ||
) | ||
|
||
vcpkg_install_cmake() | ||
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/shiva) | ||
vcpkg_cmake_install() | ||
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/shiva") | ||
|
||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug ${CURRENT_PACKAGES_DIR}/lib) | ||
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/shiva) | ||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/shiva/LICENSE ${CURRENT_PACKAGES_DIR}/share/shiva/copyright) | ||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug" "${CURRENT_PACKAGES_DIR}/lib") | ||
file(COPY "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/shiva") | ||
file(RENAME "${CURRENT_PACKAGES_DIR}/share/shiva/LICENSE" "${CURRENT_PACKAGES_DIR}/share/shiva/copyright") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
{ | ||
"name": "vcpkg-gn", | ||
"version-date": "2021-11-16", | ||
"port-version": 1, | ||
"description": "https://gn.googlesource.com/gn/+/4aa9bdfa05b688c58d3d7d3e496f3f18cbb3d89e", | ||
"supports": "native & !x86" | ||
"supports": "native & !x86", | ||
"dependencies": [ | ||
{ | ||
"name": "vcpkg-tool-python2", | ||
"host": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled) | ||
|
||
set(version v1.10.0) | ||
|
||
vcpkg_download_distfile(archive_path | ||
URLS "https://github.com/activescott/lessmsi/releases/download/${version}/lessmsi-${version}.zip" | ||
FILENAME "lessmsi-${version}.zip" | ||
SHA512 91be9363d75e8ca0129304008ddc26fe575cc4fd76d7f43ef0a6ff414855dc1c6e412f4e694b2950026e02cc3d31b18bd8c2e4c03e1ddce01477f3f2d2197479 | ||
) | ||
|
||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}") | ||
|
||
file(ARCHIVE_EXTRACT | ||
INPUT "${archive_path}" | ||
DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}" | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "vcpkg-tool-lessmsi", | ||
"version": "1.10.0", | ||
"description": "This is a utility with a graphical user interface and a command line interface that can be used to view and extract the contents of an MSI file.", | ||
"homepage": "https://github.com/activescott/lessmsi", | ||
"license": "MIT", | ||
"supports": "native & windows" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled) | ||
|
||
if(VCPKG_TARGET_IS_WINDOWS) | ||
set(arch_suffix "") | ||
set(program_name python) | ||
Neumann-A marked this conversation as resolved.
Show resolved
Hide resolved
|
||
set(program_version 2.7.18) | ||
if (VCPKG_TARGET_ARCHITECTURE STREQUAL x86) | ||
set(tool_subdirectory "python-${program_version}-x86") | ||
set(download_urls "https://www.python.org/ftp/python/${program_version}/python-${program_version}.msi") | ||
set(download_filename "python-${program_version}.msi") | ||
set(download_sha512 2c112733c777ddbf189b0a54047a9d5851ebce0564cc38b9687d79ce6c7a09006109dbad8627fb1a60c3ad55e261db850d9dfa454af0533b460b2afc316fe115) | ||
else() | ||
set(tool_subdirectory "python-${program_version}-x64") | ||
set(arch_suffix ".amd64") | ||
set(download_urls "https://www.python.org/ftp/python/${program_version}/python-${program_version}.amd64.msi") | ||
Neumann-A marked this conversation as resolved.
Show resolved
Hide resolved
|
||
set(download_filename "python-${program_version}.amd64.msi") | ||
set(download_sha512 6a81a413b80fd39893e7444fd47efa455d240cbb77a456c9d12f7cf64962b38c08cfa244cd9c50a65947c40f936c6c8c5782f7236d7b92445ab3dd01e82af23e) | ||
endif() | ||
set(paths_to_search "${CURRENT_PACKAGES_DIR}/manual-tools/${PORT}") | ||
|
||
vcpkg_download_distfile(archive_path | ||
URLS ${download_urls} | ||
SHA512 "${download_sha512}" | ||
FILENAME "${download_filename}" | ||
) | ||
set(output_path "${CURRENT_PACKAGES_DIR}/manual-tools") # vcpkg.cmake adds everything in /tools to CMAKE_PROGRAM_PATH. That is not desired for Python2 | ||
file(MAKE_DIRECTORY "${output_path}") | ||
cmake_path(NATIVE_PATH archive_path archive_path_native) # lessmsi is a bit picky about path formats. | ||
message(STATUS "Extracting Python2 ...") | ||
vcpkg_execute_in_download_mode( | ||
COMMAND "${CURRENT_HOST_INSTALLED_DIR}/tools/vcpkg-tool-lessmsi/lessmsi.exe" x "${archive_path_native}" # Using output_path here does not work in bash | ||
WORKING_DIRECTORY "${output_path}" | ||
OUTPUT_FILE "${CURRENT_BUILDTREES_DIR}/lessmsi-${TARGET_TRIPLET}-out.log" | ||
ERROR_FILE "${CURRENT_BUILDTREES_DIR}/lessmsi-${TARGET_TRIPLET}-err.log" | ||
RESULT_VARIABLE error_code | ||
) | ||
if(error_code) | ||
message(FATAL_ERROR "Couldn't extract Python2 with lessmsi!") | ||
endif() | ||
message(STATUS "Extracting Python2 ... finished!") | ||
file(RENAME "${output_path}/python-2.7.18${arch_suffix}/SourceDir/" "${output_path}/${PORT}/") | ||
file(REMOVE_RECURSE "${output_path}/python-2.7.18.amd64" | ||
# Files below are not part of a msiexec installation/extraction. | ||
"${output_path}/${PORT}/Windows" | ||
"${output_path}/${PORT}/Microsoft.VC90.CRT.manifest" | ||
"${output_path}/${PORT}/msvcr90.dll") | ||
z_vcpkg_find_acquire_program_find_internal("PYTHON2" | ||
INTERPRETER "${interpreter}" | ||
PATHS ${paths_to_search} | ||
NAMES ${program_name} | ||
) | ||
if(NOT PYTHON2) | ||
message(FATAL_ERROR "Unable to find python2: ${PYTHON2}") | ||
endif() | ||
message(STATUS "Using python2: ${PYTHON2}") | ||
set(details "set(program_version \"${program_version}\")\n") | ||
string(APPEND details "set(paths_to_search \"\${CURRENT_HOST_INSTALLED_DIR}/manual-tools/${PORT}\")\n") | ||
file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/details.cmake" "${details}") | ||
endif() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "vcpkg-tool-python2", | ||
"version": "2.7.18", | ||
"description": "Python 2", | ||
"homepage": "https://www.python.org/download/releases/2.0/", | ||
"license": "PSF-2.0", | ||
"supports": "!uwp & !(arm & windows)", | ||
"dependencies": [ | ||
{ | ||
"name": "vcpkg-tool-lessmsi", | ||
"host": true, | ||
"platform": "windows" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like a script to go along with this eventually, but I'm not going to block on that.