159e378cbb
GitOrigin-RevId: c04d5652cfa9742b1d519688f65d1bbccea9eb7e
66 lines
1.2 KiB
Nix
66 lines
1.2 KiB
Nix
{
|
|
stdenv,
|
|
lib,
|
|
fetchFromGitHub,
|
|
cmake,
|
|
ninja,
|
|
pkg-config,
|
|
libnice,
|
|
openssl,
|
|
plog,
|
|
srtp,
|
|
usrsctp,
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "libdatachannel";
|
|
version = "0.21.2";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "paullouisageneau";
|
|
repo = "libdatachannel";
|
|
rev = "v${version}";
|
|
hash = "sha256-3fax57oaJvOgbTDPCiiUdtsfAGhICfPkuMihawq06SA=";
|
|
};
|
|
|
|
outputs = [
|
|
"out"
|
|
"dev"
|
|
];
|
|
|
|
strictDeps = true;
|
|
|
|
nativeBuildInputs = [
|
|
cmake
|
|
ninja
|
|
pkg-config
|
|
];
|
|
|
|
buildInputs = [
|
|
libnice
|
|
openssl
|
|
srtp
|
|
usrsctp
|
|
plog
|
|
];
|
|
|
|
cmakeFlags = [
|
|
"-DUSE_NICE=ON"
|
|
"-DPREFER_SYSTEM_LIB=ON"
|
|
"-DNO_EXAMPLES=ON"
|
|
];
|
|
|
|
postFixup = ''
|
|
# Fix include path that will be incorrect due to the "dev" output
|
|
substituteInPlace "$dev/lib/cmake/LibDataChannel/LibDataChannelTargets.cmake" \
|
|
--replace-fail "\''${_IMPORT_PREFIX}/include" "$dev/include"
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "C/C++ WebRTC network library featuring Data Channels, Media Transport, and WebSockets";
|
|
homepage = "https://libdatachannel.org/";
|
|
license = with licenses; [ mpl20 ];
|
|
maintainers = with maintainers; [ erdnaxe ];
|
|
platforms = platforms.linux ++ platforms.darwin;
|
|
};
|
|
}
|