From e7e6d59172bc91a42528d53fb65a226444a0c8f9 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Mon, 17 Mar 2025 20:43:09 +0100 Subject: [PATCH] Remove KDSingleApplication from 3rdparty --- .github/workflows/build.yml | 39 +++++++++++++++++++ .gitmodules | 4 -- 3rdparty/README.md | 11 ------ 3rdparty/kdsingleapplication/CMakeLists.txt | 11 ------ .../kdsingleapplication/KDSingleApplication | 1 - CMakeLists.txt | 17 +------- debian/control | 1 + dist/unix/strawberry.spec.in | 4 ++ 8 files changed, 46 insertions(+), 42 deletions(-) delete mode 100644 3rdparty/README.md delete mode 100644 3rdparty/kdsingleapplication/CMakeLists.txt delete mode 160000 3rdparty/kdsingleapplication/KDSingleApplication diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 562f84f00..37d052776 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -84,6 +84,17 @@ jobs: - name: Install kdsingleapplication-qt6-devel if: matrix.opensuse_version == 'tumbleweed' run: zypper -n --gpg-auto-import-keys in kdsingleapplication-qt6-devel + - name: Build and install KDSingleApplication + if: matrix.opensuse_version == 'leap:15.6' + env: + CC: gcc-14 + CXX: g++-14 + run: | + git clone --depth 1 --recurse-submodules https://github.com/KDAB/KDSingleApplication + cd KDSingleApplication + cmake -S . -B build -DCMAKE_BUILD_TYPE="Release" -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DKDSingleApplication_STATIC=ON + cmake --build build --config Release --parallel 4 + cmake --install build - name: Checkout uses: actions/checkout@v4 with: @@ -380,10 +391,19 @@ jobs: lib64qt6help-devel lib64qt6test-devel lib64sparsehash-devel + lib64kdsingleapplication-devel desktop-file-utils appstream-util hicolor-icon-theme gtest + - name: Build and install KDSingleApplication + if: matrix.mageia_version == '9' + run: | + git clone --depth 1 --recurse-submodules https://github.com/KDAB/KDSingleApplication + cd KDSingleApplication + cmake -S . -B build -DCMAKE_BUILD_TYPE="Release" -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DKDSingleApplication_STATIC=ON + cmake --build build --config Release --parallel 4 + cmake --install build - name: Checkout uses: actions/checkout@v4 with: @@ -474,6 +494,13 @@ jobs: qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools + - name: Build and install KDSingleApplication + run: | + git clone --depth 1 --recurse-submodules https://github.com/KDAB/KDSingleApplication + cd KDSingleApplication + cmake -S . -B build -DCMAKE_BUILD_TYPE="Release" -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DKDSingleApplication_STATIC=ON + cmake --build build --config Release --parallel 4 + cmake --install build - name: Checkout uses: actions/checkout@v4 with: @@ -558,6 +585,13 @@ jobs: qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools + - name: Build and install KDSingleApplication + run: | + git clone --depth 1 --recurse-submodules https://github.com/KDAB/KDSingleApplication + cd KDSingleApplication + cmake -S . -B build -DCMAKE_BUILD_TYPE="Release" -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DKDSingleApplication_STATIC=ON + cmake --build build --config Release --parallel 4 + cmake --install build - name: Checkout uses: actions/checkout@v4 with: @@ -643,6 +677,7 @@ jobs: qt6-l10n-tools gstreamer1.0-alsa gstreamer1.0-pulseaudio + libkdsingleapplication-qt6-dev - name: Install keyboxd if: matrix.ubuntu_version == 'noble' env: @@ -655,6 +690,10 @@ jobs: submodules: recursive - name: Add safe git directory run: git config --global --add safe.directory ${GITHUB_WORKSPACE} + - name: Modify required KDSingleApplication version + run: | + sed -i 's/^find_package(KDSingleApplication-qt\${QT_VERSION_MAJOR} 1.1.0 REQUIRED)$/find_package(KDSingleApplication-qt\${QT_VERSION_MAJOR} 1.0.0 REQUIRED)/g' CMakeLists.txt + sed -i 's/, KDSingleApplication::Option::IncludeUsernameInSocketName);$/);/g' src/main.cpp - name: Create Build Environment run: cmake -E make_directory build - name: Configure CMake diff --git a/.gitmodules b/.gitmodules index 27c3a4b3f..e69de29bb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +0,0 @@ -[submodule "3rdparty/kdsingleapplication/KDSingleApplication"] - path = 3rdparty/kdsingleapplication/KDSingleApplication - url = https://github.com/KDAB/KDSingleApplication.git - branch = master diff --git a/3rdparty/README.md b/3rdparty/README.md deleted file mode 100644 index c7221d912..000000000 --- a/3rdparty/README.md +++ /dev/null @@ -1,11 +0,0 @@ -3rdparty libraries located in this directory -============================================ - -KDSingleApplication -------------------- -A small library used by Strawberry to prevent it from starting twice per user session. -If the user tries to start strawberry twice, the main window will maximize instead of starting another instance. -It is also used to pass command-line options through to the first instance. -This 3rdparty copy is used only if KDSingleApplication 1.1 or higher is not found on the system. - -URL: https://github.com/KDAB/KDSingleApplication/ diff --git a/3rdparty/kdsingleapplication/CMakeLists.txt b/3rdparty/kdsingleapplication/CMakeLists.txt deleted file mode 100644 index e2ce7408a..000000000 --- a/3rdparty/kdsingleapplication/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.13) -set(SOURCES KDSingleApplication/src/kdsingleapplication.cpp KDSingleApplication/src/kdsingleapplication_localsocket.cpp) -set(HEADERS KDSingleApplication/src/kdsingleapplication.h KDSingleApplication/src/kdsingleapplication_localsocket_p.h) -qt_wrap_cpp(MOC ${HEADERS}) -add_library(kdsingleapplication STATIC ${SOURCES} ${MOC}) -if(NOT MSVC) - target_compile_options(kdsingleapplication PRIVATE -Wno-missing-declarations) -endif() -target_compile_definitions(kdsingleapplication PRIVATE -DKDSINGLEAPPLICATION_STATIC_BUILD) -target_include_directories(kdsingleapplication PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) -target_link_libraries(kdsingleapplication PUBLIC Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Network) diff --git a/3rdparty/kdsingleapplication/KDSingleApplication b/3rdparty/kdsingleapplication/KDSingleApplication deleted file mode 160000 index cb0c664b4..000000000 --- a/3rdparty/kdsingleapplication/KDSingleApplication +++ /dev/null @@ -1 +0,0 @@ -Subproject commit cb0c664b40d3b31bad30aa3521eff603162ed0bd diff --git a/CMakeLists.txt b/CMakeLists.txt index 1dfe2fb36..c1b7fa171 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -249,20 +249,7 @@ if(X11_FOUND) unset(CMAKE_REQUIRED_LIBRARIES) endif() -# SingleApplication -set(KDSINGLEAPPLICATION_NAME "KDSingleApplication-qt${QT_VERSION_MAJOR}") -find_package(${KDSINGLEAPPLICATION_NAME} 1.1.0) -if(TARGET KDAB::kdsingleapplication) - set(KDSINGLEAPPLICATION_VERSION "${KDSingleApplication-qt6_VERSION}") - message(STATUS "Using system KDSingleApplication (Version ${KDSINGLEAPPLICATION_VERSION})") - set(SINGLEAPPLICATION_LIBRARIES KDAB::kdsingleapplication) -else() - message(STATUS "Using 3rdparty KDSingleApplication") - add_subdirectory(3rdparty/kdsingleapplication) - set(SINGLEAPPLICATION_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/kdsingleapplication/KDSingleApplication/src) - set(SINGLEAPPLICATION_LIBRARIES kdsingleapplication) - add_definitions(-DKDSINGLEAPPLICATION_STATIC_BUILD) -endif() +find_package(KDSingleApplication-qt${QT_VERSION_MAJOR} 1.1.0 REQUIRED) if(APPLE) find_library(SPARKLE Sparkle) @@ -1553,7 +1540,7 @@ target_link_libraries(strawberry_lib PUBLIC $<$:qtsparkle-qt${QT_VERSION_MAJOR}::qtsparkle> $<$:dsound dwmapi getopt-win::getopt> $<$:WindowsApp> - ${SINGLEAPPLICATION_LIBRARIES} + KDAB::kdsingleapplication ) if(APPLE) diff --git a/debian/control b/debian/control index e6204a06e..01132ba8e 100644 --- a/debian/control +++ b/debian/control @@ -22,6 +22,7 @@ Build-Depends: debhelper-compat (= 12), qt6-tools-dev, qt6-tools-dev-tools, qt6-l10n-tools, + libkdsingleapplication-qt6-dev, libgstreamer1.0-dev, libgstreamer-plugins-base1.0-dev, libcdio-dev, diff --git a/dist/unix/strawberry.spec.in b/dist/unix/strawberry.spec.in index 1f1e20504..46a2a1cc8 100644 --- a/dist/unix/strawberry.spec.in +++ b/dist/unix/strawberry.spec.in @@ -67,6 +67,10 @@ BuildRequires: pkgconfig(libsparsehash) BuildRequires: cmake(GTest) BuildRequires: pkgconfig(gmock) +%if 0%{?fedora} || (0%{?suse_version} && 0%{?suse_version} > 1600) || "%{?_vendor}" == "openmandriva" +BuildRequires: cmake(KDSingleApplication-qt6) +%endif + %if 0%{?suse_version} Requires: qt6-sql-sqlite Requires: qt6-network-tls