2021-06-10 03:57:09 +01:00
|
|
|
{ alsa-lib
|
2021-06-10 05:10:52 +01:00
|
|
|
, alsa-utils
|
2020-07-23 19:37:52 +01:00
|
|
|
, autoPatchelfHook
|
|
|
|
, cifs-utils
|
|
|
|
, fetchurl
|
|
|
|
, ffmpeg
|
|
|
|
, freetype
|
2021-11-04 16:37:07 +00:00
|
|
|
, icu66
|
|
|
|
, krb5
|
2020-07-23 19:37:52 +01:00
|
|
|
, lib
|
2021-12-26 16:39:41 +00:00
|
|
|
, libtasn1
|
2020-07-23 19:37:52 +01:00
|
|
|
, makeWrapper
|
|
|
|
, stdenv
|
2021-11-04 16:37:07 +00:00
|
|
|
, openssl
|
2021-09-27 22:03:55 +01:00
|
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
2021-06-10 07:04:56 +01:00
|
|
|
pname = "roon-server";
|
2022-02-25 23:35:53 +00:00
|
|
|
version = "1.8-903";
|
2019-06-21 19:58:20 +01:00
|
|
|
|
2021-09-27 22:03:55 +01:00
|
|
|
src =
|
|
|
|
let
|
|
|
|
urlVersion = builtins.replaceStrings [ "." "-" ] [ "00" "00" ] version;
|
|
|
|
in
|
|
|
|
fetchurl {
|
|
|
|
url = "http://download.roonlabs.com/builds/RoonServer_linuxx64_${urlVersion}.tar.bz2";
|
2022-02-25 23:35:53 +00:00
|
|
|
sha256 = "sha256-FkB3sh1uwOctBOAW7eO8HFNr9a9RG3Yq4hKKscYYER4=";
|
2021-09-27 22:03:55 +01:00
|
|
|
};
|
2019-06-21 19:58:20 +01:00
|
|
|
|
2021-12-26 16:46:30 +00:00
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
|
|
|
|
2020-07-23 19:37:52 +01:00
|
|
|
buildInputs = [
|
2021-06-10 03:57:09 +01:00
|
|
|
alsa-lib
|
2020-07-23 19:37:52 +01:00
|
|
|
freetype
|
2021-11-04 16:37:07 +00:00
|
|
|
krb5
|
2021-12-26 16:39:41 +00:00
|
|
|
libtasn1
|
2021-11-04 16:37:07 +00:00
|
|
|
stdenv.cc.cc.lib
|
2020-07-23 19:37:52 +01:00
|
|
|
];
|
2019-06-21 19:58:20 +01:00
|
|
|
|
2020-07-23 19:37:52 +01:00
|
|
|
nativeBuildInputs = [ autoPatchelfHook makeWrapper ];
|
2019-06-21 19:58:20 +01:00
|
|
|
|
2021-11-04 16:37:07 +00:00
|
|
|
installPhase =
|
2020-07-23 19:37:52 +01:00
|
|
|
let
|
2021-11-04 16:37:07 +00:00
|
|
|
# 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" \
|
2021-11-16 06:29:58 +00:00
|
|
|
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ alsa-lib icu66 ffmpeg openssl ]}" \
|
2021-11-04 16:37:07 +00:00
|
|
|
--prefix PATH : "$dotnetDir" \
|
2021-11-10 06:31:08 +00:00
|
|
|
--prefix PATH : "${lib.makeBinPath [ alsa-utils cifs-utils ffmpeg ]}" \
|
2021-11-04 16:37:07 +00:00
|
|
|
--run "cd $binDir" \
|
|
|
|
--set DOTNET_ROOT "$dotnetDir"
|
|
|
|
)
|
2020-07-23 19:37:52 +01:00
|
|
|
'';
|
|
|
|
in
|
|
|
|
''
|
2021-11-04 16:37:07 +00:00
|
|
|
runHook preInstall
|
|
|
|
mkdir -p $out
|
|
|
|
mv * $out
|
|
|
|
|
|
|
|
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
|
2019-06-21 19:58:20 +01:00
|
|
|
|
2021-11-04 16:37:07 +00:00
|
|
|
runHook postInstall
|
2020-07-23 19:37:52 +01:00
|
|
|
'';
|
2019-06-21 19:58:20 +01:00
|
|
|
|
2020-07-23 19:37:52 +01:00
|
|
|
meta = with lib; {
|
2020-10-11 06:55:05 +01:00
|
|
|
description = "The music player for music lovers";
|
2021-06-10 07:04:56 +01:00
|
|
|
changelog = "https://community.roonlabs.com/c/roon/software-release-notes/18";
|
2020-07-23 19:37:52 +01:00
|
|
|
homepage = "https://roonlabs.com";
|
|
|
|
license = licenses.unfree;
|
|
|
|
maintainers = with maintainers; [ lovesegfault steell ];
|
2021-09-28 18:59:03 +01:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2019-06-21 19:58:20 +01:00
|
|
|
};
|
|
|
|
}
|