2023-07-11 11:01:25 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
2023-07-15 17:15:38 +00:00
|
|
|
, srcOnly
|
2023-07-11 11:01:25 +00:00
|
|
|
, cmake
|
2023-07-15 17:15:38 +00:00
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, libnice
|
2023-07-11 11:01:25 +00:00
|
|
|
, openssl
|
2023-07-15 17:15:38 +00:00
|
|
|
, plog
|
2023-07-11 11:01:25 +00:00
|
|
|
, srtp
|
|
|
|
, usrsctp
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libdatachannel";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "0.19.4";
|
2023-07-11 11:01:25 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "paullouisageneau";
|
2023-07-15 17:15:38 +00:00
|
|
|
repo = pname;
|
2023-07-11 11:01:25 +00:00
|
|
|
rev = "v${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-XtD46tEV6RU1xbQgGA/nP6zWMgnZkOffVPdl8t/hIiA=";
|
2023-07-11 11:01:25 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
|
|
|
strictDeps = true;
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
];
|
2023-07-11 11:01:25 +00:00
|
|
|
buildInputs = [
|
2023-07-15 17:15:38 +00:00
|
|
|
libnice
|
|
|
|
openssl
|
|
|
|
srtp
|
2023-10-09 19:29:22 +00:00
|
|
|
usrsctp
|
|
|
|
plog
|
2023-07-11 11:01:25 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DUSE_NICE=ON"
|
2023-10-09 19:29:22 +00:00
|
|
|
"-DPREFER_SYSTEM_LIB=ON"
|
2023-07-11 11:01:25 +00:00
|
|
|
"-DNO_EXAMPLES=ON"
|
|
|
|
];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
postFixup = ''
|
2023-11-16 04:20:00 +00:00
|
|
|
# Fix include path that will be incorrect due to the "dev" output
|
|
|
|
substituteInPlace "$dev/lib/cmake/LibDataChannel/LibDataChannelTargets.cmake" \
|
|
|
|
--replace "\''${_IMPORT_PREFIX}/include" "$dev/include"
|
2023-07-15 17:15:38 +00:00
|
|
|
'';
|
|
|
|
|
2023-07-11 11:01:25 +00:00
|
|
|
meta = with lib; {
|
2023-07-15 17:15:38 +00:00
|
|
|
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;
|
2023-07-11 11:01:25 +00:00
|
|
|
};
|
|
|
|
}
|