diff options
author | Jörg Thalheim <Mic92@users.noreply.github.com> | 2022-01-04 07:40:45 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-04 07:40:45 +0000 |
commit | ff764c3b0f53a20b617c13d5c2f9f6429d4c4502 (patch) | |
tree | 00bd6bc154f5232de347c402876fd71e22501c09 /pkgs/development/libraries | |
parent | a96c4d1474e011e746c203cf5697ee86a8f0d6d0 (diff) | |
parent | 105af2d840820e2d8b0999efde2308f433932a27 (diff) |
Merge pull request #153087 from bgamari/wip/roc-toolkit
pipewire: introduce roc-toolkit support
Diffstat (limited to 'pkgs/development/libraries')
-rw-r--r-- | pkgs/development/libraries/audio/roc-toolkit/default.nix | 63 | ||||
-rw-r--r-- | pkgs/development/libraries/openfec/default.nix | 40 | ||||
-rw-r--r-- | pkgs/development/libraries/pipewire/default.nix | 7 |
3 files changed, 108 insertions, 2 deletions
diff --git a/pkgs/development/libraries/audio/roc-toolkit/default.nix b/pkgs/development/libraries/audio/roc-toolkit/default.nix new file mode 100644 index 0000000000000..b8790298e71ee --- /dev/null +++ b/pkgs/development/libraries/audio/roc-toolkit/default.nix @@ -0,0 +1,63 @@ +{ stdenv, + lib, + fetchFromGitHub, + sconsPackages, + 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 = [ + sconsPackages.scons_3_0_1 + ragel + gengetopt + pkg-config + ]; + + buildInputs = [ + libuv + libunwind + openfec + libpulseaudio + ]; + + sconsFlags = + [ "--disable-sox" + "--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" ]); + + preConfigure = '' + sconsFlags+=" --prefix=$out" + ''; + + 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; + }; +} diff --git a/pkgs/development/libraries/openfec/default.nix b/pkgs/development/libraries/openfec/default.nix new file mode 100644 index 0000000000000..2a0588a71ebd6 --- /dev/null +++ b/pkgs/development/libraries/openfec/default.nix @@ -0,0 +1,40 @@ +{ stdenv, lib, fetchzip, cmake }: + +stdenv.mkDerivation rec { + pname = "openfec"; + version = "1.4.2"; + + src = fetchzip { + url = "http://openfec.org/files/openfec_v1_4_2.tgz"; + sha256 = "sha256:0c2lg8afr7lqpzrsi0g44a6h6s7nq4vz7yc9vm2k57ph2y6r86la"; + }; + + outputs = [ "out" "dev" ]; + + nativeBuildInputs = [ + cmake + ]; + + cmakeFlags = [ "-DDEBUG:STRING=OFF" ]; + + installPhase = + let so = stdenv.hostPlatform.extensions.sharedLibrary; + in '' + # This is pretty horrible but sadly there is not installation procedure + # provided. + mkdir -p $dev/include + cp -R ../src/* $dev/include + find $dev/include -type f -a ! -iname '*.h' -delete + + install -D -m755 -t $out/lib ../bin/Release/libopenfec${so} + ln -s libopenfec${so} $out/lib/libopenfec${so}.1 + ''; + + meta = with lib; { + description = "Application-level Forward Erasure Correction codes"; + homepage = "https://github.com/roc-streaming/openfec"; + license = licenses.cecill-c; + maintainers = with maintainers; [ bgamari ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/development/libraries/pipewire/default.nix b/pkgs/development/libraries/pipewire/default.nix index af5f238c9df73..c00e297b68af9 100644 --- a/pkgs/development/libraries/pipewire/default.nix +++ b/pkgs/development/libraries/pipewire/default.nix @@ -54,6 +54,8 @@ , libpulseaudio , zeroconfSupport ? true , avahi +, rocSupport ? true +, roc-toolkit }: let @@ -134,7 +136,8 @@ let ++ lib.optional ffmpegSupport ffmpeg ++ lib.optionals bluezSupport [ bluez libfreeaptx ldacbt sbc fdk_aac ] ++ lib.optional pulseTunnelSupport libpulseaudio - ++ lib.optional zeroconfSupport avahi; + ++ lib.optional zeroconfSupport avahi + ++ lib.optional rocSupport roc-toolkit; # Valgrind binary is required for running one optional test. checkInputs = lib.optional withValgrind valgrind; @@ -147,7 +150,7 @@ let "-Dpipewire_pulse_prefix=${placeholder "pulse"}" "-Dlibjack-path=${placeholder "jack"}/lib" "-Dlibcamera=${mesonEnable libcameraSupport}" - "-Droc=disabled" + "-Droc=${mesonEnable rocSupport}" "-Dlibpulse=${mesonEnable pulseTunnelSupport}" "-Davahi=${mesonEnable zeroconfSupport}" "-Dgstreamer=${mesonEnable gstreamerSupport}" |