Merge pull request #131986 from Mindavi/srtp/cross

srtp: support cross, switch to cmake, enable tests
This commit is contained in:
Ben Siraphob 2021-08-01 01:32:53 +07:00 committed by GitHub
commit c28a455dcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,5 @@
{ lib, stdenv, fetchFromGitHub, pkg-config
, openssl ? null, libpcap ? null
, openssl, libpcap, cmake
}:
with lib;
@ -16,21 +16,26 @@ stdenv.mkDerivation rec {
outputs = [ "out" "dev" ];
nativeBuildInputs = [ pkg-config ];
nativeBuildInputs = [ pkg-config cmake ];
# libsrtp.pc references -lcrypto -lpcap without -L
propagatedBuildInputs = [ openssl libpcap ];
configureFlags = [
"--disable-debug"
] ++ optional (openssl != null) "--enable-openssl";
buildFlags = [ "shared_library" ];
cmakeFlags = [
"-DBUILD_SHARED_LIBS=ON"
"-DENABLE_OPENSSL=ON"
"-DBUILD_TESTING=ON"
];
postInstall = ''
rm -rf $out/bin
'';
doCheck = true;
preCheck = ''
export LD_PRELOAD=./libsrtp2.so
'';
meta = {
homepage = "https://github.com/cisco/libsrtp";
description = "Secure RTP (SRTP) Reference Implementation";