Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ stdenv,
2 lib,
3 fetchFromGitHub,
4 scons,
5 ragel,
6 gengetopt,
7 pkg-config,
8 libuv,
9 openfecSupport ? true,
10 openfec,
11 speexdsp,
12 libunwindSupport ? true,
13 libunwind,
14 pulseaudioSupport ? true,
15 libpulseaudio,
16 opensslSupport ? true,
17 openssl,
18 soxSupport ? true,
19 sox
20}:
21
22stdenv.mkDerivation rec {
23 pname = "roc-toolkit";
24 version = "0.2.4";
25
26 outputs = [ "out" "dev" ];
27
28 src = fetchFromGitHub {
29 owner = "roc-streaming";
30 repo = "roc-toolkit";
31 rev = "v${version}";
32 hash = "sha256-x4+/MIFKcos9xWhvSNWdsUQA2oLiyYS0MJE60HY/3hQ=";
33 };
34
35 nativeBuildInputs = [
36 scons
37 ragel
38 gengetopt
39 pkg-config
40 ];
41
42 propagatedBuildInputs = [
43 libuv
44 speexdsp
45 ] ++ lib.optional openfecSupport openfec
46 ++ lib.optional libunwindSupport libunwind
47 ++ lib.optional pulseaudioSupport libpulseaudio
48 ++ lib.optional opensslSupport openssl
49 ++ lib.optional soxSupport sox;
50
51 sconsFlags =
52 [ "--build=${stdenv.buildPlatform.config}"
53 "--host=${stdenv.hostPlatform.config}"
54 "--prefix=${placeholder "out"}" ] ++
55 lib.optional (!opensslSupport) "--disable-openssl" ++
56 lib.optional (!soxSupport) "--disable-sox" ++
57 lib.optional (!libunwindSupport) "--disable-libunwind" ++
58 lib.optional (!pulseaudioSupport) "--disable-pulseaudio" ++
59 (if (!openfecSupport)
60 then ["--disable-openfec"]
61 else [ "--with-libraries=${openfec}/lib"
62 "--with-openfec-includes=${openfec.dev}/include" ]);
63
64 meta = with lib; {
65 description = "Roc is a toolkit for real-time audio streaming over the network";
66 homepage = "https://github.com/roc-streaming/roc-toolkit";
67 license = licenses.mpl20;
68 maintainers = with maintainers; [ bgamari ];
69 platforms = platforms.unix;
70 };
71}