nixpkgs/pkgs/applications/video/jellyfin-media-player/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

107 lines
2.3 KiB
Nix
Raw Normal View History

2021-04-05 08:44:05 +00: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
2021-12-18 16:07:53 +00:00
, jellyfin-web
, withDbus ? stdenv.isLinux, dbus
2021-04-05 08:44:05 +00:00
}:
mkDerivation rec {
pname = "jellyfin-media-player";
2023-04-29 01:00:09 +00:00
version = "1.9.1";
2021-04-05 08:44:05 +00:00
src = fetchFromGitHub {
2021-04-19 06:40:06 +00:00
owner = "jellyfin";
2021-04-05 08:44:05 +00:00
repo = "jellyfin-media-player";
rev = "v${version}";
2023-04-29 01:00:09 +00:00
sha256 = "sha256-97/9UYXOsg8v7QoRqo5rh0UGhjjS85K9OvUwtlG249c=";
2021-04-05 08:44:05 +00:00
};
patches = [
2023-03-13 10:29:09 +00:00
# fix the location of the jellyfin-web path
./fix-web-path.patch
2021-04-20 06:19:18 +00:00
# disable update notifications since the end user can't simply download the release artifacts to update
./disable-update-notifications.patch
2021-04-05 08:44:05 +00: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"
] ++ lib.optionals (!withDbus) [
"-DLINUX_X11POWER=ON"
2021-04-05 08:44:05 +00:00
];
2023-03-13 10:29:09 +00:00
preConfigure = ''
# link the jellyfin-web files to be copied by cmake (see fix-web-path.patch)
ln -s ${jellyfin-web}/share/jellyfin-web .
2021-04-05 08:44:05 +00:00
'';
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
ln -s "$out/Applications/Jellyfin Media Player.app/Contents/MacOS/Jellyfin Media Player" $out/bin/jellyfinmediaplayer
'';
meta = with lib; {
2021-04-19 06:40:06 +00:00
homepage = "https://github.com/jellyfin/jellyfin-media-player";
2021-04-05 08:44:05 +00:00
description = "Jellyfin Desktop Client based on Plex Media Player";
license = with licenses; [ gpl2Only mit ];
2021-04-05 08:44:05 +00:00
platforms = [ "x86_64-linux" "x86_64-darwin" ];
maintainers = with maintainers; [ jojosch kranzes ];
mainProgram = "jellyfinmediaplayer";
2021-04-05 08:44:05 +00:00
};
}