2021-02-13 07:45:02 +01:00
|
|
|
{ alsa-lib
|
|
|
|
, alsa-utils
|
2021-02-13 07:38:50 +01:00
|
|
|
, autoPatchelfHook
|
|
|
|
, fetchurl
|
2022-02-01 02:43:47 +01:00
|
|
|
, ffmpeg
|
2021-02-13 07:38:50 +01:00
|
|
|
, lib
|
|
|
|
, makeWrapper
|
2022-02-01 02:43:47 +01:00
|
|
|
, openssl
|
2021-02-13 07:38:50 +01:00
|
|
|
, stdenv
|
|
|
|
, zlib
|
|
|
|
}:
|
2022-10-28 16:20:14 +02:00
|
|
|
let
|
|
|
|
version = "1.8-1125";
|
|
|
|
urlVersion = builtins.replaceStrings [ "." "-" ] [ "00" "0" ] version;
|
|
|
|
host = stdenv.hostPlatform.system;
|
|
|
|
system = if host == "x86_64-linux" then "linuxx64"
|
|
|
|
else if host == "aarch64-linux" then "linuxarmv8"
|
|
|
|
else throw "Unsupported platform ${host}";
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://download.roonlabs.com/updates/stable/RoonBridge_${system}_${urlVersion}.tar.bz2";
|
|
|
|
hash = if system == "linuxx64" then "sha256-DbtKPFEz2WIoKTxP+zoehzz+BjfsLZ2ZQk/FMh+zFBM="
|
|
|
|
else if system == "linuxarmv8" then "sha256-+przEj96R+f1z4ewETFarF4oY6tT2VW/ukSTgUBLiYk="
|
|
|
|
else throw "Unsupported platform ${host}";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
2021-02-13 07:38:50 +01:00
|
|
|
pname = "roon-bridge";
|
2022-10-28 16:20:14 +02:00
|
|
|
inherit src version;
|
2022-02-01 02:43:47 +01:00
|
|
|
|
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
2021-02-13 07:38:50 +01:00
|
|
|
|
|
|
|
buildInputs = [
|
2021-02-13 07:45:02 +01:00
|
|
|
alsa-lib
|
2021-02-13 07:38:50 +01:00
|
|
|
zlib
|
2022-02-01 02:43:47 +01:00
|
|
|
stdenv.cc.cc.lib
|
2021-02-13 07:38:50 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoPatchelfHook makeWrapper ];
|
|
|
|
|
2022-02-01 02:43:47 +01:00
|
|
|
installPhase =
|
2021-02-13 07:38:50 +01:00
|
|
|
let
|
2022-02-01 02:43:47 +01:00
|
|
|
fixBin = binPath: ''
|
|
|
|
(
|
|
|
|
sed -i '/ulimit/d' ${binPath}
|
|
|
|
sed -i 's@^SCRIPT=.*@SCRIPT="$(basename "${binPath}")"@' ${binPath}
|
|
|
|
wrapProgram ${binPath} \
|
|
|
|
--argv0 "$(basename ${binPath})" \
|
|
|
|
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ alsa-lib ffmpeg openssl ]}" \
|
|
|
|
--prefix PATH : "${lib.makeBinPath [ alsa-utils ffmpeg ]}"
|
|
|
|
)
|
2021-02-13 07:38:50 +01:00
|
|
|
'';
|
|
|
|
in
|
|
|
|
''
|
2022-02-01 02:43:47 +01:00
|
|
|
runHook preInstall
|
|
|
|
mkdir -p $out
|
|
|
|
mv * $out
|
|
|
|
|
|
|
|
rm $out/check.sh
|
|
|
|
rm $out/start.sh
|
|
|
|
rm $out/VERSION
|
|
|
|
|
|
|
|
${fixBin "${placeholder "out"}/Bridge/RAATServer"}
|
|
|
|
${fixBin "${placeholder "out"}/Bridge/RoonBridge"}
|
|
|
|
${fixBin "${placeholder "out"}/Bridge/RoonBridgeHelper"}
|
|
|
|
|
|
|
|
mkdir -p $out/bin
|
2022-03-14 19:06:00 +01:00
|
|
|
makeWrapper "$out/Bridge/RoonBridge" "$out/bin/RoonBridge" --chdir "$out"
|
2021-02-13 07:38:50 +01:00
|
|
|
|
2022-02-01 02:43:47 +01:00
|
|
|
runHook postInstall
|
2021-02-13 07:38:50 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "The music player for music lovers";
|
2022-02-01 02:43:47 +01:00
|
|
|
changelog = "https://community.roonlabs.com/c/roon/software-release-notes/18";
|
2021-02-13 07:38:50 +01:00
|
|
|
homepage = "https://roonlabs.com";
|
2022-06-11 13:39:29 +02:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2021-02-13 07:38:50 +01:00
|
|
|
license = licenses.unfree;
|
|
|
|
maintainers = with maintainers; [ lovesegfault ];
|
2021-09-28 19:58:55 +02:00
|
|
|
platforms = [ "aarch64-linux" "x86_64-linux" ];
|
2023-11-23 22:09:35 +01:00
|
|
|
mainProgram = "RoonBridge";
|
2021-02-13 07:38:50 +01:00
|
|
|
};
|
|
|
|
}
|