jellyfin: add bundled libraries to LD_LIBRARY_PATH

This commit is contained in:
Minijackson 2019-05-18 12:11:19 +02:00
parent c0a0dc19ce
commit 5251cbb051
No known key found for this signature in database
GPG Key ID: FEA888C9F5D64F62

View File

@ -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"
'';