vcpkg/scripts/cmake/vcpkg_find_acquire_program(PYTHON3).cmake

41 lines
2.4 KiB
CMake
Raw Normal View History

if(CMAKE_HOST_WIN32)
set(program_name python)
set(program_version 3.12.7)
if(DEFINED ENV{PROCESSOR_ARCHITEW6432})
set(build_arch $ENV{PROCESSOR_ARCHITEW6432})
else()
set(build_arch $ENV{PROCESSOR_ARCHITECTURE})
endif()
if(build_arch MATCHES "^(ARM|arm)64$")
set(tool_subdirectory "python-${program_version}-arm64")
# https://www.python.org/ftp/python/3.12.7/python-3.12.7-embed-arm64.zip
set(download_urls "https://www.python.org/ftp/python/${program_version}/python-${program_version}-embed-arm64.zip")
set(download_filename "python-${program_version}-embed-arm64.zip")
set(download_sha512 D1D1183682D20AC057C45BF2AD264B6568CDEB54A1502823C76A2448386CAEF79A3AB9EA8FF57A5C023D432590FCCB5E3E9980F8760CD9BAAC5A2A82BA240D73)
elseif(build_arch MATCHES "(amd|AMD)64")
set(tool_subdirectory "python-${program_version}-x64")
# https://www.python.org/ftp/python/3.12.7/python-3.12.7-embed-amd64.zip
set(download_urls "https://www.python.org/ftp/python/${program_version}/python-${program_version}-embed-amd64.zip")
set(download_filename "python-${program_version}-embed-amd64.zip")
set(download_sha512 2F67A8487A9EDECE26B73AAB27E75249E538938AD976D371A9411B54DBAE20AFEAC82B406AD4EEEE38B1CF6F407E7620679D30C0FFF82EC8E8AE62268C322D59)
else()
set(tool_subdirectory "python-${program_version}-x86")
# https://www.python.org/ftp/python/3.12.7/python-3.12.7-embed-win32.zip
set(download_urls "https://www.python.org/ftp/python/${program_version}/python-${program_version}-embed-win32.zip")
set(download_filename "python-${program_version}-embed-win32.zip")
set(download_sha512 15542080E0CC25C574391218107FE843006E8C5A7161D1CD48CF14A3C47155C0244587273D9C747F35B15EA17676869ECCE079214824214C1A62ABFC86AD9F9B)
endif()
[python3] Update to 3.11.4 (#31727) * [python3] Update to 3.11.3 * Force set PythonForBuild on windows * Set LD_LIBRARY_PATH on unix * Always use vcpkg_find_acquire_program(PYTHON3) on windows * Remove LD_LIBRARY_PATH shenanigans * [vtk] Parse python version from include folder * Fix static builds on windows * Pass --with-build-python on unix * [omniorb] Fix python version in patch * Resurrect rpath patch * [python3] fix usage * [gobject-introspection] don't hardcode python version * Update vcpkg_find_aquire_program(PYTHON3) This is also required for gobject-introspection * [paraview] don't hardcode python version * [vtk-dicom] don't hardcode python version * Update python in vcpkgTools.xml * Fix host arch detection in vcpkg_find_acquire_program(PYTHON3) * [libpq] Don't hardcode python version * [shiva] Don't pass python variables * [vcpkg-get-python-packages] Delete unused file, update hardcoded python version * [python3] update to 3.11.4 * [omniorb] Use PREPEND in vcpkg_add_to_path So that python from vcpkg is picked before system python * libpq quickfix * re-fix libpq * fix vcpkg-get-python-packages * Make windows 7 patch compatible with unix builds * Copy pyd files to bin Also fixes copying files that do not belong to current build tree * Fix static builds * Speculatively fix osx regression * Fix omniorb on unix * [gobject-introspection] fix windows builds * [vtk] Update vendored copy of mpi4py for python 3.11 support * [mdl-sdk] Fix python * [gobject-introspection] fix the fix of a fix... * Update versions * Undo changes in gobject-introspection and vcpkg_find_aquire_program(PYTHON3) --------- Co-authored-by: root <root@DESKTOP-UIPL9V8>
2023-08-08 04:19:53 +08:00
set(paths_to_search "${DOWNLOADS}/tools/python/${tool_subdirectory}")
# We want to be able to import stuff from outside of this embeddable package.
# https://docs.python.org/3/library/sys_path_init.html#pth-files
string(REGEX MATCH "^3\\.[0-9]+" _python_version_plain "${program_version}")
string(REPLACE "." "" _python_version_plain "${_python_version_plain}")
vcpkg_list(SET post_install_command "${CMAKE_COMMAND}" -E rm "python${_python_version_plain}._pth")
else()
set(program_name python3)
set(brew_package_name "python")
set(apt_package_name "python3")
endif()