Unverified Commit 0c4c9798 authored by TomaSajt's avatar TomaSajt
Browse files

libdatachannel: format and allow building on darwin

parent e678a655
Loading
Loading
Loading
Loading
+20 −14
Original line number Diff line number Diff line
{ stdenv
, lib
, fetchFromGitHub
, cmake
, ninja
, pkg-config
, libnice
, openssl
, plog
, srtp
, usrsctp
{
  stdenv,
  lib,
  fetchFromGitHub,
  cmake,
  ninja,
  pkg-config,
  libnice,
  openssl,
  plog,
  srtp,
  usrsctp,
}:

stdenv.mkDerivation rec {
@@ -22,14 +23,19 @@ stdenv.mkDerivation rec {
    hash = "sha256-3fax57oaJvOgbTDPCiiUdtsfAGhICfPkuMihawq06SA=";
  };

  outputs = [ "out" "dev" ];
  outputs = [
    "out"
    "dev"
  ];

  strictDeps = true;

  nativeBuildInputs = [
    cmake
    ninja
    pkg-config
  ];

  buildInputs = [
    libnice
    openssl
@@ -47,7 +53,7 @@ stdenv.mkDerivation rec {
  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"
      --replace-fail "\''${_IMPORT_PREFIX}/include" "$dev/include"
  '';

  meta = with lib; {
@@ -55,6 +61,6 @@ stdenv.mkDerivation rec {
    homepage = "https://libdatachannel.org/";
    license = with licenses; [ mpl20 ];
    maintainers = with maintainers; [ erdnaxe ];
    platforms = platforms.linux;
    platforms = platforms.linux ++ platforms.darwin;
  };
}