mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
cubeb: add myself to maintainers and make more cusomizable, signal-desktop.ringrtc: use cubeb from nixpkgs (#408510)
This commit is contained in:
commit
10b6dbe0f1
3 changed files with 67 additions and 17 deletions
|
@ -10,6 +10,11 @@
|
||||||
sndio,
|
sndio,
|
||||||
speexdsp,
|
speexdsp,
|
||||||
lazyLoad ? !stdenv.hostPlatform.isDarwin,
|
lazyLoad ? !stdenv.hostPlatform.isDarwin,
|
||||||
|
alsaSupport ? !stdenv.hostPlatform.isDarwin,
|
||||||
|
pulseSupport ? !stdenv.hostPlatform.isDarwin,
|
||||||
|
jackSupport ? !stdenv.hostPlatform.isDarwin,
|
||||||
|
sndioSupport ? !stdenv.hostPlatform.isDarwin,
|
||||||
|
buildSharedLibs ? true,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert lib.assertMsg (
|
assert lib.assertMsg (
|
||||||
|
@ -17,12 +22,11 @@ assert lib.assertMsg (
|
||||||
) "cubeb: lazyLoad is inert on Darwin";
|
) "cubeb: lazyLoad is inert on Darwin";
|
||||||
|
|
||||||
let
|
let
|
||||||
backendLibs = [
|
backendLibs =
|
||||||
alsa-lib
|
lib.optional alsaSupport alsa-lib
|
||||||
jack2
|
++ lib.optional jackSupport jack2
|
||||||
libpulseaudio
|
++ lib.optional pulseSupport libpulseaudio
|
||||||
sndio
|
++ lib.optional sndioSupport sndio;
|
||||||
];
|
|
||||||
|
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
|
@ -44,7 +48,7 @@ stdenv.mkDerivation {
|
||||||
buildInputs = [ speexdsp ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) backendLibs;
|
buildInputs = [ speexdsp ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) backendLibs;
|
||||||
|
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
"-DBUILD_SHARED_LIBS=ON"
|
(lib.cmakeBool "BUILD_SHARED_LIBS" buildSharedLibs)
|
||||||
"-DBUILD_TESTS=OFF" # tests require an audio server
|
"-DBUILD_TESTS=OFF" # tests require an audio server
|
||||||
"-DBUNDLE_SPEEX=OFF"
|
"-DBUNDLE_SPEEX=OFF"
|
||||||
"-DUSE_SANITIZERS=OFF"
|
"-DUSE_SANITIZERS=OFF"
|
||||||
|
@ -58,12 +62,27 @@ stdenv.mkDerivation {
|
||||||
backendLibs = lib.optionals lazyLoad backendLibs;
|
backendLibs = lib.optionals lazyLoad backendLibs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
# TODO: remove after https://github.com/mozilla/cubeb/pull/813 is merged
|
||||||
|
mkdir -p $out/lib/pkgconfig/
|
||||||
|
echo > $out/lib/pkgconfig/libcubeb.pc \
|
||||||
|
"Name: libcubeb
|
||||||
|
Description: Cross platform audio library
|
||||||
|
Version: 0.0.0
|
||||||
|
Requires.private: libpulse
|
||||||
|
Libs: -L"$out/lib" -lcubeb
|
||||||
|
Libs.private: -lstdc++"
|
||||||
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Cross platform audio library";
|
description = "Cross platform audio library";
|
||||||
mainProgram = "cubeb-test";
|
mainProgram = "cubeb-test";
|
||||||
homepage = "https://github.com/mozilla/cubeb";
|
homepage = "https://github.com/mozilla/cubeb";
|
||||||
license = licenses.isc;
|
license = licenses.isc;
|
||||||
platforms = platforms.linux ++ platforms.darwin;
|
platforms = platforms.linux ++ platforms.darwin;
|
||||||
maintainers = with maintainers; [ zhaofengli ];
|
maintainers = with maintainers; [
|
||||||
|
zhaofengli
|
||||||
|
marcin-serwin
|
||||||
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,8 +5,19 @@
|
||||||
cmake,
|
cmake,
|
||||||
protobuf,
|
protobuf,
|
||||||
webrtc,
|
webrtc,
|
||||||
|
pkg-config,
|
||||||
|
cubeb,
|
||||||
|
libpulseaudio,
|
||||||
}:
|
}:
|
||||||
|
let
|
||||||
|
cubeb' = cubeb.override {
|
||||||
|
alsaSupport = false;
|
||||||
|
pulseSupport = true;
|
||||||
|
jackSupport = false;
|
||||||
|
sndioSupport = false;
|
||||||
|
buildSharedLibs = false;
|
||||||
|
};
|
||||||
|
in
|
||||||
rustPlatform.buildRustPackage (finalAttrs: {
|
rustPlatform.buildRustPackage (finalAttrs: {
|
||||||
pname = "ringrtc";
|
pname = "ringrtc";
|
||||||
version = "2.51.0";
|
version = "2.51.0";
|
||||||
|
@ -28,12 +39,20 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
||||||
];
|
];
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
||||||
|
env = {
|
||||||
|
LIBCUBEB_SYS_USE_PKG_CONFIG = 1;
|
||||||
|
LIBCUBEB_STATIC = 1;
|
||||||
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
protobuf
|
protobuf
|
||||||
cmake
|
cmake
|
||||||
|
pkg-config
|
||||||
];
|
];
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
webrtc
|
webrtc
|
||||||
|
cubeb'
|
||||||
|
libpulseaudio
|
||||||
];
|
];
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
|
|
|
@ -19,14 +19,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
gclientDeps = gclient2nix.importGclientDeps ./webrtc-sources.json;
|
gclientDeps = gclient2nix.importGclientDeps ./webrtc-sources.json;
|
||||||
sourceRoot = "src";
|
sourceRoot = "src";
|
||||||
|
|
||||||
preConfigure = ''
|
|
||||||
echo "$SOURCE_DATE_EPOCH" > build/util/LASTCHANGE.committime
|
|
||||||
echo "generate_location_tags = true" >> build/config/gclient_args.gni
|
|
||||||
substituteInPlace build/toolchain/linux/BUILD.gn \
|
|
||||||
--replace-fail 'toolprefix = "aarch64-linux-gnu-"' 'toolprefix = ""'
|
|
||||||
patchShebangs build/mac/should_use_hermetic_xcode.py
|
|
||||||
'';
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
gn
|
gn
|
||||||
ninja
|
ninja
|
||||||
|
@ -44,6 +36,22 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
pulseaudio
|
pulseaudio
|
||||||
];
|
];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace build/toolchain/linux/BUILD.gn \
|
||||||
|
--replace-fail 'toolprefix = "aarch64-linux-gnu-"' 'toolprefix = ""'
|
||||||
|
patchShebangs build/mac/should_use_hermetic_xcode.py
|
||||||
|
|
||||||
|
substituteInPlace modules/audio_device/linux/pulseaudiosymboltable_linux.cc \
|
||||||
|
--replace-fail "libpulse.so.0" "${pulseaudio}/lib/libpulse.so.0"
|
||||||
|
substituteInPlace modules/audio_device/linux/alsasymboltable_linux.cc \
|
||||||
|
--replace-fail "libasound.so.2" "${alsa-lib}/lib/libasound.so.2"
|
||||||
|
'';
|
||||||
|
|
||||||
|
preConfigure = ''
|
||||||
|
echo "$SOURCE_DATE_EPOCH" > build/util/LASTCHANGE.committime
|
||||||
|
echo "generate_location_tags = true" >> build/config/gclient_args.gni
|
||||||
|
'';
|
||||||
|
|
||||||
gnFlags = [
|
gnFlags = [
|
||||||
''target_os="linux"''
|
''target_os="linux"''
|
||||||
"use_sysroot=false"
|
"use_sysroot=false"
|
||||||
|
@ -66,7 +74,11 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
ninjaFlags = [ "webrtc" ];
|
ninjaFlags = [ "webrtc" ];
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
install -D obj/libwebrtc${stdenv.hostPlatform.extensions.staticLibrary} $out/lib/libwebrtc${stdenv.hostPlatform.extensions.staticLibrary}
|
install -D obj/libwebrtc${stdenv.hostPlatform.extensions.staticLibrary} $out/lib/libwebrtc${stdenv.hostPlatform.extensions.staticLibrary}
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue