nixpkgs/pkgs/development/libraries/audio/roc-toolkit/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

72 lines
1.8 KiB
Nix
Raw Normal View History

2022-01-01 16:51:32 +00:00
{ stdenv,
lib,
fetchFromGitHub,
2022-01-24 09:26:55 +00:00
scons,
2022-01-01 16:51:32 +00:00
ragel,
gengetopt,
pkg-config,
libuv,
openfecSupport ? true,
openfec,
libunwindSupport ? true,
libunwind,
pulseaudioSupport ? true,
libpulseaudio
}:
stdenv.mkDerivation rec {
pname = "roc-toolkit";
version = "0.1.5";
src = fetchFromGitHub {
owner = "roc-streaming";
repo = "roc-toolkit";
rev = "v${version}";
sha256 = "sha256:1pld340zfch4p3qaf5anrspq7vmxrgf9ddsdsq92pk49axaaz19w";
};
nativeBuildInputs = [
2022-01-24 09:26:55 +00:00
scons
2022-01-01 16:51:32 +00:00
ragel
gengetopt
pkg-config
];
buildInputs = [
libuv
] ++ lib.optional openfecSupport openfec
++ lib.optional libunwindSupport libunwind
++ lib.optional pulseaudioSupport libpulseaudio;
2022-01-01 16:51:32 +00:00
sconsFlags =
2022-01-07 02:04:04 +00:00
[ "--build=${stdenv.buildPlatform.config}"
"--host=${stdenv.hostPlatform.config}"
"--prefix=${placeholder "out"}"
"--disable-sox"
2022-01-24 09:26:55 +00:00
"--disable-doc"
2022-01-01 16:51:32 +00:00
"--disable-tests" ] ++
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" ]);
2022-01-04 22:36:20 +00:00
prePatch = lib.optionalString stdenv.isAarch64
"sed -i 's/c++98/c++11/g' SConstruct";
2022-01-24 09:26:55 +00:00
# TODO: Remove these patches in the next version.
patches = [
./0001-Remove-deprecated-scons-call.patch
./0002-Fix-compatibility-with-new-SCons.patch
];
2022-01-01 16:51:32 +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;
};
}