about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libdatachannel
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libdatachannel')
-rw-r--r--nixpkgs/pkgs/development/libraries/libdatachannel/default.nix61
1 files changed, 61 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libdatachannel/default.nix b/nixpkgs/pkgs/development/libraries/libdatachannel/default.nix
new file mode 100644
index 000000000000..64351a85a9ae
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdatachannel/default.nix
@@ -0,0 +1,61 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, srcOnly
+, cmake
+, ninja
+, pkg-config
+, libnice
+, openssl
+, plog
+, srtp
+, usrsctp
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libdatachannel";
+  version = "0.19.5";
+
+  src = fetchFromGitHub {
+    owner = "paullouisageneau";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-XTfe0NqDQWx4ISgEiUbzACH9csaG+IrUvwss07dnz80=";
+  };
+
+  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;
+  };
+}