From f0dbdbaa650131b18e93b9477a08ad21f39dc8d8 Mon Sep 17 00:00:00 2001 From: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com> Date: Mon, 17 Aug 2020 16:25:05 +0200 Subject: [PATCH] [meson] Update meson to 0.55.1 (#12927) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [vcpkg_find_acquire_program] add version check for ninja * Change VERSION to NINJA_VERSION * Missed VERSION change * some more corrections * add missing PACKAGES parameter * add osx hash Co-authored-by: Wolfgang Stöggl * [meson] update to 0.55.1 * fix command * Remove apt/brew package names Co-authored-by: ras0219 <533828+ras0219@users.noreply.github.com> * move supported around and disable it for freebsd * fix small command hickup which does not matter for ninja Co-authored-by: Wolfgang Stöggl Co-authored-by: ras0219 <533828+ras0219@users.noreply.github.com> Co-authored-by: Nicole Mazzuca --- ports/tool-meson/CONTROL | 2 +- ports/tool-meson/portfile.cmake | 2 + .../cmake/vcpkg_find_acquire_program.cmake | 51 +++++++++++-------- 3 files changed, 33 insertions(+), 22 deletions(-) diff --git a/ports/tool-meson/CONTROL b/ports/tool-meson/CONTROL index 483508089e66e3..c5fe40dfc1344b 100644 --- a/ports/tool-meson/CONTROL +++ b/ports/tool-meson/CONTROL @@ -1,4 +1,4 @@ Source: tool-meson -Version: 0.54.2 +Version: 0.55.1 Homepage: https://github.com/mesonbuild/meson Description: Meson build system diff --git a/ports/tool-meson/portfile.cmake b/ports/tool-meson/portfile.cmake index ad32823bdec75c..c39e614071f42d 100644 --- a/ports/tool-meson/portfile.cmake +++ b/ports/tool-meson/portfile.cmake @@ -3,3 +3,5 @@ # Currently is used in ports that call vcpkg_find_acquire_program(MESON) in order to force rebuilds. set(VCPKG_POLICY_EMPTY_PACKAGE enabled) +vcpkg_find_acquire_program(MESON) +message(STATUS "Using meson: ${MESON}") \ No newline at end of file diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 7f1f419cdca842..f5915dbc776396 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -240,23 +240,18 @@ function(vcpkg_find_acquire_program VAR) set(NOEXTRACT ON) set(HASH 22ea847d8017cd977664d0b13c889cfb13c89143212899a511be217345a4e243d4d8d4099700114a11d26a087e83eb1a3e2b03bdb5e0db48f10403184cd26619) elseif(VAR MATCHES "MESON") - if(NOT CMAKE_HOST_APPLE) - set(PROGNAME meson) - set(REQUIRED_INTERPRETER PYTHON3) - set(APT_PACKAGE_NAME "meson") - if(CMAKE_HOST_WIN32) - set(SCRIPTNAME meson.py) - else() - set(SCRIPTNAME meson) - endif() - set(PATHS ${DOWNLOADS}/tools/meson/meson-0.54.2) - set(URL "https://github.com/mesonbuild/meson/archive/0.54.2.zip") - set(ARCHIVE "meson-0.54.2.zip") - set(HASH 8d19110bad3e6a223d1d169e833b746b884ece9cd23d2539ec02dccb5cd0c56542414b7afc0f7f2adcec9d957e4120d31f41734397aa0a7ee7f9c29ebdc9eb4c) - else() - set(PROGNAME meson) - set(BREW_PACKAGE_NAME "meson") - endif() + set(MESON_VERSION 0.55.1) + set(PROGNAME meson) + set(REQUIRED_INTERPRETER PYTHON3) + set(APT_PACKAGE_NAME "meson") + set(BREW_PACKAGE_NAME "meson") + set(SCRIPTNAME meson meson.py) + set(PATHS ${DOWNLOADS}/tools/meson/meson-${MESON_VERSION}) + set(URL "https://github.com/mesonbuild/meson/releases/download/${MESON_VERSION}/meson-${MESON_VERSION}.tar.gz") + set(ARCHIVE "meson-${MESON_VERSION}.tar.gz") + set(HASH 172b4de8c7474d709f172431b89bf2b2b1c2c38bc842039cccf6be075a45bd3509a1dab8512bc5b2ee025d65d8050d2f717dd15c1f9be17fca3b2e7da0d3e889) + set(_vfa_SUPPORTED ON) + set(VERSION_CMD --version) elseif(VAR MATCHES "FLEX" OR VAR MATCHES "BISON") if(CMAKE_HOST_WIN32) set(SOURCEFORGE_ARGS @@ -419,14 +414,28 @@ function(vcpkg_find_acquire_program VAR) endif() else() vcpkg_find_acquire_program(${REQUIRED_INTERPRETER}) - find_file(SCRIPT_${VAR} ${SCRIPTNAME} PATHS ${PATHS} NO_DEFAULT_PATH) - find_file(SCRIPT_${VAR} ${SCRIPTNAME}) - set(${VAR} ${${REQUIRED_INTERPRETER}} ${SCRIPT_${VAR}}) + find_file(SCRIPT_${VAR} NAMES ${SCRIPTNAME} PATHS ${PATHS} NO_DEFAULT_PATH) + if(NOT SCRIPT_${VAR}) + find_file(SCRIPT_${VAR} NAMES ${SCRIPTNAME}) + if(SCRIPT_${VAR} AND NOT ${VAR}_VERSION_CHECKED) + set(${VAR} ${${REQUIRED_INTERPRETER}} ${SCRIPT_${VAR}}) + do_version_check() + set(${VAR}_VERSION_CHECKED ON) + if(NOT ${VAR}) + unset(SCRIPT_${VAR} CACHE) + endif() + elseif(${VAR}_VERSION_CHECKED) + message(FATAL_ERROR "Unable to find ${PROGNAME} with min version of ${${VAR}_VERSION}") + endif() + endif() + if(SCRIPT_${VAR}) + set(${VAR} ${${REQUIRED_INTERPRETER}} ${SCRIPT_${VAR}}) + endif() endif() endmacro() do_find() - if("${${VAR}}" MATCHES "-NOTFOUND") + if(NOT ${VAR}) if(NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows" AND NOT _vfa_SUPPORTED) set(EXAMPLE ".") if(DEFINED BREW_PACKAGE_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")