blob: fcf713d9fe88d99126722f7b65eb1cd32a3dfe8c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
{ stdenv
, autoPatchelfHook
, dpkg
, fetchurl
, lib
, alsa-lib
}:
let
inherit (stdenv.targetPlatform) system;
throwSystem = throw "Unsupported system: ${system}";
in
stdenv.mkDerivation rec {
pname = "networkaudiod";
version = "4.1.1-46";
src = {
x86_64-linux = fetchurl {
url = "https://www.signalyst.eu/bins/naa/linux/buster/${pname}_${version}_amd64.deb";
sha256 = "sha256-un5VcCnvCCS/KWtW991Rt9vz3flYilERmRNooEsKCkA=";
};
aarch64-linux = fetchurl {
url = "https://www.signalyst.eu/bins/naa/linux/buster/${pname}_${version}_arm64.deb";
sha256 = "sha256-fjSCWX9VYhVJ43N2kSqd5gfTtDJ1UiH4j5PJ9I5Skag=";
};
}.${system} or throwSystem;
unpackPhase = ''
dpkg -x $src .
'';
nativeBuildInputs = [ autoPatchelfHook dpkg ];
buildInputs = [
alsa-lib
stdenv.cc.cc.lib
];
dontConfigure = true;
dontBuild = true;
installPhase = ''
runHook preInstall
# main executable
mkdir -p $out/bin
cp ./usr/sbin/networkaudiod $out/bin
# systemd service file
mkdir -p $out/lib/systemd/system
cp ./lib/systemd/system/networkaudiod.service $out/lib/systemd/system
# documentation
mkdir -p $out/share/doc/networkaudiod
cp -r ./usr/share/doc/networkaudiod $out/share/doc/
runHook postInstall
'';
postInstall = ''
substituteInPlace $out/lib/systemd/system/networkaudiod.service \
--replace /usr/sbin/networkaudiod $out/bin/networkaudiod
'';
meta = with lib; {
homepage = "https://www.signalyst.com/index.html";
description = "Network Audio Adapter daemon";
license = licenses.unfree;
maintainers = with maintainers; [ lovesegfault ];
platforms = platforms.linux;
};
}
|