Skip to content
This repository was archived by the owner on Mar 28, 2026. It is now read-only.

Commit f204676

Browse files
committed
Fix some qt6 builds
- Fixes build and package for at least Ubuntu 24.04 - Defaulted to building and statically linking mpvqt as most platforms lack packages for it. - Workaround mpvqt requiring qt>=6.5 for wayland support with a few workarounds when statically building. - Additionally, default to xcb on qt<6.5 due to mpvqt using qt>=6.5 fetures for wayland. Wayland can be forced, but seems to give black video.
1 parent 6f54621 commit f204676

File tree

15 files changed

+123
-11
lines changed

15 files changed

+123
-11
lines changed

.github/workflows/main.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ jobs:
1111
runs-on: macos-13
1212
steps:
1313
- uses: actions/checkout@v4
14+
with:
15+
submodules: recursive
1416
- name: Install dependencies
1517
run: |
1618
brew update
@@ -50,6 +52,8 @@ jobs:
5052
runs-on: macos-14
5153
steps:
5254
- uses: actions/checkout@v4
55+
with:
56+
submodules: recursive
5357
- name: Install dependencies
5458
run: |
5559
brew update
@@ -78,6 +82,8 @@ jobs:
7882
runs-on: windows-latest
7983
steps:
8084
- uses: actions/checkout@v4
85+
with:
86+
submodules: recursive
8187
- name: Install Qt 6
8288
uses: jurplel/install-qt-action@v3
8389
with:
@@ -107,7 +113,7 @@ jobs:
107113
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
108114
cd build
109115
set PATH=%PATH%;C:\Program Files (x86)\WiX Toolset v3.11\bin;%CD%
110-
cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=output -DCMAKE_MAKE_PROGRAM=ninja.exe -DQTROOT=%Qt6_DIR% -DMPV_INCLUDE_DIR=mpv/include -DMPV_LIBRARY=mpv/libmpv-2.dll -DCMAKE_INSTALL_PREFIX=output ..
116+
cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=output -DCMAKE_MAKE_PROGRAM=ninja.exe -DQTROOT=%Qt6_DIR% -DMPV_INCLUDE_DIR=mpv/include -DMPV_LIBRARY=mpv/libmpv-2.dll ..
111117
lib /def:mpv\mpv.def /out:mpv\libmpv-2.dll.lib /MACHINE:X64
112118
ninja
113119
ninja windows_package
@@ -122,6 +128,8 @@ jobs:
122128
runs-on: windows-latest
123129
steps:
124130
- uses: actions/checkout@v4
131+
with:
132+
submodules: recursive
125133
- name: Install Qt 6
126134
uses: jurplel/install-qt-action@v4
127135
with:
@@ -151,7 +159,7 @@ jobs:
151159
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
152160
cd build
153161
set PATH=%PATH%;C:\Program Files (x86)\WiX Toolset v3.11\bin;%CD%
154-
cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=output -DCMAKE_MAKE_PROGRAM=ninja.exe -DQTROOT=%Qt6_DIR% -DMPV_INCLUDE_DIR=mpv/include -DMPV_LIBRARY=mpv/libmpv-2.dll -DCMAKE_INSTALL_PREFIX=output ..
162+
cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=output -DCMAKE_MAKE_PROGRAM=ninja.exe -DQTROOT=%Qt6_DIR% -DMPV_INCLUDE_DIR=mpv/include -DMPV_LIBRARY=mpv/libmpv-2.dll ..
155163
lib /def:mpv\mpv.def /out:mpv\libmpv-2.dll.lib /MACHINE:X64
156164
ninja
157165
ninja windows_package
@@ -166,6 +174,8 @@ jobs:
166174
runs-on: windows-latest
167175
steps:
168176
- uses: actions/checkout@v4
177+
with:
178+
submodules: recursive
169179
- name: Install Qt 6
170180
uses: jurplel/install-qt-action@v4
171181
with:
@@ -195,7 +205,7 @@ jobs:
195205
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars32.bat"
196206
cd build
197207
set PATH=%PATH%;C:\Program Files (x86)\WiX Toolset v3.11\bin;%CD%
198-
cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=output -DCMAKE_MAKE_PROGRAM=ninja.exe -DQTROOT=%Qt6_DIR% -DMPV_INCLUDE_DIR=mpv/include -DMPV_LIBRARY=mpv/libmpv-2.dll -DCMAKE_INSTALL_PREFIX=output ..
208+
cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=output -DCMAKE_MAKE_PROGRAM=ninja.exe -DQTROOT=%Qt6_DIR% -DMPV_INCLUDE_DIR=mpv/include -DMPV_LIBRARY=mpv/libmpv-2.dll ..
199209
lib /def:mpv\mpv.def /out:mpv\libmpv-2.dll.lib /MACHINE:X86
200210
ninja
201211
ninja windows_package
@@ -214,6 +224,8 @@ jobs:
214224
runs-on: "ubuntu-latest"
215225
steps:
216226
- uses: actions/checkout@v4
227+
with:
228+
submodules: recursive
217229
- name: Install dependencies
218230
run: |
219231
sudo apt-get update
@@ -285,6 +297,8 @@ jobs:
285297
runs-on: "ubuntu-latest"
286298
steps:
287299
- uses: actions/checkout@v4
300+
with:
301+
submodules: recursive
288302
- name: Install dependencies
289303
run: |
290304
sudo apt-get update

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v4
14+
with:
15+
submodules: recursive
1416

1517
- name: Install build dependencies from debian/control
1618
run: |

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "external/mpvqt"]
2+
path = external/mpvqt
3+
url = https://invent.kde.org/libraries/mpvqt.git

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE BOOL "" FORCE)
1313
option(CHECK_FOR_UPDATES "Enable checking for new versions of Jellyfin Media Player" ON)
1414
option(OPENELEC "Make an OpenELEC build" OFF)
1515
option(LINUX_X11POWER "Enable non D-Bus screensaver management" OFF)
16+
option(USE_STATIC_MPVQT "Build MpvQt from bundled submodule instead of using system library" ON)
1617

1718
if (NOT CHECK_FOR_UPDATES)
1819
add_definitions(-DDISABLE_UPDATE_CHECK)

CMakeModules/DependencyConfiguration.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,7 @@ endif(IS_DIRECTORY ${DEPENDENCY_ROOT})
4141

4242
find_package(Threads REQUIRED)
4343
find_package(PythonInterp REQUIRED)
44-
find_package(MpvQt REQUIRED)
44+
45+
if(NOT USE_STATIC_MPVQT)
46+
find_package(MpvQt REQUIRED)
47+
endif()

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ To download the latest stable release, get the latest version tag from the [late
2323

2424
Example:
2525
```bash
26-
git clone https://github.com/jellyfin/jellyfin-media-player.git --branch v1.9.1 --single-branch
26+
git clone --recursive https://github.com/jellyfin/jellyfin-media-player.git --branch v1.9.1 --single-branch
2727
```
2828

2929

@@ -44,7 +44,7 @@ sudo ln -s /usr/local/lib/x86_64-linux-gnu/libmpv.so /usr/local/lib/x86_64-linux
4444
sudo ln -sf /usr/local/lib/x86_64-linux-gnu/libmpv.so /usr/local/lib/libmpv.so.2
4545
sudo ldconfig
4646
cd ~/jmp/
47-
git clone https://github.com/jellyfin/jellyfin-media-player.git
47+
git clone --recursive https://github.com/jellyfin/jellyfin-media-player.git
4848
cd jellyfin-media-player
4949
mkdir build
5050
cd build
@@ -77,7 +77,7 @@ sudo ln -s /usr/local/lib64/libmpv.so /usr/local/lib/x86_64-linux-gnu/libmpv.so.
7777
sudo ln -s /usr/local/lib64/libmpv.so /usr/local/lib/x86_64-linux-gnu/libmpv.so
7878
sudo ldconfig
7979
cd ~/jmp/
80-
git clone https://github.com/jellyfin/jellyfin-media-player.git
80+
git clone --recursive https://github.com/jellyfin/jellyfin-media-player.git
8181
cd jellyfin-media-player/
8282
mkdir build
8383
cd build/
@@ -107,7 +107,7 @@ Please install:
107107
You need to run these commands in git bash.
108108

109109
```bash
110-
git clone https://github.com/jellyfin/jellyfin-media-player
110+
git clone --recursive https://github.com/jellyfin/jellyfin-media-player
111111
cd jellyfin-media-player
112112
mkdir build
113113
cd build
@@ -131,6 +131,9 @@ Then run the following commands (replace <QT_DIR> with your QT installation loca
131131

132132
```bash
133133
brew install mpv ninja
134+
135+
git clone --recursive https://github.com/jellyfin/jellyfin-media-player.git
136+
cd jellyfin-media-player
134137
mkdir build
135138
cd build
136139
cmake -GNinja -DQTROOT=<QT_DIR> -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=output ..

debian/control

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Build-Depends: debhelper (>= 10),
3232
qt6-webengine-dev,
3333
qt6-declarative-dev,
3434
qt6-base-dev,
35+
qt6-wayland-dev,
3536
libcec-dev,
3637
libmpv-dev,
3738
wget,
@@ -47,6 +48,9 @@ Architecture: any
4748
Depends: ${shlibs:Depends},
4849
qml6-module-qtwebengine,
4950
qml6-module-qtwebchannel,
50-
qml6-module-qtquick-controls
51+
qml6-module-qtquick-controls,
52+
qml6-module-qtquick-window,
53+
qml6-module-qtqml-workerscript,
54+
qml6-module-qtquick-templates
5155
Description: Jellyfin is the Free Software Media System.
5256
This package provides the Jellyfin desktop media player.

external/CMakeLists.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,28 @@ if(APPLE)
66
add_subdirectory(HIDRemote)
77
add_subdirectory(letsmove)
88
endif(APPLE)
9+
10+
if(USE_STATIC_MPVQT)
11+
# Build MpvQt directly from sources
12+
add_library(MpvQt STATIC
13+
mpvqt/src/mpvabstractitem.cpp
14+
mpvqt/src/mpvcontroller.cpp
15+
mpvrenderer-wrapper.cpp
16+
)
17+
target_include_directories(MpvQt PUBLIC
18+
${CMAKE_CURRENT_SOURCE_DIR}/mpvqt/src
19+
${CMAKE_CURRENT_SOURCE_DIR}
20+
${CMAKE_CURRENT_BINARY_DIR}/MpvQt
21+
)
22+
target_link_libraries(MpvQt PUBLIC
23+
Qt6::Quick
24+
${MPV_LIBRARY}
25+
)
26+
set_target_properties(MpvQt PROPERTIES
27+
POSITION_INDEPENDENT_CODE ON
28+
AUTOMOC ON
29+
)
30+
# Create Qt-style forwarding headers
31+
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/MpvQt/MpvAbstractItem "#include \"mpvabstractitem.h\"\n")
32+
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/MpvQt/MpvController "#include \"mpvcontroller.h\"\n")
33+
endif()

external/mpvqt

Submodule mpvqt added at 2ebbd38

external/mpvqt_export.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#ifndef MPVQT_EXPORT_H
2+
#define MPVQT_EXPORT_H
3+
4+
// Static library build - no export/import needed
5+
#define MPVQT_EXPORT
6+
#define MPVQT_NO_EXPORT
7+
8+
#endif

0 commit comments

Comments
 (0)