2022-01-07 04:07:37 +00:00
|
|
|
{ stdenv,
|
|
|
|
lib,
|
|
|
|
fetchFromGitHub,
|
2022-02-10 20:34:41 +00:00
|
|
|
scons,
|
2022-01-07 04:07:37 +00:00
|
|
|
ragel,
|
|
|
|
gengetopt,
|
|
|
|
pkg-config,
|
|
|
|
libuv,
|
|
|
|
openfecSupport ? true,
|
|
|
|
openfec,
|
2023-01-20 10:41:00 +00:00
|
|
|
speexdsp,
|
2022-01-07 04:07:37 +00:00
|
|
|
libunwindSupport ? true,
|
|
|
|
libunwind,
|
|
|
|
pulseaudioSupport ? true,
|
2023-02-02 18:25:31 +00:00
|
|
|
libpulseaudio,
|
|
|
|
soxSupport ? true,
|
|
|
|
sox
|
2022-01-07 04:07:37 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "roc-toolkit";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "0.2.1";
|
2022-01-07 04:07:37 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "roc-streaming";
|
|
|
|
repo = "roc-toolkit";
|
|
|
|
rev = "v${version}";
|
2023-01-20 10:41:00 +00:00
|
|
|
sha256 = "sha256-W8PiI5W1T6pNaYzR4u6fPtkP8DKq/Z85Kq/WF5dXVxo=";
|
2022-01-07 04:07:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2022-02-10 20:34:41 +00:00
|
|
|
scons
|
2022-01-07 04:07:37 +00:00
|
|
|
ragel
|
|
|
|
gengetopt
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
propagatedBuildInputs = [
|
2022-01-07 04:07:37 +00:00
|
|
|
libuv
|
2023-01-20 10:41:00 +00:00
|
|
|
speexdsp
|
2023-02-02 18:25:31 +00:00
|
|
|
] ++ lib.optional openfecSupport openfec
|
|
|
|
++ lib.optional libunwindSupport libunwind
|
|
|
|
++ lib.optional pulseaudioSupport libpulseaudio
|
|
|
|
++ lib.optional soxSupport sox;
|
2022-01-07 04:07:37 +00:00
|
|
|
|
|
|
|
sconsFlags =
|
2022-01-13 20:06:32 +00:00
|
|
|
[ "--build=${stdenv.buildPlatform.config}"
|
|
|
|
"--host=${stdenv.hostPlatform.config}"
|
2023-02-02 18:25:31 +00:00
|
|
|
"--prefix=${placeholder "out"}" ] ++
|
|
|
|
lib.optional (!soxSupport) "--disable-sox" ++
|
2022-01-07 04:07:37 +00:00
|
|
|
lib.optional (!libunwindSupport) "--disable-libunwind" ++
|
|
|
|
lib.optional (!pulseaudioSupport) "--disable-pulseaudio" ++
|
|
|
|
(if (!openfecSupport)
|
|
|
|
then ["--disable-openfec"]
|
|
|
|
else [ "--with-libraries=${openfec}/lib"
|
|
|
|
"--with-openfec-includes=${openfec.dev}/include" ]);
|
|
|
|
|
|
|
|
prePatch = lib.optionalString stdenv.isAarch64
|
|
|
|
"sed -i 's/c++98/c++11/g' SConstruct";
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
patches = [
|
2023-01-20 10:41:00 +00:00
|
|
|
./fix-pkgconfig-installation.patch
|
2022-02-10 20:34:41 +00:00
|
|
|
];
|
|
|
|
|
2022-01-07 04:07:37 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Roc is a toolkit for real-time audio streaming over the network";
|
|
|
|
homepage = "https://github.com/roc-streaming/roc-toolkit";
|
|
|
|
license = licenses.mpl20;
|
|
|
|
maintainers = with maintainers; [ bgamari ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|