Remove KDSingleApplication from 3rdparty

This commit is contained in:
Jonas Kvinge
2025-03-17 20:43:09 +01:00
parent 95b12a01a4
commit e7e6d59172
8 changed files with 46 additions and 42 deletions

View File

@@ -84,6 +84,17 @@ jobs:
- name: Install kdsingleapplication-qt6-devel - name: Install kdsingleapplication-qt6-devel
if: matrix.opensuse_version == 'tumbleweed' if: matrix.opensuse_version == 'tumbleweed'
run: zypper -n --gpg-auto-import-keys in kdsingleapplication-qt6-devel 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 - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
@@ -380,10 +391,19 @@ jobs:
lib64qt6help-devel lib64qt6help-devel
lib64qt6test-devel lib64qt6test-devel
lib64sparsehash-devel lib64sparsehash-devel
lib64kdsingleapplication-devel
desktop-file-utils desktop-file-utils
appstream-util appstream-util
hicolor-icon-theme hicolor-icon-theme
gtest 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 - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
@@ -474,6 +494,13 @@ jobs:
qt6-tools-dev qt6-tools-dev
qt6-tools-dev-tools qt6-tools-dev-tools
qt6-l10n-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 - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
@@ -558,6 +585,13 @@ jobs:
qt6-tools-dev qt6-tools-dev
qt6-tools-dev-tools qt6-tools-dev-tools
qt6-l10n-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 - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
@@ -643,6 +677,7 @@ jobs:
qt6-l10n-tools qt6-l10n-tools
gstreamer1.0-alsa gstreamer1.0-alsa
gstreamer1.0-pulseaudio gstreamer1.0-pulseaudio
libkdsingleapplication-qt6-dev
- name: Install keyboxd - name: Install keyboxd
if: matrix.ubuntu_version == 'noble' if: matrix.ubuntu_version == 'noble'
env: env:
@@ -655,6 +690,10 @@ jobs:
submodules: recursive submodules: recursive
- name: Add safe git directory - name: Add safe git directory
run: git config --global --add safe.directory ${GITHUB_WORKSPACE} 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 - name: Create Build Environment
run: cmake -E make_directory build run: cmake -E make_directory build
- name: Configure CMake - name: Configure CMake

4
.gitmodules vendored
View File

@@ -1,4 +0,0 @@
[submodule "3rdparty/kdsingleapplication/KDSingleApplication"]
path = 3rdparty/kdsingleapplication/KDSingleApplication
url = https://github.com/KDAB/KDSingleApplication.git
branch = master

11
3rdparty/README.md vendored
View File

@@ -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/

View File

@@ -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)

View File

@@ -249,20 +249,7 @@ if(X11_FOUND)
unset(CMAKE_REQUIRED_LIBRARIES) unset(CMAKE_REQUIRED_LIBRARIES)
endif() endif()
# SingleApplication find_package(KDSingleApplication-qt${QT_VERSION_MAJOR} 1.1.0 REQUIRED)
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()
if(APPLE) if(APPLE)
find_library(SPARKLE Sparkle) find_library(SPARKLE Sparkle)
@@ -1553,7 +1540,7 @@ target_link_libraries(strawberry_lib PUBLIC
$<$<BOOL:${HAVE_QTSPARKLE}>:qtsparkle-qt${QT_VERSION_MAJOR}::qtsparkle> $<$<BOOL:${HAVE_QTSPARKLE}>:qtsparkle-qt${QT_VERSION_MAJOR}::qtsparkle>
$<$<BOOL:${WIN32}>:dsound dwmapi getopt-win::getopt> $<$<BOOL:${WIN32}>:dsound dwmapi getopt-win::getopt>
$<$<BOOL:${MSVC}>:WindowsApp> $<$<BOOL:${MSVC}>:WindowsApp>
${SINGLEAPPLICATION_LIBRARIES} KDAB::kdsingleapplication
) )
if(APPLE) if(APPLE)

1
debian/control vendored
View File

@@ -22,6 +22,7 @@ Build-Depends: debhelper-compat (= 12),
qt6-tools-dev, qt6-tools-dev,
qt6-tools-dev-tools, qt6-tools-dev-tools,
qt6-l10n-tools, qt6-l10n-tools,
libkdsingleapplication-qt6-dev,
libgstreamer1.0-dev, libgstreamer1.0-dev,
libgstreamer-plugins-base1.0-dev, libgstreamer-plugins-base1.0-dev,
libcdio-dev, libcdio-dev,

View File

@@ -67,6 +67,10 @@ BuildRequires: pkgconfig(libsparsehash)
BuildRequires: cmake(GTest) BuildRequires: cmake(GTest)
BuildRequires: pkgconfig(gmock) BuildRequires: pkgconfig(gmock)
%if 0%{?fedora} || (0%{?suse_version} && 0%{?suse_version} > 1600) || "%{?_vendor}" == "openmandriva"
BuildRequires: cmake(KDSingleApplication-qt6)
%endif
%if 0%{?suse_version} %if 0%{?suse_version}
Requires: qt6-sql-sqlite Requires: qt6-sql-sqlite
Requires: qt6-network-tls Requires: qt6-network-tls