From a13bfe7fbc27bacd054ad08d6f840cf1e0acc3c8 Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Thu, 4 Nov 2021 09:37:07 -0700 Subject: [PATCH] roon-server: 1.8-831 -> 1.8-846 --- nixos/modules/services/audio/roon-server.nix | 2 +- pkgs/servers/roon-server/default.nix | 78 +++++++++++++------- 2 files changed, 51 insertions(+), 29 deletions(-) diff --git a/nixos/modules/services/audio/roon-server.nix b/nixos/modules/services/audio/roon-server.nix index 42da5a100170..566c7cae42ce 100644 --- a/nixos/modules/services/audio/roon-server.nix +++ b/nixos/modules/services/audio/roon-server.nix @@ -42,7 +42,7 @@ in { environment.ROON_DATAROOT = "/var/lib/${name}"; serviceConfig = { - ExecStart = "${pkgs.roon-server}/start.sh"; + ExecStart = "${pkgs.roon-server}/bin/RoonServer"; LimitNOFILE = 8192; User = cfg.user; Group = cfg.group; diff --git a/pkgs/servers/roon-server/default.nix b/pkgs/servers/roon-server/default.nix index d97a5df42e19..16a47795d3e7 100644 --- a/pkgs/servers/roon-server/default.nix +++ b/pkgs/servers/roon-server/default.nix @@ -5,14 +5,16 @@ , fetchurl , ffmpeg , freetype +, icu66 +, krb5 , lib , makeWrapper , stdenv -, zlib +, openssl }: stdenv.mkDerivation rec { pname = "roon-server"; - version = "1.8-831"; + version = "1.8-846"; src = let @@ -20,47 +22,67 @@ stdenv.mkDerivation rec { in fetchurl { url = "http://download.roonlabs.com/builds/RoonServer_linuxx64_${urlVersion}.tar.bz2"; - sha256 = "sha256-SeMSC7K6DV7rVr1w/SqMnLvipoWbypS/gJnSZmpfXZk="; + sha256 = "sha256-BoHvODaAcK5b4/syOm3vpOTpq9ETovpWKUqG+UGr2e0="; }; buildInputs = [ alsa-lib - alsa-utils - cifs-utils - ffmpeg freetype - zlib + krb5 + stdenv.cc.cc.lib ]; nativeBuildInputs = [ autoPatchelfHook makeWrapper ]; - installPhase = '' - runHook preInstall - mkdir -p $out - mv * $out - runHook postInstall - ''; + propagatedBuildInputs = [ alsa-utils cifs-utils ffmpeg ]; - postFixup = + installPhase = let - linkFix = bin: '' - sed -i '/ulimit/d' ${bin} - sed -i '/ln -sf/d' ${bin} - ln -sf $out/RoonMono/bin/mono-sgen $out/RoonMono/bin/${builtins.baseNameOf bin} - ''; - wrapFix = bin: '' - wrapProgram ${bin} --prefix PATH : ${lib.makeBinPath [ alsa-utils cifs-utils ffmpeg ]} + # NB: While this might seem like odd behavior, it's what Roon expects. The + # tarball distribution provides scripts that do a bunch of nonsense on top + # of what wrapBin is doing here, so consider it the lesser of two evils. + # I didn't bother checking whether the symlinks are really necessary, but + # I wouldn't put it past Roon to have custom code based on the binary + # name, so we're playing it safe. + wrapBin = binPath: '' + ( + binDir="$(dirname "${binPath}")" + binName="$(basename "${binPath}")" + dotnetDir="$out/RoonDotnet" + + ln -sf "$dotnetDir/dotnet" "$dotnetDir/$binName" + rm "${binPath}" + makeWrapper "$dotnetDir/$binName" "${binPath}" \ + --add-flags "$binDir/$binName.dll" \ + --argv0 "$binName" \ + --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ icu66 openssl ]}" \ + --prefix PATH : "$dotnetDir" \ + --run "cd $binDir" \ + --set DOTNET_ROOT "$dotnetDir" + ) ''; in '' - ${linkFix "$out/Appliance/RAATServer"} - ${linkFix "$out/Appliance/RoonAppliance"} - ${linkFix "$out/Server/RoonServer"} + runHook preInstall + mkdir -p $out + mv * $out - sed -i '/which avconv/c\ WHICH_AVCONV=1' $out/check.sh - sed -i '/^check_ulimit/d' $out/check.sh - ${wrapFix "$out/check.sh"} - ${wrapFix "$out/start.sh"} + rm $out/check.sh + rm $out/start.sh + rm $out/VERSION + + ${wrapBin "$out/Appliance/RAATServer"} + ${wrapBin "$out/Appliance/RoonAppliance"} + ${wrapBin "$out/Server/RoonServer"} + + mkdir -p $out/bin + makeWrapper "$out/Server/RoonServer" "$out/bin/RoonServer" --run "cd $out" + + # This is unused and depends on an ancient version of lttng-ust, so we + # just patch it out + patchelf --remove-needed liblttng-ust.so.0 $out/RoonDotnet/shared/Microsoft.NETCore.App/5.0.0/libcoreclrtraceptprovider.so + + runHook postInstall ''; meta = with lib; {