-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add port vcpkg-tool-python2 (#23431)
* add vcpkg-tool-lessmsi * add vcpkg-tool-python2 * adjust vcpkg_find_acquire_program * use python2 dependency in qt5-base * remove python2 from qt5-base * add python2 to qt5-webengine * use python3 instead of python2 * add some deps on the new vcpkg-tool-python2 * Apply suggestions from code review Co-authored-by: nicole mazzuca <83086508+strega-nil-ms@users.noreply.github.com> * add license field * fix test detection * error on failure to find python2 * move logs to correct position. * add dep to qtwebengine * adjust pybind cmake config. * fix shiva * move python2 to manual-tools adjust search path generate a details.cmake for vcpkg_find_acquire_program * format manifest * use version-date * version stuff * replace version-string * more version stuff * fix search path and add supports expression * version stuff * shiva version * remove arm windows from support * reuse output_path use lessmsi is a host dep so use the correct path * version stuff * Fix x86 regression * version stuff * try fixing qtinterfaceframework * version stuff Co-authored-by: Alexander Neumann <you@example.com> Co-authored-by: nicole mazzuca <83086508+strega-nil-ms@users.noreply.github.com> Co-authored-by: Victor Romero <viromer@microsoft.com> Co-authored-by: Victor Romero <romerosanchezv@gmail.com>
- Loading branch information
1 parent
9659615
commit fad0644
Showing
29 changed files
with
272 additions
and
44 deletions.
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) | ||
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") | ||
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.