2022-10-07 22:35:34 +00:00
|
|
|
{ lib
|
|
|
|
, pkgs
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
|
|
|
|
# Packaging tools
|
|
|
|
, dpkg
|
|
|
|
, wrapQtAppsHook
|
|
|
|
|
|
|
|
# Dependencies
|
|
|
|
, qtbase
|
|
|
|
, qt5
|
|
|
|
, xorg
|
|
|
|
, mesa
|
|
|
|
, SDL2
|
|
|
|
, zlib-ng
|
|
|
|
, fribidi
|
|
|
|
, gnutls
|
|
|
|
, libcec
|
|
|
|
, mpv
|
|
|
|
}:
|
2022-09-14 03:53:30 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
version = "1.7.1";
|
2022-10-07 22:35:34 +00:00
|
|
|
hotfix = "-1";
|
|
|
|
pname = "jellyfin-media-player";
|
2022-09-14 03:53:30 +00:00
|
|
|
|
2022-10-07 22:35:34 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/jellyfin/jellyfin-media-player/releases/download/v${version}/jellyfin-media-player_${version}${hotfix}_amd64-jammy.deb";
|
|
|
|
sha256 = "sha256-9z3L0c+2LDPMx82biJq/Mhsb8rt6Lr+4F/jWzT5v0R4=";
|
|
|
|
};
|
2022-09-14 03:53:30 +00:00
|
|
|
|
2022-10-07 22:35:34 +00:00
|
|
|
sourceRoot = ".";
|
|
|
|
unpackCmd = "dpkg-deb -x $src .";
|
2022-09-14 03:53:30 +00:00
|
|
|
|
2022-10-07 22:35:34 +00:00
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
2022-09-14 03:53:30 +00:00
|
|
|
|
2022-10-07 22:35:34 +00:00
|
|
|
nativeBuildInputs = [ wrapQtAppsHook dpkg ];
|
2022-09-14 03:53:30 +00:00
|
|
|
|
2022-10-07 22:35:34 +00:00
|
|
|
buildInputs = [ qtbase qt5.qtwebengine ];
|
2022-09-14 03:53:30 +00:00
|
|
|
|
2022-10-07 22:35:34 +00:00
|
|
|
installPhase = ''
|
|
|
|
# Copy everything in usr to $out
|
|
|
|
cp -r usr/ $out/
|
2022-09-14 03:53:30 +00:00
|
|
|
|
2022-10-07 22:35:34 +00:00
|
|
|
# Link the web-client next to the bin file.
|
|
|
|
# Without this, the qt5-webengine(?) wont load since it can't find .html files
|
|
|
|
ln -s $out/share/jellyfinmediaplayer/web-client $out/bin/web-client
|
2022-09-14 03:53:30 +00:00
|
|
|
'';
|
|
|
|
|
2022-10-07 22:35:34 +00:00
|
|
|
preFixup = let
|
|
|
|
libPath = lib.makeLibraryPath [
|
|
|
|
qtbase
|
|
|
|
qt5.qtwebengine qt5.qtquickcontrols qt5.qtx11extras qt5.qtwebchannel qt5.qtdeclarative
|
|
|
|
xorg.libX11 # libX11.so.6
|
|
|
|
xorg.libXrandr # libXrandr.so.2
|
|
|
|
SDL2 # libSDL2-2.0.so.0
|
|
|
|
libcec # libcec.so.6
|
|
|
|
mpv # libmpv.so.1
|
2022-09-14 03:53:30 +00:00
|
|
|
|
2022-10-07 22:35:34 +00:00
|
|
|
stdenv.cc.cc.lib # libstdc++.so.6
|
|
|
|
];
|
|
|
|
in ''
|
|
|
|
patchelf \
|
|
|
|
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
|
|
|
--set-rpath "${libPath}" \
|
|
|
|
$out/bin/jellyfinmediaplayer
|
2022-09-14 03:53:30 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2022-10-07 22:35:34 +00:00
|
|
|
description = "Jellyfin Desktop Client based on Plex Media Player.";
|
2022-09-14 03:53:30 +00:00
|
|
|
homepage = "https://github.com/jellyfin/jellyfin-media-player";
|
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2022-10-07 22:35:34 +00:00
|
|
|
license = licenses.gpl2;
|
2022-09-14 03:53:30 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
maintainers = with maintainers; [ seanomik ];
|
|
|
|
};
|
|
|
|
}
|