Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ runs:

cmake_args="$cmake_args -DUSE_TOMLPLUSPLUS=OFF -DUSE_CLI11=OFF"

# el8's EPEL GoogleTest predates MOCK_METHOD, so skip the test build there.
if [[ "${{ inputs.target-name }}" == rocky-8-* ]]; then
cmake_args="$cmake_args -DBUILD_TESTS=OFF"
fi

cmake_args_input=$(echo "${{ inputs.cmake-args }}" | tr '\n' ' ')
cmake_args="$cmake_args $cmake_args_input"

Expand Down
32 changes: 32 additions & 0 deletions .github/actions/install-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# SPDX-License-Identifier: MIT

name: "Install dependencies"
description: "Install build dependencies for Synergy."

inputs:
working-directory:
Expand All @@ -11,6 +12,10 @@ inputs:
description: "The version of Qt to install on macOS and Windows."
required: false
default: "6.9.3"
target-name:
description: "The name of the build target (e.g. rocky-8-x86_64)."
required: false
default: ""

outputs:
vcpkg-cmake-config:
Expand All @@ -27,6 +32,33 @@ runs:
working-directory: ${{ inputs.working-directory }}
run: ./scripts/install_deps.sh ${args}

# el8/el9 ship cmake 3.20 (below our 3.22 minimum); el8 also has no C++20 compiler
# and only Python 3.6. Set up a newer cmake/compiler/python before the Python env
# and build steps that need them.
- name: Setup RHEL toolchain
if: ${{ startsWith(inputs.target-name, 'rocky') }}
shell: bash
run: |
. /etc/os-release

cmake_version=3.28.3
curl -fsSL "https://github.com/Kitware/CMake/releases/download/v${cmake_version}/cmake-${cmake_version}-linux-x86_64.tar.gz" \
| tar -xz -C /opt
echo "/opt/cmake-${cmake_version}-linux-x86_64/bin" >> "$GITHUB_PATH"

if [ "${VERSION_ID%%.*}" = "8" ]; then
toolset=/opt/rh/gcc-toolset-13/root/usr
echo "${toolset}/bin" >> "$GITHUB_PATH"
echo "CC=${toolset}/bin/gcc" >> "$GITHUB_ENV"
echo "CXX=${toolset}/bin/g++" >> "$GITHUB_ENV"
echo "LD_LIBRARY_PATH=${toolset}/lib64" >> "$GITHUB_ENV"

# el8's python3 is 3.6; the build scripts need >= 3.9, so expose python3.11 as python3.
mkdir -p /opt/python-shim
ln -sf /usr/bin/python3.11 /opt/python-shim/python3
echo "/opt/python-shim" >> "$GITHUB_PATH"
fi

# HACK: Needed for GTest on Windows (installed bia Meson).
- name: Install Meson deps (Windows)
if: ${{ runner.os == 'Windows' }}
Expand Down
8 changes: 8 additions & 0 deletions .github/matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ target:
runs-on: ubuntu-latest
container: fedora:42

- name: rocky-8-x86_64
runs-on: ubuntu-latest
container: rockylinux:8

- name: rocky-9-x86_64
runs-on: ubuntu-latest
container: rockylinux:9

- name: opensuse-tumbleweed-x86_64
runs-on: ubuntu-latest
container: opensuse/tumbleweed:latest
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ jobs:
id: install-deps
if: ${{ !steps.vars.outputs.is-flatpak }}
uses: ./.github/actions/install-deps
with:
target-name: ${{ matrix.target.name }}

- name: Build
id: build
Expand All @@ -201,7 +203,7 @@ jobs:
${{ steps.install-deps.outputs.vcpkg-cmake-config }}

- name: Tests
if: ${{ !steps.vars.outputs.is-flatpak }}
if: ${{ !steps.vars.outputs.is-flatpak && !startsWith(matrix.target.name, 'rocky-8') }}
uses: ./.github/actions/run-tests
timeout-minutes: 2
with:
Expand Down
7 changes: 4 additions & 3 deletions cmake/Libraries.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ macro(configure_libs)
configure_windows_libs()
endif()

find_package(Qt6 REQUIRED COMPONENTS Core Widgets Network)
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Widgets Network)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Widgets Network)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
Expand Down Expand Up @@ -540,11 +541,11 @@ endmacro()
macro(configure_qt)

find_package(
Qt6
Qt${QT_VERSION_MAJOR}
COMPONENTS Core Widgets Network Xml
REQUIRED)

message(STATUS "Qt version: ${Qt6_VERSION}")
message(STATUS "Qt version: ${Qt${QT_VERSION_MAJOR}_VERSION}")

set(GUI_RES_DIR ${DESKFLOW_RES_DIR}/gui)
set(GUI_QRC_FILE ${GUI_RES_DIR}/app.qrc)
Expand Down
57 changes: 57 additions & 0 deletions scripts/install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ install_linux_deps() {
echo "Detected Linux: ${os}"
case "${os}" in
*debian*) install_debian_deps ;;
*rhel*) install_rhel_deps ;;
*fedora*) install_fedora_deps ;;
*suse*) install_suse_deps ;;
*arch*) install_arch_deps ;;
Expand Down Expand Up @@ -132,6 +133,62 @@ install_fedora_deps() {
cli11-devel
}

install_rhel_deps() {
dnf install -y 'dnf-command(config-manager)'
dnf install -y epel-release

# The -devel packages live in the CodeReady Builder repo (powertools on el8, crb on el9+).
dnf config-manager --set-enabled powertools 2>/dev/null \
|| dnf config-manager --set-enabled crb 2>/dev/null || true

. /etc/os-release || true

# el8 has no Qt6 and a pre-C++20 compiler, so it needs Qt5 and a gcc-toolset;
# el9+ build against Qt6. qttools is skipped (the build has no translations, and
# on el9 EPEL's qt6-linguist has an unsatisfiable LLVM dependency).
if [ "${VERSION_ID%%.*}" = "8" ]; then
dnf install -y \
cmake \
make \
ninja-build \
tar \
gzip \
python3.11 \
python3.11-pip \
gcc-toolset-13 \
rpm-build \
openssl-devel \
glib2-devel \
gdk-pixbuf2-devel \
libXtst-devel \
libnotify-devel \
libxkbfile-devel \
qt5-qtbase-devel \
gtk3-devel \
gtest-devel \
gmock-devel
else
dnf install -y \
cmake \
make \
ninja-build \
tar \
gzip \
gcc-c++ \
rpm-build \
openssl-devel \
glib2-devel \
gdk-pixbuf2-devel \
libXtst-devel \
libnotify-devel \
libxkbfile-devel \
qt6-qtbase-devel \
gtk3-devel \
gtest-devel \
gmock-devel
fi
}

install_suse_deps() {
zypper refresh
zypper --non-interactive --no-gpg-checks install -y --force-resolution \
Expand Down
4 changes: 3 additions & 1 deletion scripts/lib/cmd_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

import subprocess
import sys
import lib.env as env

try:
import colorama # type: ignore
Expand Down Expand Up @@ -90,6 +89,9 @@ def run(
print_cmd (bool): Print the command before running it (false by default for security)
"""

# Imported here, not at module top, to avoid a circular import with lib.env.
import lib.env as env

is_list_cmd = isinstance(command, list)

# create string version of list command, only for debugging purposes
Expand Down
8 changes: 4 additions & 4 deletions src/apps/deskflow-daemon/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ if(WIN32)
platform
app
${libs}
Qt6::Core)
find_package(Qt6 REQUIRED COMPONENTS Widgets)
get_target_property(WINDEPLOYQT_EXE Qt6::windeployqt IMPORTED_LOCATION)
Qt${QT_VERSION_MAJOR}::Core)

find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets)
get_target_property(WINDEPLOYQT_EXE Qt${QT_VERSION_MAJOR}::windeployqt IMPORTED_LOCATION)
add_custom_command(TARGET ${DAEMON_BINARY_NAME} POST_BUILD
COMMAND ${WINDEPLOYQT_EXE}
--no-compiler-runtime
Expand Down
10 changes: 5 additions & 5 deletions src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ target_link_libraries(
${target}
${DESKFLOW_GUI_HOOK_LIB}
gui
Qt6::Core
Qt6::Widgets
Qt6::Network)
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Widgets
Qt${QT_VERSION_MAJOR}::Network)

if(WIN32)
set_target_properties(${target} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMT")
Expand Down Expand Up @@ -110,8 +110,8 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")

elseif(WIN32)

find_package(Qt6 REQUIRED COMPONENTS Widgets)
get_target_property(WINDEPLOYQT_EXE Qt6::windeployqt IMPORTED_LOCATION)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets)
get_target_property(WINDEPLOYQT_EXE Qt${QT_VERSION_MAJOR}::windeployqt IMPORTED_LOCATION)
add_custom_command(TARGET ${GUI_BINARY_NAME} POST_BUILD
COMMAND ${WINDEPLOYQT_EXE}
--force-openssl
Expand Down
1 change: 1 addition & 0 deletions src/gui/src/Hotkey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "Hotkey.h"

#include <QSettings>
#include <QTextStream>

Hotkey::Hotkey() : m_KeySequence(), m_Actions()
{
Expand Down
18 changes: 17 additions & 1 deletion src/gui/src/ScreenSetupView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,11 @@ void ScreenSetupView::dragMoveEvent(QDragMoveEvent *event)
event->setDropAction(Qt::MoveAction);
event->accept();
} else {
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
const auto &point = event->position().toPoint();
#else
const auto &point = event->pos();
#endif
int col = columnAt(point.x());
int row = rowAt(point.y());

Expand Down Expand Up @@ -145,10 +149,22 @@ void ScreenSetupView::startDrag(Qt::DropActions)
}
}

#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
void ScreenSetupView::initViewItemOption(QStyleOptionViewItem *option) const
{
option->showDecorationSelected = true;
option->decorationPosition = QStyleOptionViewItem::Top;
option->displayAlignment = Qt::AlignCenter;
option->textElideMode = Qt::ElideMiddle;
}
}
#else
QStyleOptionViewItem ScreenSetupView::viewOptions() const
{
QStyleOptionViewItem option = QTableView::viewOptions();
option.showDecorationSelected = true;
option.decorationPosition = QStyleOptionViewItem::Top;
option.displayAlignment = Qt::AlignCenter;
option.textElideMode = Qt::ElideMiddle;
return option;
}
#endif
4 changes: 4 additions & 0 deletions src/gui/src/ScreenSetupView.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ class ScreenSetupView : public QTableView
void dragEnterEvent(QDragEnterEvent *event) override;
void dragMoveEvent(QDragMoveEvent *event) override;
void startDrag(Qt::DropActions supportedActions) override;
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
void initViewItemOption(QStyleOptionViewItem *option) const override;
#else
QStyleOptionViewItem viewOptions() const override;
#endif
void scrollTo(const QModelIndex &, ScrollHint) override
{
}
Expand Down
Loading
Loading