From 64b6f9e9ea2ff65364ddc1b12b7c5e71d8215c4d Mon Sep 17 00:00:00 2001 From: Lukas Holecek Date: Sun, 17 Mar 2024 10:22:00 +0100 Subject: [PATCH] Revert "Windows: Use Qt 6 build" This reverts commit 0e5c702e91d8088e78f95d011062e213851dfd9f. --- appveyor.yml | 15 +++---- shared/copyq.iss | 4 +- utils/appveyor/after_build.sh | 19 +++++---- utils/appveyor/before_build.sh | 5 +-- utils/appveyor/env.sh | 6 +-- utils/appveyor/{kf_build.sh => kf5_build.sh} | 41 +++++++------------ .../patches/kconfig/0001-Fix-build.patch | 26 ++++++++++++ ...Support-updating-Snore-notifications.patch | 22 +++++----- 8 files changed, 74 insertions(+), 64 deletions(-) rename utils/appveyor/{kf_build.sh => kf5_build.sh} (77%) create mode 100644 utils/appveyor/patches/kconfig/0001-Fix-build.patch diff --git a/appveyor.yml b/appveyor.yml index 0bff2cd5f7..2801d88798 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -14,28 +14,23 @@ skip_branch_with_pr: true environment: APPVEYOR_SAVE_CACHE_ON_ERROR: true - KF_VERSION: 6.7 - KF_BRANCH: stable - KF_PATCH: 0 + KF5_VERSION: 5.109 + KF5_PATCH: 0 SNORETOAST_VERSION: 0.9.0 matrix: - - QTDIR: /c/Qt/6.5/msvc2019_64 + - QTDIR: /c/Qt/5.15/msvc2019_64 CMAKE_GENERATOR: Visual Studio 16 2019 CMAKE_GENERATOR_ARCH: x64 BUILD_SUB_DIR: Release - # https://wiki.qt.io/Qt_6.5_Tools_and_Versions + # https://wiki.qt.io/Qt_5.15_Tools_and_Versions # https://www.appveyor.com/docs/windows-images-software/#tools OPENSSL_PATH: /c/OpenSSL-v111-Win64/bin LIBSSL: libssl-1_1-x64.dll LIBCRYPTO: libcrypto-1_1-x64.dll GPGPATH: /c/Program Files/Git/usr/bin WITH_NATIVE_NOTIFICATIONS: "ON" - WITH_QT6: "ON" - WINDEPLOYQT_ARGS: >- - --no-system-d3d-compiler - --no-opengl-sw - --no-quick + WITH_QT6: "OFF" # Parameters for default build commands (build_script is used instead). build: false diff --git a/shared/copyq.iss b/shared/copyq.iss index e76736a8b3..8a1274c709 100644 --- a/shared/copyq.iss +++ b/shared/copyq.iss @@ -160,11 +160,11 @@ Source: "{#Root}\plugins\*itemtags.dll"; DestDir: "{app}\plugins"; Components: p Source: "{#Root}\plugins\*itempinned.dll"; DestDir: "{app}\plugins"; Components: plugins/pinned; Flags: ignoreversion ; Qt and toolchain -Source: "{#Root}\bearer\*.dll"; DestDir: "{app}\bearer"; Components: program; Flags: ignoreversion recursesubdirs createallsubdirs skipifsourcedoesntexist +Source: "{#Root}\bearer\*.dll"; DestDir: "{app}\bearer"; Components: program; Flags: ignoreversion recursesubdirs createallsubdirs Source: "{#Root}\imageformats\*.dll"; DestDir: "{app}\imageformats"; Components: program; Flags: ignoreversion recursesubdirs createallsubdirs Source: "{#Root}\platforms\*.dll"; DestDir: "{app}\platforms"; Components: program; Flags: ignoreversion recursesubdirs createallsubdirs Source: "{#Root}\styles\*.dll"; DestDir: "{app}\styles"; Components: program; Flags: ignoreversion recursesubdirs createallsubdirs -Source: "{#Root}\tls\*.dll"; DestDir: "{app}\tls"; Components: program; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "{#Root}\tls\*.dll"; DestDir: "{app}\tls"; Components: program; Flags: ignoreversion recursesubdirs createallsubdirs skipifsourcedoesntexist Source: "{#Root}\*.dll"; DestDir: "{app}"; Components: program; Flags: ignoreversion [Icons] diff --git a/utils/appveyor/after_build.sh b/utils/appveyor/after_build.sh index 5e111014af..4464d2b660 100644 --- a/utils/appveyor/after_build.sh +++ b/utils/appveyor/after_build.sh @@ -9,14 +9,14 @@ mkdir -p "$Destination" cmake --install "$BUILD_PATH" --config Release --prefix "$Destination" --verbose if [[ $WITH_NATIVE_NOTIFICATIONS == ON ]]; then - cp -v "$INSTALL_PREFIX/bin/KF6"*.dll "$Destination" + cp -v "$INSTALL_PREFIX/bin/KF5"*.dll "$Destination" cp -v "$INSTALL_PREFIX/bin/snoretoast.exe" "$Destination" - kf_libraries=( - "$Destination/KF6ConfigCore.dll" - "$Destination/KF6Notifications.dll" + kf5_libraries=( + "$Destination/KF5ConfigCore.dll" + "$Destination/KF5Notifications.dll" ) else - kf_libraries=() + kf5_libraries=() fi cp -v "$Source/AUTHORS" "$Destination" @@ -37,8 +37,11 @@ cp -v "$OPENSSL_PATH/$LIBSSL" "$Destination" "$QTDIR/bin/windeployqt" --help "$QTDIR/bin/windeployqt" \ - $WINDEPLOYQT_ARGS \ - "${kf_libraries[@]}" \ + --no-system-d3d-compiler \ + --no-angle \ + --no-opengl-sw \ + --no-quick \ + "${kf5_libraries[@]}" \ "$Executable" # Create and upload portable zip file. @@ -46,7 +49,7 @@ cp -v "$OPENSSL_PATH/$LIBSSL" "$Destination" appveyor PushArtifact "$APP.zip" -DeploymentName "CopyQ Portable" # This works with minGW, not msvc. -# objdump -x "$Destination/KF6Notifications.dll" | grep -F "DLL Name" +# objdump -x "$Destination/KF5Notifications.dll" | grep -F "DLL Name" # objdump -x "$Destination/copyq.exe" | grep -F "DLL Name" # Note: Following removes system-installed dlls to verify required libs are included. diff --git a/utils/appveyor/before_build.sh b/utils/appveyor/before_build.sh index 14f6e691d2..83e26c2335 100644 --- a/utils/appveyor/before_build.sh +++ b/utils/appveyor/before_build.sh @@ -13,7 +13,7 @@ curl --location --silent --show-error --fail-with-body \ grep -q LanguageName "$languages/Korean.isl" if [[ $WITH_NATIVE_NOTIFICATIONS == ON ]]; then - build=$APPVEYOR_BUILD_FOLDER/utils/appveyor/kf_build.sh + build=$APPVEYOR_BUILD_FOLDER/utils/appveyor/kf5_build.sh export PATH=$PATH:$INSTALL_PREFIX/bin @@ -21,8 +21,8 @@ if [[ $WITH_NATIVE_NOTIFICATIONS == ON ]]; then "$build" extra-cmake-modules "$build" kconfig "" "" "-DKCONFIG_USE_DBUS=OFF" "-DKCONFIG_USE_GUI=OFF" "$build" kwindowsystem + "$build" kcoreaddons "$build" knotifications - "$build" kstatusnotifieritem # Create and upload dependencies zip file. 7z a "$APP-dependencies.zip" -r "$INSTALL_PREFIX" @@ -40,5 +40,4 @@ cmake -B"$BUILD_PATH" -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH" \ -DCMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION=. \ -DWITH_NATIVE_NOTIFICATIONS="$WITH_NATIVE_NOTIFICATIONS" \ - -DWITH_QT6="$WITH_QT6" \ -DWITH_TESTS=ON diff --git a/utils/appveyor/env.sh b/utils/appveyor/env.sh index cd457a3676..639cac4054 100755 --- a/utils/appveyor/env.sh +++ b/utils/appveyor/env.sh @@ -11,8 +11,8 @@ export BUILD_PATH=$APPVEYOR_BUILD_FOLDER/build export CMAKE_PREFIX_PATH="$QTDIR/lib/cmake" if [[ $WITH_NATIVE_NOTIFICATIONS == ON ]]; then - export KF_FULLVER=$KF_VERSION.$KF_PATCH - export INSTALL_PREFIX=$APPVEYOR_BUILD_FOLDER/usr/kf-$KF_FULLVER-$CMAKE_GENERATOR_ARCH + export KF5_FULLVER=$KF5_VERSION.$KF5_PATCH + export INSTALL_PREFIX=$APPVEYOR_BUILD_FOLDER/usr/kf-$KF5_FULLVER-$CMAKE_GENERATOR_ARCH export DEPENDENCY_PATH=$APPVEYOR_BUILD_FOLDER/dependencies export DOWNLOADS_PATH=$APPVEYOR_BUILD_FOLDER/downloads export DEPENDENCY_BUILD_PATH=$DEPENDENCY_PATH/build @@ -21,7 +21,7 @@ if [[ $WITH_NATIVE_NOTIFICATIONS == ON ]]; then export CMAKE_PREFIX_PATH="$CMAKE_PREFIX:$INSTALL_PREFIX/share/ECM/cmake":$CMAKE_PREFIX_PATH export SNORETOAST_BASE_URL=https://invent.kde.org/libraries/snoretoast/-/archive/v$SNORETOAST_VERSION - export KF_BASE_URL=https://download.kde.org/$KF_BRANCH/frameworks/$KF_VERSION + export KF5_BASE_URL=https://download.kde.org/stable/frameworks/$KF5_VERSION mkdir -p "$INSTALL_PREFIX" mkdir -p "$DEPENDENCY_PATH" diff --git a/utils/appveyor/kf_build.sh b/utils/appveyor/kf5_build.sh similarity index 77% rename from utils/appveyor/kf_build.sh rename to utils/appveyor/kf5_build.sh index 843ebe7309..06fa5f9e55 100644 --- a/utils/appveyor/kf_build.sh +++ b/utils/appveyor/kf5_build.sh @@ -2,8 +2,8 @@ set -exo pipefail name=$1 -version=${2:-$KF_FULLVER} -base_url=${3:-$KF_BASE_URL} +version=${2:-$KF5_FULLVER} +base_url=${3:-$KF5_BASE_URL} if [[ $# -gt 3 ]]; then shift 3 @@ -12,7 +12,8 @@ else extra_cmake_args=() fi -url=$base_url/$name-$version +pkg=$DOWNLOADS_PATH/$name-$version.zip +url=$base_url/$name-$version.zip patch_dir=$APPVEYOR_BUILD_FOLDER/utils/appveyor/patches/$name state_old=$INSTALL_PREFIX/$name-state state_new=$DEPENDENCY_PATH/$name-state-new @@ -28,22 +29,6 @@ function get_new_state() { echo | md5sum "$patch_dir"/*.patch } -function get_source() { - suffix=$1 - pkg=$DOWNLOADS_PATH/$name-$version.$suffix - - for retry in $(seq 5); do - curl -sSL -o "$pkg" "$url.$suffix" - if cmake -E tar xf "$pkg"; then - return 0 - fi - if [[ $retry -gt 0 ]]; then - sleep $((retry * 15)) - fi - done - return 1 -} - # Omit rebuilding if already cached. get_new_state > "$state_new" if diff "$state_old" "$state_new"; then @@ -52,13 +37,17 @@ fi ( cd "$DEPENDENCY_PATH" - - if [[ "$base_url" == "$KF_BASE_URL" ]]; then - get_source tar.xz - else - get_source zip - fi - + # Retry downloading package. + for retry in $(seq 5); do + if cmake -E tar xf "$pkg" --format=zip; then + break + fi + rm -f "$pkg" + if [[ $retry -gt 0 ]]; then + sleep $((retry * 15)) + fi + curl -L -o "$pkg" "$url" + done cd "$name-$version" for patch in "$patch_dir"/*.patch; do diff --git a/utils/appveyor/patches/kconfig/0001-Fix-build.patch b/utils/appveyor/patches/kconfig/0001-Fix-build.patch new file mode 100644 index 0000000000..fa2985ce12 --- /dev/null +++ b/utils/appveyor/patches/kconfig/0001-Fix-build.patch @@ -0,0 +1,26 @@ +From 59e856c8f51ac210592233b1de5433d629f9f478 Mon Sep 17 00:00:00 2001 +From: Lukas Holecek +Date: Mon, 18 Nov 2019 13:03:57 +0100 +Subject: [PATCH] Fix build + +Signed-off-by: Lukas Holecek +--- + src/kconf_update/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/kconf_update/CMakeLists.txt b/src/kconf_update/CMakeLists.txt +index 6947f94..e2e7a39 100644 +--- a/src/kconf_update/CMakeLists.txt ++++ b/src/kconf_update/CMakeLists.txt +@@ -20,7 +20,7 @@ ecm_mark_nongui_executable(kconf_update) + + file( + GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/kconf-exec.h +- CONTENT "#define KCONF_UPDATE_EXECUTABLE \"$\"" ++ CONTENT "#define KCONF_UPDATE_EXECUTABLE \"$\"" + ) + configure_file(config-kconf.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kconf.h ) + +-- +2.23.0 + diff --git a/utils/appveyor/patches/knotifications/0001-Support-updating-Snore-notifications.patch b/utils/appveyor/patches/knotifications/0001-Support-updating-Snore-notifications.patch index 62807fb0ee..4be72e71e4 100644 --- a/utils/appveyor/patches/knotifications/0001-Support-updating-Snore-notifications.patch +++ b/utils/appveyor/patches/knotifications/0001-Support-updating-Snore-notifications.patch @@ -1,4 +1,4 @@ -From dfb10fdbdc3ae82037366ed4cf039796beca7d6d Mon Sep 17 00:00:00 2001 +From a91e08f149b64793fa3c0c0e09c61891f0814535 Mon Sep 17 00:00:00 2001 From: Lukas Holecek Date: Sun, 15 Nov 2020 19:06:53 +0100 Subject: [PATCH] Support updating Snore notifications @@ -8,7 +8,7 @@ Subject: [PATCH] Support updating Snore notifications 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/src/notifybysnore.cpp b/src/notifybysnore.cpp -index a82d0a4..4bf1c53 100644 +index b89056b..6607b80 100644 --- a/src/notifybysnore.cpp +++ b/src/notifybysnore.cpp @@ -61,7 +61,7 @@ NotifyBySnore::NotifyBySnore(QObject *parent) @@ -20,7 +20,7 @@ index a82d0a4..4bf1c53 100644 const QByteArray rawNotificationResponse = responseSocket->readAll(); responseSocket->deleteLater(); -@@ -175,9 +175,20 @@ void NotifyBySnore::notifyDeferred(KNotification *notification) +@@ -177,9 +177,20 @@ void NotifyBySnore::notifyDeferred(KNotification *notification) // handle the icon for toast notification const QString iconPath = m_iconDir.path() + QLatin1Char('/') + QString::number(notification->id()); @@ -41,7 +41,7 @@ index a82d0a4..4bf1c53 100644 snoretoastArgsList << QStringLiteral("-p") << iconPath; } -@@ -207,19 +218,20 @@ void NotifyBySnore::notifyDeferred(KNotification *notification) +@@ -200,19 +211,20 @@ void NotifyBySnore::notifyDeferred(KNotification *notification) const auto data = snoretoastProcess->readAllStandardOutput(); qCDebug(LOG_KNOTIFICATIONS) << "SnoreToast process stdout:" << snoretoastArgsList << data; }); @@ -66,7 +66,7 @@ index a82d0a4..4bf1c53 100644 }); qCDebug(LOG_KNOTIFICATIONS) << "SnoreToast process starting:" << snoretoastArgsList; -@@ -228,6 +240,9 @@ void NotifyBySnore::notifyDeferred(KNotification *notification) +@@ -221,6 +233,9 @@ void NotifyBySnore::notifyDeferred(KNotification *notification) void NotifyBySnore::close(KNotification *notification) { @@ -76,17 +76,15 @@ index a82d0a4..4bf1c53 100644 qCDebug(LOG_KNOTIFICATIONS) << "Requested to close notification with ID:" << notification->id(); if (m_notifications.constFind(notification->id()) == m_notifications.constEnd()) { qCWarning(LOG_KNOTIFICATIONS) << "Couldn't find the notification in m_notifications. Nothing to close."; -@@ -246,9 +261,7 @@ void NotifyBySnore::close(KNotification *notification) +@@ -239,7 +254,5 @@ void NotifyBySnore::close(KNotification *notification) - void NotifyBySnore::update(KNotification *notification, const KNotifyConfig ¬ifyConfig) + void NotifyBySnore::update(KNotification *notification, KNotifyConfig *config) { - Q_UNUSED(notification); -- Q_UNUSED(notifyConfig); +- Q_UNUSED(config); - qCWarning(LOG_KNOTIFICATIONS) << "updating a notification is not supported yet."; -+ notify(notification, notifyConfig); ++ notify(notification, config); } - - #include "moc_notifybysnore.cpp" -- -2.43.0 +2.35.1