2021-04-05 10:44:05 +02:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchzip
|
|
|
|
, mkDerivation
|
|
|
|
, stdenv
|
|
|
|
, Cocoa
|
|
|
|
, CoreAudio
|
|
|
|
, CoreFoundation
|
|
|
|
, MediaPlayer
|
|
|
|
, SDL2
|
|
|
|
, cmake
|
|
|
|
, libGL
|
|
|
|
, libX11
|
|
|
|
, libXrandr
|
|
|
|
, libvdpau
|
|
|
|
, mpv
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, python3
|
|
|
|
, qtbase
|
|
|
|
, qtwayland
|
|
|
|
, qtwebchannel
|
|
|
|
, qtwebengine
|
|
|
|
, qtx11extras
|
|
|
|
}:
|
|
|
|
|
|
|
|
mkDerivation rec {
|
|
|
|
pname = "jellyfin-media-player";
|
2021-04-25 09:00:21 +02:00
|
|
|
version = "1.5.0";
|
2021-04-05 10:44:05 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-04-19 08:40:06 +02:00
|
|
|
owner = "jellyfin";
|
2021-04-05 10:44:05 +02:00
|
|
|
repo = "jellyfin-media-player";
|
|
|
|
rev = "v${version}";
|
2021-04-25 09:00:21 +02:00
|
|
|
sha256 = "sha256-A3vo6678XFUV2RN1lcGYbIjCbBjR1oeORcidKZVnImg=";
|
2021-04-05 10:44:05 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
jmpDist = fetchzip {
|
2021-04-25 09:00:21 +02:00
|
|
|
url = "https://github.com/iwalton3/jellyfin-web-jmp/releases/download/jwc-10.7.2-3/dist.zip";
|
|
|
|
sha256 = "sha256-Rb0q3NFmnYkueq0JkIWkX0C/oL+gFrNOELCNfh9X/P4=";
|
2021-04-05 10:44:05 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# the webclient-files are not copied in the regular build script. Copy them just like the linux build
|
|
|
|
./fix-osx-resources.patch
|
2021-04-20 08:19:18 +02:00
|
|
|
# disable update notifications since the end user can't simply download the release artifacts to update
|
|
|
|
./disable-update-notifications.patch
|
2021-04-05 10:44:05 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
SDL2
|
|
|
|
libGL
|
|
|
|
libX11
|
|
|
|
libXrandr
|
|
|
|
libvdpau
|
|
|
|
mpv
|
|
|
|
qtbase
|
|
|
|
qtwebchannel
|
|
|
|
qtwebengine
|
|
|
|
qtx11extras
|
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
|
|
qtwayland
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
Cocoa
|
|
|
|
CoreAudio
|
|
|
|
CoreFoundation
|
|
|
|
MediaPlayer
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
python3
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DCMAKE_BUILD_TYPE=Release"
|
|
|
|
"-DQTROOT=${qtbase}"
|
|
|
|
"-GNinja"
|
|
|
|
];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
# copy the webclient-files to the expected "dist" directory
|
|
|
|
mkdir -p dist
|
|
|
|
cp -a ${jmpDist}/* dist
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = lib.optionalString stdenv.isDarwin ''
|
|
|
|
mkdir -p $out/bin $out/Applications
|
|
|
|
mv "$out/Jellyfin Media Player.app" $out/Applications
|
|
|
|
|
|
|
|
# move web-client resources
|
|
|
|
mv $out/Resources/* "$out/Applications/Jellyfin Media Player.app/Contents/Resources/"
|
|
|
|
rmdir $out/Resources
|
|
|
|
|
|
|
|
# fix 'Could not find the Qt platform plugin "cocoa" in ""' error
|
|
|
|
wrapQtApp "$out/Applications/Jellyfin Media Player.app/Contents/MacOS/Jellyfin Media Player"
|
|
|
|
|
|
|
|
ln -s "$out/Applications/Jellyfin Media Player.app/Contents/MacOS/Jellyfin Media Player" $out/bin/jellyfinmediaplayer
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2021-04-19 08:40:06 +02:00
|
|
|
homepage = "https://github.com/jellyfin/jellyfin-media-player";
|
2021-04-05 10:44:05 +02:00
|
|
|
description = "Jellyfin Desktop Client based on Plex Media Player";
|
2021-04-21 08:50:05 +02:00
|
|
|
license = with licenses; [ gpl2Only mit ];
|
2021-04-05 10:44:05 +02:00
|
|
|
platforms = [ "x86_64-linux" "x86_64-darwin" ];
|
|
|
|
maintainers = with maintainers; [ jojosch ];
|
|
|
|
};
|
|
|
|
}
|