depot/third_party/nixpkgs/pkgs/development/libraries/libdatachannel/default.nix
Default email 504525a148 Project import generated by Copybara.
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
2024-01-02 12:29:13 +01:00

61 lines
1.2 KiB
Nix

{ stdenv
, lib
, fetchFromGitHub
, srcOnly
, cmake
, ninja
, pkg-config
, libnice
, openssl
, plog
, srtp
, usrsctp
}:
stdenv.mkDerivation rec {
pname = "libdatachannel";
version = "0.19.4";
src = fetchFromGitHub {
owner = "paullouisageneau";
repo = pname;
rev = "v${version}";
hash = "sha256-XtD46tEV6RU1xbQgGA/nP6zWMgnZkOffVPdl8t/hIiA=";
};
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 "\''${_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;
};
}