diff --git a/pkgs/servers/jellyfin/default.nix b/pkgs/servers/jellyfin/default.nix index d41c94eee562..649fdb4f9367 100644 --- a/pkgs/servers/jellyfin/default.nix +++ b/pkgs/servers/jellyfin/default.nix @@ -1,6 +1,22 @@ -{ stdenv, fetchurl, unzip, sqlite, makeWrapper, dotnet-sdk, ffmpeg }: +{ stdenv, lib, fetchurl, unzip, sqlite, makeWrapper, dotnet-sdk, ffmpeg, + fontconfig, freetype }: -stdenv.mkDerivation rec { +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 { pname = "jellyfin"; version = "10.3.2"; @@ -28,8 +44,8 @@ stdenv.mkDerivation rec { makeWrapper "${dotnet-sdk}/bin/dotnet" $out/bin/jellyfin \ --prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [ - sqlite - ]}" \ + sqlite fontconfig freetype stdenv.cc.cc.lib + ]}:$out/opt/jellyfin/runtimes/${runtimeDir}/native/" \ --add-flags "$out/opt/jellyfin/jellyfin.dll --ffmpeg ${ffmpeg}/bin/ffmpeg" '';