2019-05-18 11:11:19 +01:00
|
|
|
{ stdenv, lib, fetchurl, unzip, sqlite, makeWrapper, dotnet-sdk, ffmpeg,
|
|
|
|
fontconfig, freetype }:
|
|
|
|
|
|
|
|
let
|
|
|
|
os = if stdenv.isDarwin then "osx" else "linux";
|
|
|
|
arch =
|
|
|
|
with stdenv.hostPlatform;
|
|
|
|
if isx86_32 then "x86"
|
|
|
|
else if isx86_64 then "x64"
|
|
|
|
else if isAarch32 then "arm"
|
|
|
|
else if isAarch64 then "arm64"
|
|
|
|
else lib.warn "Unsupported architecture, some image processing features might be unavailable" "unknown";
|
|
|
|
musl = lib.optionalString stdenv.hostPlatform.isMusl
|
|
|
|
(if (arch != "x64")
|
|
|
|
then lib.warn "Some image processing features might be unavailable for non x86-64 with Musl" "musl-"
|
|
|
|
else "musl-");
|
|
|
|
runtimeDir = "${os}-${musl}${arch}";
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
2019-03-07 21:22:37 +00:00
|
|
|
pname = "jellyfin";
|
2019-07-31 11:31:37 +01:00
|
|
|
version = "10.3.7";
|
2019-03-07 21:22:37 +00:00
|
|
|
|
|
|
|
# Impossible to build anything offline with dotnet
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/jellyfin/jellyfin/releases/download/v${version}/jellyfin_${version}_portable.tar.gz";
|
2019-07-31 11:31:37 +01:00
|
|
|
sha256 = "1lpd0dvf7x0wgl8bllqzk54nnbn9fj73jcsz292g7nip1ippgibl";
|
2019-03-07 21:22:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
unzip
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
dotnet-sdk
|
|
|
|
sqlite
|
|
|
|
];
|
|
|
|
|
|
|
|
preferLocalBuild = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -dm 755 "$out/opt/jellyfin"
|
|
|
|
cp -r * "$out/opt/jellyfin"
|
|
|
|
|
|
|
|
makeWrapper "${dotnet-sdk}/bin/dotnet" $out/bin/jellyfin \
|
|
|
|
--prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [
|
2019-05-18 11:11:19 +01:00
|
|
|
sqlite fontconfig freetype stdenv.cc.cc.lib
|
|
|
|
]}:$out/opt/jellyfin/runtimes/${runtimeDir}/native/" \
|
2019-04-21 11:04:47 +01:00
|
|
|
--add-flags "$out/opt/jellyfin/jellyfin.dll --ffmpeg ${ffmpeg}/bin/ffmpeg"
|
2019-03-07 21:22:37 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "The Free Software Media System";
|
|
|
|
homepage = https://jellyfin.github.io/;
|
|
|
|
license = licenses.gpl2;
|
2019-04-14 12:16:02 +01:00
|
|
|
maintainers = with maintainers; [ nyanloutre minijackson ];
|
2019-03-07 21:22:37 +00:00
|
|
|
};
|
|
|
|
}
|