Build and package SoftProjector on Linux with Qt 6 - #82
Open
higheraims wants to merge 9 commits into
Open
Conversation
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.
Open
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
QMediaPlaylistunder3rdparty/, and it is included inprojectordisplayscreen.cppbut integration was not complete.INCLUDEPATHtosoftProjector.pro.../include/→../headers/).#include <qmediaenumdebug.h>and the twoQ_MEDIA_ENUM_DEBUG(...)macros fromqmediaplaylist.h.*_build/output directories.Document the build
BUILDING_LINUX.mdcovers the required Qt6 packages for Fedora and Debian/Ubuntu, the out-of-treeqmake6 && makesteps. This addresses the request in #36.Package for Linux
/usr/bin. It now falls back toQStandardPaths::AppDataLocationwhen the install directory is not writable.unix:!macxtarget/desktop/iconrules in the.pro(override withPREFIX=), somake installstages the binary, desktop entry and icon..github/workflows/linux.yml): builds on Ubuntu with a headless smoke test, and builds the RPM in a Fedora container.Notes
QMediaPlayersignal/slot connections inmediawidget.cppstill 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.