2020-03-10 00:54:59 +01:00
|
|
|
{ stdenv, lib, fetchurl, unzip, sqlite, makeWrapper, dotnetCorePackages, ffmpeg,
|
2020-04-13 12:47:26 +02:00
|
|
|
fontconfig, freetype, nixosTests }:
|
2019-05-18 12:11:19 +02:00
|
|
|
|
|
|
|
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 22:22:37 +01:00
|
|
|
pname = "jellyfin";
|
2020-09-03 19:51:21 +02:00
|
|
|
version = "10.6.4";
|
2019-03-07 22:22:37 +01:00
|
|
|
|
|
|
|
# Impossible to build anything offline with dotnet
|
|
|
|
src = fetchurl {
|
2020-09-03 19:51:21 +02:00
|
|
|
url = "https://repo.jellyfin.org/releases/server/portable/versions/stable/combined/${version}/jellyfin_${version}.tar.gz";
|
|
|
|
sha256 = "OqN070aUKPk0dXAy8R/lKUnSWen+si/AJ6tkYh5ibqo=";
|
2019-03-07 22:22:37 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
unzip
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2020-03-10 00:54:59 +01:00
|
|
|
dotnetCorePackages.aspnetcore_3_1
|
2019-03-07 22:22:37 +01:00
|
|
|
sqlite
|
|
|
|
];
|
|
|
|
|
|
|
|
preferLocalBuild = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -dm 755 "$out/opt/jellyfin"
|
|
|
|
cp -r * "$out/opt/jellyfin"
|
2020-03-10 00:54:59 +01:00
|
|
|
makeWrapper "${dotnetCorePackages.aspnetcore_3_1}/bin/dotnet" $out/bin/jellyfin \
|
2021-01-15 08:07:56 +01:00
|
|
|
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [
|
2019-05-18 12:11:19 +02:00
|
|
|
sqlite fontconfig freetype stdenv.cc.cc.lib
|
|
|
|
]}:$out/opt/jellyfin/runtimes/${runtimeDir}/native/" \
|
2019-04-21 12:04:47 +02:00
|
|
|
--add-flags "$out/opt/jellyfin/jellyfin.dll --ffmpeg ${ffmpeg}/bin/ffmpeg"
|
2019-03-07 22:22:37 +01:00
|
|
|
'';
|
|
|
|
|
2020-04-13 12:47:26 +02:00
|
|
|
passthru.tests = {
|
|
|
|
smoke-test = nixosTests.jellyfin;
|
|
|
|
};
|
|
|
|
|
2021-01-15 08:07:56 +01:00
|
|
|
meta = with lib; {
|
2019-03-07 22:22:37 +01:00
|
|
|
description = "The Free Software Media System";
|
2020-08-15 06:31:02 +02:00
|
|
|
homepage = "https://jellyfin.org/";
|
2019-03-07 22:22:37 +01:00
|
|
|
license = licenses.gpl2;
|
2020-08-26 05:35:47 +02:00
|
|
|
maintainers = with maintainers; [ nyanloutre minijackson purcell ];
|
2019-03-07 22:22:37 +01:00
|
|
|
};
|
|
|
|
}
|