nixpkgs-suyu/pkgs/servers/roon-bridge/default.nix

85 lines
2.2 KiB
Nix
Raw Normal View History

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
}:
stdenv.mkDerivation rec {
pname = "roon-bridge";
2022-02-01 02:43:47 +01:00
version = "1.8-880";
2021-02-13 07:38:50 +01:00
src =
let
urlVersion = builtins.replaceStrings [ "." "-" ] [ "00" "00" ] version;
2022-02-01 02:43:47 +01:00
inherit (stdenv.targetPlatform) system;
noSuchSystem = throw "Unsupposed system: ${system}";
in
{
x86_64-linux = fetchurl {
url = "http://download.roonlabs.com/builds/RoonBridge_linuxx64_${urlVersion}.tar.bz2";
2022-02-01 02:43:47 +01:00
sha256 = "sha256-YTLy3D1CQR1hlsGw2MmZtxHT82T0PCYZxD4adt2m1+o=";
};
aarch64-linux = fetchurl {
url = "http://download.roonlabs.com/builds/RoonBridge_linuxarmv8_${urlVersion}.tar.bz2";
2022-02-01 02:43:47 +01:00
sha256 = "sha256-aCQtYMUIzwhmYJW4a8cFzIRuxyMVIkeaJH4w1Lasp3M=";
};
2022-02-01 02:43:47 +01:00
}.${system} or noSuchSystem;
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
makeWrapper "$out/Bridge/RoonBridge" "$out/bin/RoonBridge" --run "cd $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";
license = licenses.unfree;
maintainers = with maintainers; [ lovesegfault ];
2021-09-28 19:58:55 +02:00
platforms = [ "aarch64-linux" "x86_64-linux" ];
2021-02-13 07:38:50 +01:00
};
}