diff --git a/ports/qt5-base/portfile.cmake b/ports/qt5-base/portfile.cmake index d87cc7d9a0..e240deabf8 100644 --- a/ports/qt5-base/portfile.cmake +++ b/ports/qt5-base/portfile.cmake @@ -280,32 +280,49 @@ elseif(VCPKG_TARGET_IS_OSX) set(ENV{QMAKE_MACOSX_DEPLOYMENT_TARGET} ${VCPKG_OSX_DEPLOYMENT_TARGET}) else() execute_process(COMMAND xcrun --show-sdk-version - OUTPUT_FILE OSX_SDK_VER.txt - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}) - FILE(STRINGS "${CURRENT_BUILDTREES_DIR}/OSX_SDK_VER.txt" OSX_SDK_VERSION REGEX "^[0-9][0-9]\.[0-9][0-9]*") + OUTPUT_VARIABLE OSX_SDK_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE) message(STATUS "Detected OSX SDK Version: ${OSX_SDK_VERSION}") - string(REGEX MATCH "^[0-9][0-9]\.[0-9][0-9]*" OSX_SDK_VERSION ${OSX_SDK_VERSION}) + string(REGEX MATCH "^([0-9]+)\\.([0-9]+)" OSX_SDK_VERSION "${OSX_SDK_VERSION}") message(STATUS "Major.Minor OSX SDK Version: ${OSX_SDK_VERSION}") execute_process(COMMAND sw_vers -productVersion - OUTPUT_FILE OSX_SYS_VER.txt - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}) - FILE(STRINGS "${CURRENT_BUILDTREES_DIR}/OSX_SYS_VER.txt" VCPKG_OSX_DEPLOYMENT_TARGET REGEX "^[0-9][0-9]\.[0-9][0-9]*") + OUTPUT_VARIABLE VCPKG_OSX_DEPLOYMENT_TARGET + OUTPUT_STRIP_TRAILING_WHITESPACE) message(STATUS "Detected OSX system Version: ${VCPKG_OSX_DEPLOYMENT_TARGET}") - string(REGEX MATCH "^[0-9][0-9]\.[0-9][0-9]*" VCPKG_OSX_DEPLOYMENT_TARGET ${VCPKG_OSX_DEPLOYMENT_TARGET}) + string(REGEX MATCH "^([0-9]+)\\.([0-9]+)" VCPKG_OSX_DEPLOYMENT_TARGET "${VCPKG_OSX_DEPLOYMENT_TARGET}") message(STATUS "Major.Minor OSX system Version: ${VCPKG_OSX_DEPLOYMENT_TARGET}") - set(ENV{QMAKE_MACOSX_DEPLOYMENT_TARGET} ${VCPKG_OSX_DEPLOYMENT_TARGET}) - if(${VCPKG_OSX_DEPLOYMENT_TARGET} GREATER "10.15") # Max Version supported by QT. This version is defined in mkspecs/common/macx.conf as QT_MAC_SDK_VERSION_MAX - message(STATUS "Qt ${QT_MAJOR_MINOR_VER}.${QT_PATCH_VER} only support OSX_DEPLOYMENT_TARGET up to 10.15") - set(VCPKG_OSX_DEPLOYMENT_TARGET "10.15") + # Parse mkspecs/common/macx.conf + file(READ "${SOURCE_PATH}/mkspecs/common/macx.conf" QT_MK_MAC_CONTENT) + string(REGEX MATCHALL "QT_MAC_SDK_VERSION_MIN[ \t]*=[ \t]*(([0-9]+)(\\.([0-9]+))*)" KEY_VALUE "${QT_MK_MAC_CONTENT}") + if(${CMAKE_MATCH_COUNT} LESS 2) + message(FATAL_ERROR "Error parse QT_MAC_SDK_VERSION_MIN") endif() + set(QT_MAC_SDK_VERSION_MIN "${CMAKE_MATCH_1}") + string(REGEX MATCHALL "QT_MAC_SDK_VERSION_MAX[ \t]*=[ \t]*(([0-9]+)(\\.([0-9]+))*)" KEY_VALUE "${QT_MK_MAC_CONTENT}") + if(${CMAKE_MATCH_COUNT} LESS 2) + message(FATAL_ERROR "Error parse QT_MAC_SDK_VERSION_MAX") + endif() + set(QT_MAC_SDK_VERSION_MAX "${CMAKE_MATCH_1}") + + message(STATUS "QT_MAC_SDK_VERSION_MIN: ${QT_MAC_SDK_VERSION_MIN}") + message(STATUS "QT_MAC_SDK_VERSION_MAX: ${QT_MAC_SDK_VERSION_MAX}") + + # clamp(VCPKG_OSX_DEPLOYMENT_TARGET, QT_MAC_SDK_VERSION_MIN, QT_MAC_SDK_VERSION_MAX) + if("${VCPKG_OSX_DEPLOYMENT_TARGET}" VERSION_GREATER "${QT_MAC_SDK_VERSION_MAX}") + set(VCPKG_OSX_DEPLOYMENT_TARGET "${QT_MAC_SDK_VERSION_MAX}") + endif() + if("${VCPKG_OSX_DEPLOYMENT_TARGET}" VERSION_LESS "${QT_MAC_SDK_VERSION_MIN}") + set(VCPKG_OSX_DEPLOYMENT_TARGET "${QT_MAC_SDK_VERSION_MIN}") + endif() + set(ENV{QMAKE_MACOSX_DEPLOYMENT_TARGET} ${VCPKG_OSX_DEPLOYMENT_TARGET}) - message(STATUS "Enviromnent OSX SDK Version: $ENV{QMAKE_MACOSX_DEPLOYMENT_TARGET}") - FILE(READ "${SOURCE_PATH}/mkspecs/common/macx.conf" _tmp_contents) - string(REPLACE "QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.13" "QMAKE_MACOSX_DEPLOYMENT_TARGET = ${VCPKG_OSX_DEPLOYMENT_TARGET}" _tmp_contents ${_tmp_contents}) - FILE(WRITE "${SOURCE_PATH}/mkspecs/common/macx.conf" ${_tmp_contents}) endif() + message(STATUS "Enviromnent OSX SDK Version: $ENV{QMAKE_MACOSX_DEPLOYMENT_TARGET}") + file(READ "${SOURCE_PATH}/mkspecs/common/macx.conf" _tmp_contents) + string(REPLACE "QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.13" "QMAKE_MACOSX_DEPLOYMENT_TARGET = ${VCPKG_OSX_DEPLOYMENT_TARGET}" _tmp_contents ${_tmp_contents}) + file(WRITE "${SOURCE_PATH}/mkspecs/common/macx.conf" ${_tmp_contents}) #list(APPEND QT_PLATFORM_CONFIGURE_OPTIONS HOST_PLATFORM ${TARGET_MKSPEC}) list(APPEND RELEASE_OPTIONS "SQLITE_LIBS=${SQLITE_RELEASE} -ldl -lpthread" diff --git a/ports/qt5-base/vcpkg.json b/ports/qt5-base/vcpkg.json index 627f70c806..713b367872 100644 --- a/ports/qt5-base/vcpkg.json +++ b/ports/qt5-base/vcpkg.json @@ -1,7 +1,7 @@ { "name": "qt5-base", "version": "5.15.8", - "port-version": 2, + "port-version": 3, "description": "Qt5 Application Framework Base Module. Includes Core, GUI, Widgets, Networking, SQL, Concurrent and other essential qt components.", "homepage": "https://www.qt.io/", "license": null, diff --git a/versions/baseline.json b/versions/baseline.json index 2b0e6a1b5c..dd74f0a0f7 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6270,7 +6270,7 @@ }, "qt5-base": { "baseline": "5.15.8", - "port-version": 2 + "port-version": 3 }, "qt5-canvas3d": { "baseline": "0", diff --git a/versions/q-/qt5-base.json b/versions/q-/qt5-base.json index 7d1bc26af4..e5401f7638 100644 --- a/versions/q-/qt5-base.json +++ b/versions/q-/qt5-base.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "6784bfaa6ca1ddf15b673165041defe84f289a9c", + "version": "5.15.8", + "port-version": 3 + }, { "git-tree": "c2fc93e40435da3abae5ab36864d1c2d4aaafb91", "version": "5.15.8",