From 84df5613f71eda8a73ab08dc3041f3af7103a5b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D9=85=D9=87=D8=AF=D9=8A=20=D8=B4=D9=8A=D9=86=D9=88=D9=86?= =?UTF-8?q?=20=28Mehdi=20Chinoune=29?= Date: Tue, 28 Mar 2023 19:52:15 +0100 Subject: [PATCH] [qscintilla] build against Qt6 (#30307) * [vcpkg-qmake] set QMAKE_MACOSX_DEPLOYMENT_TARGET based on Qt version * qscintilla: build against Qt6 --- ports/qscintilla/portfile.cmake | 29 ++++++++++--------- ports/qscintilla/vcpkg.json | 12 ++++---- ports/vcpkg-qmake/vcpkg.json | 2 +- ports/vcpkg-qmake/vcpkg_qmake_configure.cmake | 23 ++++++++++++--- versions/baseline.json | 4 +-- versions/q-/qscintilla.json | 7 ++++- versions/v-/vcpkg-qmake.json | 5 ++++ 7 files changed, 54 insertions(+), 28 deletions(-) diff --git a/ports/qscintilla/portfile.cmake b/ports/qscintilla/portfile.cmake index 07ea7faa0c..2335e5445d 100644 --- a/ports/qscintilla/portfile.cmake +++ b/ports/qscintilla/portfile.cmake @@ -17,21 +17,24 @@ vcpkg_find_acquire_program(PYTHON3) get_filename_component(PYTHON3_PATH ${PYTHON3} DIRECTORY) vcpkg_add_to_path(${PYTHON3_PATH}) -vcpkg_configure_qmake( - SOURCE_PATH ${SOURCE_PATH}/src - OPTIONS - CONFIG+=build_all - CONFIG-=hide_symbols - DEFINES+=SCI_NAMESPACE +vcpkg_qmake_configure( + SOURCE_PATH "${SOURCE_PATH}/src" + QMAKE_OPTIONS + "CONFIG-=hide_symbols" + "DEFINES+=SCI_NAMESPACE" ) +vcpkg_qmake_install() -if(VCPKG_TARGET_IS_WINDOWS) - vcpkg_install_qmake( - RELEASE_TARGETS release - DEBUG_TARGETS debug - ) -else() - vcpkg_install_qmake() +file(GLOB DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") +if(DLLS) + file(COPY ${DLLS} DESTINATION "${CURRENT_PACKAGES_DIR}/bin") + file(REMOVE ${DLLS}) +endif() + +file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") +if(DEBUG_DLLS) + file(COPY ${DEBUG_DLLS} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin") + file(REMOVE ${DEBUG_DLLS}) endif() file(GLOB HEADER_FILES ${SOURCE_PATH}/src/Qsci/*) diff --git a/ports/qscintilla/vcpkg.json b/ports/qscintilla/vcpkg.json index fb558bd61c..50784a3327 100644 --- a/ports/qscintilla/vcpkg.json +++ b/ports/qscintilla/vcpkg.json @@ -1,21 +1,19 @@ { "name": "qscintilla", "version": "2.13.4", + "port-version": 1, "description": "QScintilla is a port to Qt of the Scintilla editing component. Features syntax highlighting, code-completion and much more (Barebone build without python bindings (missing dependeny PyQt) and without QtDesigner plugin)", "homepage": "https://www.riverbankcomputing.com/software/qscintilla", "license": "GPL-3.0-or-later", "dependencies": [ { - "name": "qt5-base", + "name": "qtbase", "default-features": false }, { - "name": "qt5-macextras", - "platform": "osx" - }, - { - "name": "qt5-winextras", - "platform": "windows" + "name": "vcpkg-qmake", + "host": true, + "default-features": false } ] } diff --git a/ports/vcpkg-qmake/vcpkg.json b/ports/vcpkg-qmake/vcpkg.json index 63a50ea811..50e1cc2f12 100644 --- a/ports/vcpkg-qmake/vcpkg.json +++ b/ports/vcpkg-qmake/vcpkg.json @@ -1,6 +1,6 @@ { "name": "vcpkg-qmake", - "version-date": "2022-11-16", + "version-date": "2023-03-22", "documentation": "https://vcpkg.io/en/docs/README.html", "license": "MIT", "supports": "native", diff --git a/ports/vcpkg-qmake/vcpkg_qmake_configure.cmake b/ports/vcpkg-qmake/vcpkg_qmake_configure.cmake index 9846d183cb..92cdf7fdc9 100644 --- a/ports/vcpkg-qmake/vcpkg_qmake_configure.cmake +++ b/ports/vcpkg-qmake/vcpkg_qmake_configure.cmake @@ -18,10 +18,6 @@ function(vcpkg_qmake_configure) vcpkg_list(APPEND arg_QMAKE_OPTIONS "CONFIG*=static-runtime") endif() - if(DEFINED VCPKG_OSX_DEPLOYMENT_TARGET) - set(ENV{QMAKE_MACOSX_DEPLOYMENT_TARGET} "${VCPKG_OSX_DEPLOYMENT_TARGET}") - endif() - set(ENV{PKG_CONFIG} "${CURRENT_HOST_INSTALLED_DIR}/tools/pkgconf/pkgconf${VCPKG_HOST_EXECUTABLE_SUFFIX}") get_filename_component(PKGCONFIG_PATH "${PKGCONFIG}" DIRECTORY) vcpkg_add_to_path("${PKGCONFIG_PATH}") @@ -58,6 +54,25 @@ function(vcpkg_qmake_configure) set(VCPKG_QMAKE_COMMAND "${CURRENT_HOST_INSTALLED_DIR}/tools/Qt6/bin/qmake${VCPKG_HOST_EXECUTABLE_SUFFIX}") endif() + if(VCPKG_TARGET_IS_OSX) + # Get Qt version + execute_process( + COMMAND ${VCPKG_QMAKE_COMMAND} -query QT_VERSION + OUTPUT_VARIABLE QT_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + + if(DEFINED VCPKG_OSX_DEPLOYMENT_TARGET) + vcpkg_list(APPEND arg_QMAKE_OPTIONS "QMAKE_MACOSX_DEPLOYMENT_TARGET=${VCPKG_OSX_DEPLOYMENT_TARGET}") + elseif(${QT_VERSION} VERSION_GREATER_EQUAL 6) + # https://doc.qt.io/qt-6/macos.html + vcpkg_list(APPEND arg_QMAKE_OPTIONS "QMAKE_MACOSX_DEPLOYMENT_TARGET=10.15") + else() # Qt5 + # https://doc.qt.io/qt-5/macos.html + vcpkg_list(APPEND arg_QMAKE_OPTIONS "QMAKE_MACOSX_DEPLOYMENT_TARGET=10.13") + endif() + endif() + set(qmake_build_tools "") qmake_append_program(qmake_build_tools "QMAKE_CC" "${VCPKG_DETECTED_CMAKE_C_COMPILER}") qmake_append_program(qmake_build_tools "QMAKE_CXX" "${VCPKG_DETECTED_CMAKE_CXX_COMPILER}") diff --git a/versions/baseline.json b/versions/baseline.json index 401258e951..9692f27fe1 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6362,7 +6362,7 @@ }, "qscintilla": { "baseline": "2.13.4", - "port-version": 0 + "port-version": 1 }, "qt": { "baseline": "6.4.3", @@ -8189,7 +8189,7 @@ "port-version": 1 }, "vcpkg-qmake": { - "baseline": "2022-11-16", + "baseline": "2023-03-22", "port-version": 0 }, "vcpkg-tool-bazel": { diff --git a/versions/q-/qscintilla.json b/versions/q-/qscintilla.json index 75e97b7a17..d3aef96cc7 100644 --- a/versions/q-/qscintilla.json +++ b/versions/q-/qscintilla.json @@ -1,7 +1,12 @@ { "versions": [ { - "git-tree": "7698a4b73e3ed54fd0cf66cf9e754317763750cb", + "git-tree": "4920a3d743be78d0d5be05132786873977677665", + "version": "2.13.4", + "port-version": 1 + }, + { + "git-tree": "b5942c0b0a6d9131bc4ad9a1dde662f809a6d965", "version": "2.13.4", "port-version": 0 }, diff --git a/versions/v-/vcpkg-qmake.json b/versions/v-/vcpkg-qmake.json index 4824c720c5..f1c4ea99ed 100644 --- a/versions/v-/vcpkg-qmake.json +++ b/versions/v-/vcpkg-qmake.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "82e22019ae07b7150c3fb2a8672d4192eed2782c", + "version-date": "2023-03-22", + "port-version": 0 + }, { "git-tree": "993a25e3e7a43175fb3d7d4981bc3e0de1f65c32", "version-date": "2022-11-16",