Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Qt5 support #1514

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
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
19 changes: 7 additions & 12 deletions .github/workflows/rssguard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,20 @@ jobs:

build-rssguard:
needs: check-build-script
name: "${{ matrix.os }}; no-lite = ${{ matrix.no_lite }}; qt5 = ${{ matrix.use_qt5 }}"
name: "${{ matrix.os }}; no-lite = ${{ matrix.no_lite }}; qt-version = ${{ matrix.qt_version }}"
runs-on: "${{ matrix.os }}"
strategy:
matrix:
os: [windows-2022, ubuntu-20.04, macos-13]
os: [windows-2022, ubuntu-24.04, macos-13]
no_lite: ["ON", "OFF"]
use_qt5: ["ON", "OFF"]
qt_version: ["6.3", "6.7"]
include:
- os: windows-2022
script_name: .\resources\scripts\github-actions\build-windows.ps1
- os: ubuntu-20.04
- os: ubuntu-24.04
script_name: ./resources/scripts/github-actions/build-linux-mac.sh
- os: macos-13
script_name: ./resources/scripts/github-actions/build-linux-mac.sh
exclude:
- os: ubuntu-20.04
use_qt5: "OFF"
- os: macos-13
use_qt5: "ON"
steps:
- name: Checkout source code
uses: actions/checkout@v4
Expand All @@ -56,7 +51,7 @@ jobs:
submodules: true

- name: Prepare environment and compile application
run: ${{ matrix.script_name }} "${{ matrix.os }}" "${{ matrix.no_lite }}" "${{ matrix.use_qt5 }}"
run: ${{ matrix.script_name }} "${{ matrix.os }}" "${{ matrix.no_lite }}" "${{ matrix.qt_version }}"
env:
GMAIL_CLIENT_ID: ${{ secrets.GMAIL_CLIENT_ID }}
GMAIL_CLIENT_SECRET: ${{ secrets.GMAIL_CLIENT_SECRET }}
Expand All @@ -68,7 +63,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: RSS_Guard-${{ runner.os }}${{ matrix.no_lite == 'ON' && '-' || '-nowebengine-' }}Qt${{ matrix.use_qt5 == 'ON' && '5' || '6' }}
name: RSS_Guard-${{ runner.os }}${{ matrix.no_lite == 'ON' && '-' || '-nowebengine-' }}Qt${{ matrix.qt_version }}
path: |
./rssguard-build/rssguard-*win*.exe
./rssguard-build/rssguard-*win*.7z
Expand All @@ -79,7 +74,7 @@ jobs:
name: distribute-binaries
needs:
- build-rssguard
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
contents: write

Expand Down
49 changes: 5 additions & 44 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
# cmake --install .
#
# Variables:
# BUILD_WITH_QT6 - Build either with Qt 6 or Qt 5.
# USE_SYSTEM_SQLITE - Use system-wide SQLite3 library and header file. Defaults to "ON".
# NO_UPDATE_CHECK - Disable automatic checking for new application updates.
# IS_FLATPAK_BUILD - Set to "ON" when building RSS Guard with Flatpak.
Expand All @@ -42,7 +41,6 @@
#
# Other information:
# - supports Windows, Linux, *BSD, macOS, OS/2, Android,
# - Qt 5.14.0 or newer is required,
# - Qt 6.3.0 or newer is required,
# - cmake 3.14.0 or newer is required,
# - if you wish to make packages for Windows, then you must initialize all submodules
Expand All @@ -52,7 +50,7 @@
# Building on OS/2:
# RSS Guard can run on OS/2 and if you want to compile it by yourself, you need to make sure that
# your OS/2 distro is up-to-date and you have all dependencies installed: os2-base, all gcc-* packages,
# libc and libcx up-to-date, kbuild-make, ash, binutils, all relevant qt5-* packages.
# libc and libcx up-to-date, kbuild-make, ash, binutils, all relevant qt6-* packages.
#
# After your dependecies are installed, then you can compile via standard `cmake -> make -> make install` steps
# and package with: 7z.exe a -t7z -mmt -mx9 "rssguard.7z" "<build-folder\src\rssguard\app\*" command.
Expand Down Expand Up @@ -117,7 +115,6 @@ if(FORCE_COLORED_OUTPUT)
endif()

# Global compilation switches.
option(BUILD_WITH_QT6 "Build application with Qt 6." ON)
option(USE_SYSTEM_SQLITE "Use system-wide SQLite3 library." ON)
option(NO_LITE "Enable QtWebEngine and other more demanding components." ON)
option(UPDATE_TRANSLATIONS "Call lupdate to update translation files from source (Qt 6 only)." OFF)
Expand All @@ -133,10 +130,10 @@ option(MEDIAPLAYER_FORCE_OPENGL "Use opengl-based render API with libmpv." ON)

# Import Qt libraries.
set(QT6_MIN_VERSION 6.3.0)
set(QT5_MIN_VERSION 5.14.0)

set(QT_COMPONENTS
Core
Core5Compat
Gui
LinguistTools
Network
Expand All @@ -147,10 +144,6 @@ set(QT_COMPONENTS
Concurrent
)

if(WIN32 AND NOT BUILD_WITH_QT6)
list(APPEND QT_COMPONENTS WinExtras)
endif()

if(NOT OS2)
list(APPEND QT_COMPONENTS Multimedia)
endif()
Expand All @@ -176,11 +169,7 @@ if(ENABLE_MEDIAPLAYER_LIBMPV)
if(MEDIAPLAYER_FORCE_OPENGL)
message(STATUS "Forcing OpenGL-based rendering for libmpv.")

list(APPEND QT_COMPONENTS OpenGL)

if(BUILD_WITH_QT6)
list(APPEND QT_COMPONENTS OpenGLWidgets)
endif()
list(APPEND QT_COMPONENTS OpenGL OpenGLWidgets)

add_compile_definitions(MEDIAPLAYER_LIBMPV_OPENGL)
endif()
Expand All @@ -204,36 +193,8 @@ if(UNIX AND NOT APPLE AND NOT ANDROID)
list(APPEND QT_COMPONENTS DBus)
endif()

if(BUILD_WITH_QT6)
find_package(QT NAMES Qt6)
find_package(Qt6 ${QT6_MIN_VERSION} COMPONENTS ${QT_COMPONENTS} Core5Compat REQUIRED)
else()
find_package(QT NAMES Qt5)
find_package(Qt5 ${QT5_MIN_VERSION} COMPONENTS ${QT_COMPONENTS} REQUIRED)

if(Qt5Core_VERSION VERSION_LESS 5.15.0)
# Compatibility macros.
macro(qt_wrap_ui)
qt5_wrap_ui(${ARGN})
endmacro()

macro(qt_add_resources)
qt5_add_resources(${ARGN})
endmacro()

macro(qt_add_big_resources)
qt5_add_big_resources(${ARGN})
endmacro()

macro(qt_create_translation)
qt5_create_translation(${ARGN})
endmacro()

macro(qt_add_translation)
qt5_add_translation(${ARGN})
endmacro()
endif()
endif()
find_package(QT NAMES Qt6)
find_package(Qt6 ${QT6_MIN_VERSION} COMPONENTS ${QT_COMPONENTS} REQUIRED)

# Load git commit hash.
if(REVISION_FROM_GIT AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
Expand Down
4 changes: 2 additions & 2 deletions docs/source/contrib/compile.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Here's a quick example of how to build it on Linux:
# Create a build directory
mkdir build-dir

# Configure the project to build using Qt 6, and disable built-in web browser support
cmake -B build-dir -S . -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_WITH_QT6=ON -DNO_LITE=OFF
# Configure the project to disable built-in web browser support
cmake -B build-dir -S . -DCMAKE_INSTALL_PREFIX=/usr -DNO_LITE=OFF

# Compile it (in parallel mode)
cmake --build build-dir -j$(nproc)
Expand Down
22 changes: 6 additions & 16 deletions localization/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if(UPDATE_TRANSLATIONS AND BUILD_WITH_QT6)
if(UPDATE_TRANSLATIONS)
# Regenerate "en" .ts file.
#
# "en" .ts file is only used as "source" language
Expand All @@ -20,18 +20,8 @@ FILE(GLOB TS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.ts)

set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}")

if(BUILD_WITH_QT6)
qt_add_lrelease(rssguard
TS_FILES ${TS_FILES}
QM_FILES_OUTPUT_VARIABLE QM_FILES
OPTIONS "-compress"
)
else()
qt_add_translation(QM_FILES
${TS_FILES}
OPTIONS "-compress"
)

add_custom_target(rssguard_lrelease DEPENDS ${QM_FILES})
add_dependencies(rssguard rssguard_lrelease)
endif()
qt_add_lrelease(rssguard
TS_FILES ${TS_FILES}
QM_FILES_OUTPUT_VARIABLE QM_FILES
OPTIONS "-compress"
)
4 changes: 2 additions & 2 deletions resources/android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<manifest package="com.rotter.rssguard" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0" android:versionCode="1" android:installLocation="auto">
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="RSS Guard" android:icon="@drawable/icon">
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="rssguard" android:screenOrientation="unspecified" android:launchMode="singleTop">
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt6.android.bindings.QtApplication" android:label="RSS Guard" android:icon="@drawable/icon">
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="org.qtproject.qt6.android.bindings.QtActivity" android:label="rssguard" android:screenOrientation="unspecified" android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Expand Down
46 changes: 30 additions & 16 deletions resources/scripts/github-actions/build-linux-mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -e

os="$1"
webengine="$2"
qt_major="$3"

# Determine OS.
if [[ "$os" == *"ubuntu"* ]]; then
Expand Down Expand Up @@ -31,35 +32,48 @@ fi

echo "OS: $os; Not lite: $webengine"

if [[ "$qt_major" == "6.3" ]]; then
QTVERSION="6.3.2"
else
QTVERSION="6.7.3"
fi

# Install needed dependencies.
if [ $is_linux = true ]; then
# Qt 5.
QTTARGET="linux"
QTOS="gcc_64"
QTARCH="gcc_64"
USE_QT6="OFF"

sudo add-apt-repository ppa:beineri/opt-qt-5.15.4-focal -y
if [[ "$qt_major" == "6.3" ]]; then
QTARCH="gcc_64"
else
QTARCH="linux_gcc_64"
fi

QTPATH="$(pwd)/Qt"
QTBIN="$QTPATH/$QTVERSION/$QTOS/bin"

sudo apt-get update
sudo apt-get -qy install openssl libssl-dev libgl1-mesa-dev gstreamer1.0-alsa gstreamer1.0-nice gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-qt6 gstreamer1.0-pulseaudio libmpv-dev libsqlite3-dev libcups2-dev appstream libfuse2

sudo apt-get -qy install qt515tools qt515base qt515webengine qt515svg qt515multimedia qt515imageformats appstream
sudo apt-get -qy install cmake ninja-build openssl libssl-dev libgl1-mesa-dev gstreamer1.0-alsa gstreamer1.0-nice gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-qt5 gstreamer1.0-pulseaudio libmpv-dev
# Install "aqtinstall" from its master branch to have latest code.
sudo pip3 install --break-system-packages aqtinstall

# The script below performs some broken testing, which ends up tripping 'set -e'.
# So we temporarily ignore errors when sourcing the script, and re-enable them afterward.
set +e
# shellcheck source=/dev/null
source /opt/qt515/bin/qt515-env.sh
set -e
echo "Qt bin directory is: $QTBIN"
echo "Qt will be installed to: $QTPATH"

# Install Qt.
aqt -c 'aqt/settings.ini' install-qt -O "$QTPATH" "$QTTARGET" "desktop" "$QTVERSION" "$QTARCH" -m "qtwebengine" "qtimageformats" "qtwebchannel" "qtmultimedia" "qt5compat" "qtpositioning" "qtserialport"
aqt -c 'aqt/settings.ini' install-tool -O "$QTPATH" "$QTTARGET" "desktop" "tools_cmake"
aqt -c 'aqt/settings.ini' install-tool -O "$QTPATH" "$QTTARGET" "desktop" "tools_ninja"

export QT_PLUGIN_PATH="$QTPATH/$QTVERSION/$QTOS/plugins"
export PATH="$QTBIN:$QTPATH/Tools/CMake/CMake/bin:$QTPATH/Tools/Ninja:$PATH"
else
# Qt 6.
QTTARGET="mac"
QTOS="macos"
QTARCH="clang_64"
USE_QT6="ON"

QTPATH="$(pwd)/Qt"
QTVERSION="6.7.3"
QTBIN="$QTPATH/$QTVERSION/$QTOS/bin"

# Install "aqtinstall" from its master branch to have latest code.
Expand All @@ -86,7 +100,7 @@ git_revision=$(git rev-parse --short HEAD)
mkdir rssguard-build
cd rssguard-build

cmake .. --warn-uninitialized -G Ninja -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.15" -DFORCE_BUNDLE_ICONS="ON" -DCMAKE_BUILD_TYPE="MinSizeRel" -DCMAKE_VERBOSE_MAKEFILE="ON" -DCMAKE_INSTALL_PREFIX="$prefix" -DREVISION_FROM_GIT="ON" -DBUILD_WITH_QT6="$USE_QT6" -DENABLE_COMPRESSED_SITEMAP="ON" -DENABLE_MEDIAPLAYER_LIBMPV="$libmpv" -DENABLE_MEDIAPLAYER_QTMULTIMEDIA="$qtmultimedia" -DNO_LITE="$webengine" -DFEEDLY_CLIENT_ID="$FEEDLY_CLIENT_ID" -DFEEDLY_CLIENT_SECRET="$FEEDLY_CLIENT_SECRET" -DGMAIL_CLIENT_ID="$GMAIL_CLIENT_ID" -DGMAIL_CLIENT_SECRET="$GMAIL_CLIENT_SECRET"
cmake .. --warn-uninitialized -G Ninja -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.15" -DFORCE_BUNDLE_ICONS="ON" -DCMAKE_BUILD_TYPE="MinSizeRel" -DCMAKE_VERBOSE_MAKEFILE="ON" -DCMAKE_INSTALL_PREFIX="$prefix" -DREVISION_FROM_GIT="ON" -DENABLE_COMPRESSED_SITEMAP="ON" -DENABLE_MEDIAPLAYER_LIBMPV="$libmpv" -DENABLE_MEDIAPLAYER_QTMULTIMEDIA="$qtmultimedia" -DNO_LITE="$webengine" -DFEEDLY_CLIENT_ID="$FEEDLY_CLIENT_ID" -DFEEDLY_CLIENT_SECRET="$FEEDLY_CLIENT_SECRET" -DGMAIL_CLIENT_ID="$GMAIL_CLIENT_ID" -DGMAIL_CLIENT_SECRET="$GMAIL_CLIENT_SECRET"
cmake --build .
cmake --install . --prefix "$prefix"

Expand Down
Loading