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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

85 lines
2.3 KiB
Nix
Raw Normal View History

2021-02-13 06:45:02 +00:00
{ alsa-lib
, alsa-utils
2021-02-13 06:38:50 +00:00
, autoPatchelfHook
, fetchurl
2022-02-01 01:43:47 +00:00
, ffmpeg
2021-02-13 06:38:50 +00:00
, lib
, makeWrapper
2022-02-01 01:43:47 +00:00
, openssl
2021-02-13 06:38:50 +00:00
, stdenv
, zlib
}:
stdenv.mkDerivation rec {
pname = "roon-bridge";
2022-05-22 21:09:59 +00:00
version = "1.8-943";
2021-02-13 06:38:50 +00:00
src =
let
urlVersion = builtins.replaceStrings [ "." "-" ] [ "00" "00" ] version;
2022-02-01 01:43:47 +00:00
inherit (stdenv.targetPlatform) system;
in
{
x86_64-linux = fetchurl {
url = "http://download.roonlabs.com/builds/RoonBridge_linuxx64_${urlVersion}.tar.bz2";
2022-05-22 21:09:59 +00:00
hash = "sha256-knmy2zlRh+ehvYKHC7UN60pMCt8bYPuo9kTz2m0pOW0";
};
aarch64-linux = fetchurl {
url = "http://download.roonlabs.com/builds/RoonBridge_linuxarmv8_${urlVersion}.tar.bz2";
2022-05-22 21:09:59 +00:00
hash = "sha256-urMhtBUjP4HpV9EDZOLLnfnMqhmsWPx0M2+Xdvc8YnU=";
};
2022-03-29 19:01:32 +00:00
}.${system} or (throw "Unsupposed system: ${system}");
2022-02-01 01:43:47 +00:00
dontConfigure = true;
dontBuild = true;
2021-02-13 06:38:50 +00:00
buildInputs = [
2021-02-13 06:45:02 +00:00
alsa-lib
2021-02-13 06:38:50 +00:00
zlib
2022-02-01 01:43:47 +00:00
stdenv.cc.cc.lib
2021-02-13 06:38:50 +00:00
];
nativeBuildInputs = [ autoPatchelfHook makeWrapper ];
2022-02-01 01:43:47 +00:00
installPhase =
2021-02-13 06:38:50 +00:00
let
2022-02-01 01:43:47 +00: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 06:38:50 +00:00
'';
in
''
2022-02-01 01:43:47 +00: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" --chdir "$out"
2021-02-13 06:38:50 +00:00
2022-02-01 01:43:47 +00:00
runHook postInstall
2021-02-13 06:38:50 +00:00
'';
meta = with lib; {
description = "The music player for music lovers";
2022-02-01 01:43:47 +00:00
changelog = "https://community.roonlabs.com/c/roon/software-release-notes/18";
2021-02-13 06:38:50 +00:00
homepage = "https://roonlabs.com";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
2021-02-13 06:38:50 +00:00
license = licenses.unfree;
maintainers = with maintainers; [ lovesegfault ];
2021-09-28 17:58:55 +00:00
platforms = [ "aarch64-linux" "x86_64-linux" ];
2021-02-13 06:38:50 +00:00
};
}