Skip to content

Build and package SoftProjector on Linux with Qt 6 - #82

Open
higheraims wants to merge 9 commits into
SoftProjector:masterfrom
higheraims:linux-qt6
Open

Build and package SoftProjector on Linux with Qt 6#82
higheraims wants to merge 9 commits into
SoftProjector:masterfrom
higheraims:linux-qt6

Conversation

@higheraims

@higheraims higheraims commented Jul 26, 2026

Copy link
Copy Markdown

Build and package SoftProjector on Linux with Qt 6

This PR makes use of existing Qt6 migration work to get SoftProjector running on Linux. I verified on my system running Fedora 44 with Qt 6.11.1 and GCC 16, and simulated on Ubuntu 24.04 via CI. I separated into six commits for clarity.

Make the Qt6 build compile

Qt6 migration work in the master branch includes a copy of QMediaPlaylist under 3rdparty/, and it is included in projectordisplayscreen.cpp but integration was not complete.

  • Add the three sources and their INCLUDEPATH to softProjector.pro.
  • Fix the sources' internal includes (../include/ → ../headers/).
  • Drop #include <qmediaenumdebug.h> and the two Q_MEDIA_ENUM_DEBUG(...) macros from qmediaplaylist.h.
  • Ignore the qmake *_build/ output directories.

Document the build

BUILDING_LINUX.md covers the required Qt6 packages for Fedora and Debian/Ubuntu, the out-of-tree qmake6 && make steps. This addresses the request in #36.

Package for Linux

  • Per-user data dir: on Linux the database was written next to the binary, which will fail for a system install under /usr/bin. It now falls back to QStandardPaths::AppDataLocation when the install directory is not writable.
  • Install rules: unix:!macx target/desktop/icon rules in the .pro (override with PREFIX=), so make install stages the binary, desktop entry and icon.
  • Desktop entry and an RPM spec that builds from the qmake project and auto-detects its Qt6 runtime dependencies.
  • CI (.github/workflows/linux.yml): builds on Ubuntu with a headless smoke test, and builds the RPM in a Fedora container.

Notes

  • Requires the Qt6 multimedia development package.
  • The Windows build path is untouched.
  • Media playback uses Qt6's FFmpeg backend. Some Qt5 QMediaPlayer signal/slot connections in mediawidget.cpp still need updating for Qt6 but this PR is just about building for Linux.

Update

GeneralSettingWidget read and wrote the dark-theme preference through QSettings("HKEY_CURRENT_USER\…\Personalize", NativeFormat). On non-Windows platforms QSettings treats that string as a relative filename, so it created a stray HKEY_CURRENT_USER\Software\… file in the working directory. The dark theme is only applied on Windows (the main.cpp path is already Q_OS_WIN-guarded), so these accesses are now guarded the same way.

Refs #36, #76.

QMediaPlaylist was removed from Qt6's multimedia module, so a copy lives
under 3rdparty/. It was never wired into the build:

- Add its sources/headers and an INCLUDEPATH to softProjector.pro.
- Fix the vendored sources' includes (../include/ -> ../headers/).
- Drop the include of qmediaenumdebug.h (removed in newer Qt6) and the
  two Q_MEDIA_ENUM_DEBUG macros it provided; they only added QDebug
  streaming for the enums and are not needed to build or run.
The *_build/* patterns were anchored to the repo root, but the build
lands in src/unix_build/ (RES_DIR is relative to the .pro in src/).
On Linux the database was always written next to the binary. That fails
for a packaged install under /usr/bin. Keep the beside-the-binary
behaviour when that directory is writable (portable / build-dir runs),
otherwise fall back to QStandardPaths::AppDataLocation.

Also drop the dead Q_WS_WIN (Qt4) branch path implicitly by only
touching the non-Windows code.
unix:!macx install rules (target/desktop/icon) so 'make install' and the
packaging can stage the binary, desktop file and icon under PREFIX.
- packaging/rpm/softprojector.spec builds the RPM from the qmake project.
- .github/workflows/linux.yml builds on Ubuntu (with a headless smoke
  test) and builds the RPM in a Fedora container, uploading both.
@higheraims higheraims mentioned this pull request Jul 26, 2026
GeneralSettingWidget read/wrote the dark-theme preference via
QSettings("HKEY_CURRENT_USER\\...\\Personalize", NativeFormat). On
non-Windows, QSettings treats that string as a relative filename and
creates a junk file (e.g. ~/HKEY_CURRENT_USER\Software\...) in the
working directory. The dark theme is only applied on Windows (main.cpp is
already Q_OS_WIN-guarded), so compile these accesses out elsewhere.
The push trigger only listed master and linux-port, so pushes to the
working branch did not trigger CI. Trigger on any branch push so the
build and RPM jobs run on fork pushes too.
Group workflow runs by the head commit SHA and cancel in-progress
duplicates, so a branch push and its pull request do not build twice.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant