Skip to content

Commit 2aa3929

Browse files
committed
roon-server: rewrite and fix
1 parent bb259af commit 2aa3929

1 file changed

Lines changed: 52 additions & 49 deletions

File tree

Lines changed: 52 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,68 @@
1-
{ alsaLib, alsaUtils, cifs-utils, fetchurl, ffmpeg_3, libav, mono, stdenv }:
2-
3-
with stdenv.lib;
4-
stdenv.mkDerivation rec {
1+
{ alsaLib
2+
, alsaUtils
3+
, autoPatchelfHook
4+
, cifs-utils
5+
, fetchurl
6+
, ffmpeg
7+
, freetype
8+
, lib
9+
, makeWrapper
10+
, stdenv
11+
, zlib
12+
}: stdenv.mkDerivation rec {
513
name = "roon-server";
6-
version = "100600401";
14+
version = "100700571";
715

816
src = fetchurl {
917
url = "http://download.roonlabs.com/updates/stable/RoonServer_linuxx64_${version}.tar.bz2";
10-
sha256 = "121mmdh35q4bpgsqhcps6a6q1f4ld9v4hq9gp181bf2n779pk8sh";
18+
sha256 = "191vlzf10ypkk1prp6x2rszlmsihdwpd3wvgf2jg6ckwyxy2hc6k";
1119
};
1220

13-
installPhase = ''
14-
runHook preInstall
15-
16-
# Check script
17-
sed -i '3i PATH=$PATH:${makeBinPath [ cifs-utils ffmpeg_3 libav ]}' check.sh
18-
sed -i '/check_ulimit$/d' check.sh
19-
20-
# Start script
21-
sed -i '3i PATH=$PATH:${makeBinPath [ alsaUtils cifs-utils ffmpeg_3 libav ]}' start.sh
21+
buildInputs = [
22+
alsaLib
23+
alsaUtils
24+
cifs-utils
25+
ffmpeg
26+
freetype
27+
zlib
28+
];
2229

23-
# Debug logging
24-
sed -i '/--debug--gc=sgen --server/exec "$HARDLINK" --debug --gc=sgen --server "$SCRIPT.exe" "$@" -storagetrace -watchertrace' Appliance/RoonAppliance
25-
26-
# Binaries
27-
sed -i '/# boost ulimit/,+2 d' Appliance/RAATServer
28-
sed -i '/# boost ulimit/,+2 d' Appliance/RoonAppliance
29-
sed -i '/# boost ulimit/,+2 d' Server/RoonServer
30-
sed -i '/ln -sf/ d' Appliance/RAATServer
31-
sed -i '/ln -sf/ d' Appliance/RoonAppliance
32-
sed -i '/ln -sf/ d' Server/RoonServer
33-
mkdir -p $out/opt
34-
mv * $out/opt
35-
ln -sf $out/opt/RoonMono/bin/mono-sgen $out/opt/RoonMono/bin/RoonServer
36-
ln -sf $out/opt/RoonMono/bin/mono-sgen $out/opt/RoonMono/bin/RoonAppliance
37-
ln -sf $out/opt/RoonMono/bin/mono-sgen $out/opt/RoonMono/bin/RAATServer
30+
nativeBuildInputs = [ autoPatchelfHook makeWrapper ];
3831

32+
installPhase = ''
33+
runHook preInstall
34+
mkdir -p $out
35+
mv * $out
3936
runHook postInstall
4037
'';
4138

42-
preFixup = ''
43-
patchelf \
44-
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
45-
--set-rpath "${alsaLib}/lib" \
46-
$out/opt/RoonMono/bin/mono-sgen
39+
postFixup =
40+
let
41+
linkFix = bin: ''
42+
sed -i '/ulimit/d' ${bin}
43+
sed -i '/ln -sf/d' ${bin}
44+
ln -sf $out/RoonMono/bin/mono-sgen $out/RoonMono/bin/${builtins.baseNameOf bin}
45+
'';
46+
wrapFix = bin: ''
47+
wrapProgram ${bin} --prefix PATH : ${lib.makeBinPath [ alsaUtils cifs-utils ffmpeg ]}
48+
'';
49+
in
50+
''
51+
${linkFix "$out/Appliance/RAATServer"}
52+
${linkFix "$out/Appliance/RoonAppliance"}
53+
${linkFix "$out/Server/RoonServer"}
4754
48-
# Checkers
49-
patchelf \
50-
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
51-
--set-rpath "${alsaLib}/lib" \
52-
$out/opt/Appliance/check_alsa
53-
patchelf \
54-
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
55-
$out/opt/Appliance/check_bincompat
56-
'';
55+
sed -i '/which avconv/c\ WHICH_AVCONV=1' $out/check.sh
56+
sed -i '/^check_ulimit/d' $out/check.sh
57+
${wrapFix "$out/check.sh"}
58+
${wrapFix "$out/start.sh"}
59+
'';
5760

58-
meta = {
61+
meta = with lib; {
5962
description = "The music player for music lovers.";
60-
homepage = "https://roonlabs.com";
61-
license = licenses.unfree;
62-
maintainers = with maintainers; [ steell ];
63-
platforms = platforms.linux;
63+
homepage = "https://roonlabs.com";
64+
license = licenses.unfree;
65+
maintainers = with maintainers; [ lovesegfault steell ];
66+
platforms = platforms.linux;
6467
};
6568
}

0 commit comments

Comments
 (0)