cross: jellyfin: build w/o using libsForQt5.callPackage

This commit is contained in:
Colin 2023-06-08 08:26:45 +00:00
parent 9730659f32
commit 9ab85167c3
3 changed files with 86 additions and 21 deletions

View File

@ -0,0 +1,60 @@
diff --git a/pkgs/applications/video/jellyfin-media-player/default.nix b/pkgs/applications/video/jellyfin-media-player/default.nix
index e781f80e455..d1990294141 100644
--- a/pkgs/applications/video/jellyfin-media-player/default.nix
+++ b/pkgs/applications/video/jellyfin-media-player/default.nix
@@ -1,7 +1,6 @@
{ lib
, fetchFromGitHub
, fetchzip
-, mkDerivation
, stdenv
, Cocoa
, CoreAudio
@@ -12,21 +11,20 @@
, libGL
, libX11
, libXrandr
+, libsForQt5
, libvdpau
, mpv
, ninja
, pkg-config
, python3
-, qtbase
-, qtwayland
-, qtwebchannel
-, qtwebengine
-, qtx11extras
, jellyfin-web
, withDbus ? stdenv.isLinux, dbus
}:
-mkDerivation rec {
+let
+ inherit (libsForQt5) qtbase qtwayland qtwebchannel qtwebengine qtx11extras wrapQtAppsHook;
+in
+stdenv.mkDerivation rec {
pname = "jellyfin-media-player";
version = "1.9.1";
@@ -69,6 +67,7 @@ mkDerivation rec {
ninja
pkg-config
python3
+ wrapQtAppsHook
];
cmakeFlags = [
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index eb309c9b283..d8a718db698 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -5289,7 +5289,7 @@ with pkgs;
jellyfin-ffmpeg = callPackage ../development/libraries/jellyfin-ffmpeg { };
- jellyfin-media-player = libsForQt5.callPackage ../applications/video/jellyfin-media-player {
+ jellyfin-media-player = callPackage ../applications/video/jellyfin-media-player {
inherit (darwin.apple_sdk.frameworks) CoreFoundation Cocoa CoreAudio MediaPlayer;
# Disable pipewire to avoid segfault, see https://github.com/jellyfin/jellyfin-media-player/issues/341
mpv = wrapMpv (mpv-unwrapped.override { pipewireSupport = false; }) { };

View File

@ -156,6 +156,9 @@ in [
# qt6 qtwebengine: specify `python` as buildPackages
./2023-06-02-qt6-qtwebengine-cross.patch
# Jellyfin: don't build via `libsForQt5.callPackage`
./2023-06-06-jellyfin-no-libsForQt5-callPackage.patch
# for raspberry pi: allow building u-boot for rpi 4{,00}
# TODO: remove after upstreamed: https://github.com/NixOS/nixpkgs/pull/176018
# (it's a dupe of https://github.com/NixOS/nixpkgs/pull/112677 )

View File

@ -82,11 +82,11 @@ in {
ibus # "error: cannot run test program while cross compiling"
jellyfin-web # in node-dependencies-jellyfin-web: "node: command not found" (nodePackages don't cross compile)
# libgccjit # "../../gcc-9.5.0/gcc/jit/jit-result.c:52:3: error: 'dlclose' was not declared in this scope" (needed by emacs!)
# libsForQt5 # qtbase # make: g++: No such file or directory
libsForQt5 # if we emulate qt5, we're better off emulating libsForQt5 else qt complains about multiple versions of qtbase
perlInterpreters # perl5.36.0-Module-Build perl5.36.0-Test-utf8 (see tracking issues ^)
# qgnomeplatform
# qtbase
qt5 # qt5.qtx11extras fails, but we can't selectively emulate it
qt5 # qt5.qtbase, qt5.qtx11extras fails, but we can't selectively emulate them.
# qt6 # "You need to set QT_HOST_PATH to cross compile Qt."
# sequoia # "/nix/store/q8hg17w47f9xr014g36rdc2gi8fv02qc-clang-aarch64-unknown-linux-gnu-12.0.1-lib/lib/libclang.so.12: cannot open shared object file: No such file or directory"', /build/sequoia-0.27.0-vendor.tar.gz/bindgen/src/lib.rs:1975:31"
# splatmoji
@ -647,13 +647,15 @@ in {
};
};
jellyfin-media-player = prev.jellyfin-media-player.overrideAttrs (upstream: {
meta = upstream.meta // {
platforms = upstream.meta.platforms ++ [
"aarch64-linux"
];
};
});
jellyfin-media-player = mvToBuildInputs
[ final.libsForQt5.wrapQtAppsHook ] # this shouldn't be: but otherwise we get mixed qtbase deps
(prev.jellyfin-media-player.overrideAttrs (upstream: {
meta = upstream.meta // {
platforms = upstream.meta.platforms ++ [
"aarch64-linux"
];
};
}));
# jellyfin-web = prev.jellyfin-web.override {
# # in node-dependencies-jellyfin-web: "node: command not found"
# inherit (emulated) stdenv;
@ -689,18 +691,18 @@ in {
# buildInputs = upstream.buildInputs ++ [ final.vala ];
# });
libsForQt5 = prev.libsForQt5.overrideScope' (self: super: {
qgpgme = super.qgpgme.overrideAttrs (orig: {
# fix so it can find the MOC compiler
# it looks like it might not *need* to propagate qtbase, but so far unclear
nativeBuildInputs = orig.nativeBuildInputs ++ [ self.qtbase ];
propagatedBuildInputs = lib.remove self.qtbase orig.propagatedBuildInputs;
});
phonon = super.phonon.overrideAttrs (orig: {
# fixes "ECM (required version >= 5.60), Extra CMake Modules"
buildInputs = orig.buildInputs ++ [ final.extra-cmake-modules ];
});
});
# libsForQt5 = prev.libsForQt5.overrideScope' (self: super: {
# qgpgme = super.qgpgme.overrideAttrs (orig: {
# # fix so it can find the MOC compiler
# # it looks like it might not *need* to propagate qtbase, but so far unclear
# nativeBuildInputs = orig.nativeBuildInputs ++ [ self.qtbase ];
# propagatedBuildInputs = lib.remove self.qtbase orig.propagatedBuildInputs;
# });
# phonon = super.phonon.overrideAttrs (orig: {
# # fixes "ECM (required version >= 5.60), Extra CMake Modules"
# buildInputs = orig.buildInputs ++ [ final.extra-cmake-modules ];
# });
# });
# fixes: "ar: command not found"
# `ar` is provided by bintools