[vcpkg-tool-meson] Reorder code to allow download mode (#37768)

This commit is contained in:
Alexander Neumann 2024-03-28 20:52:56 +01:00 committed by GitHub
parent 3a5e1be5ca
commit 30822b6c4c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 23 additions and 19 deletions

View File

@ -2,22 +2,6 @@
include("${CMAKE_CURRENT_LIST_DIR}/vcpkg_configure_meson.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/vcpkg_install_meson.cmake")
# Check required python version
vcpkg_find_acquire_program(PYTHON3)
vcpkg_execute_required_process(COMMAND "${PYTHON3}" --version
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}"
LOGNAME "python3-version-${TARGET_TRIPLET}")
file(READ "${CURRENT_BUILDTREES_DIR}/python3-version-${TARGET_TRIPLET}-out.log" version_contents)
string(REGEX MATCH [[[0-9]+\.[0-9]+\.[0-9]+]] python_ver "${version_contents}")
set(min_required 3.7)
if(python_ver VERSION_LESS "${min_required}")
message(FATAL_ERROR "Found Python version '${python_ver} at ${PYTHON3}' is insufficient for meson. meson requires at least version '${min_required}'")
else()
message(STATUS "Found Python version '${python_ver} at ${PYTHON3}'")
endif()
set(meson_path_hash @MESON_PATH_HASH@)
string(SUBSTRING "${meson_path_hash}" 0 6 meson_short_hash)
@ -39,7 +23,6 @@ if(NOT SCRIPT_MESON)
URLS ${download_urls}
SHA512 "${download_sha512}"
FILENAME "${download_filename}"
)
file(REMOVE_RECURSE "${path_to_search}")
file(REMOVE_RECURSE "${path_to_search}-tmp")
@ -63,4 +46,20 @@ if(NOT SCRIPT_MESON)
set(SCRIPT_MESON "${path_to_search}/meson.py")
endif()
# Check required python version
vcpkg_find_acquire_program(PYTHON3)
vcpkg_execute_required_process(COMMAND "${PYTHON3}" --version
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}"
LOGNAME "python3-version-${TARGET_TRIPLET}")
file(READ "${CURRENT_BUILDTREES_DIR}/python3-version-${TARGET_TRIPLET}-out.log" version_contents)
string(REGEX MATCH [[[0-9]+\.[0-9]+\.[0-9]+]] python_ver "${version_contents}")
set(min_required 3.7)
if(python_ver VERSION_LESS "${min_required}")
message(FATAL_ERROR "Found Python version '${python_ver} at ${PYTHON3}' is insufficient for meson. meson requires at least version '${min_required}'")
else()
message(STATUS "Found Python version '${python_ver} at ${PYTHON3}'")
endif()
message(STATUS "Using meson: ${SCRIPT_MESON}")

View File

@ -1,7 +1,7 @@
{
"name": "vcpkg-tool-meson",
"version": "1.3.2",
"port-version": 1,
"port-version": 2,
"description": "Meson build system",
"homepage": "https://github.com/mesonbuild/meson",
"license": "Apache-2.0",

View File

@ -9046,7 +9046,7 @@
},
"vcpkg-tool-meson": {
"baseline": "1.3.2",
"port-version": 1
"port-version": 2
},
"vcpkg-tool-mozbuild": {
"baseline": "4.0.2",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "8408112396883b134bd25e2522f9a806ceaae3ea",
"version": "1.3.2",
"port-version": 2
},
{
"git-tree": "17b86f3a18ad63659d4dfbafc194969279a7a4f0",
"version": "1.3.2",