nixpkgs-suyu/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 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-05-22 23:09:59 +02:00
version = "1.8-943";
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;
in
{
x86_64-linux = fetchurl {
url = "http://download.roonlabs.com/builds/RoonBridge_linuxx64_${urlVersion}.tar.bz2";
2022-05-22 23:09:59 +02:00
hash = "sha256-knmy2zlRh+ehvYKHC7UN60pMCt8bYPuo9kTz2m0pOW0";
};
aarch64-linux = fetchurl {
url = "http://download.roonlabs.com/builds/RoonBridge_linuxarmv8_${urlVersion}.tar.bz2";
2022-05-22 23:09:59 +02:00
hash = "sha256-urMhtBUjP4HpV9EDZOLLnfnMqhmsWPx0M2+Xdvc8YnU=";
};
2022-03-29 21:01:32 +02:00
}.${system} or (throw "Unsupposed system: ${system}");
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
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";
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" ];
2021-02-13 07:38:50 +01:00
};
}