summary refs log tree commit diff
path: root/pkgs/development/libraries/srtp/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/srtp/default.nix')
-rw-r--r--pkgs/development/libraries/srtp/default.nix71
1 files changed, 28 insertions, 43 deletions
diff --git a/pkgs/development/libraries/srtp/default.nix b/pkgs/development/libraries/srtp/default.nix
index c6cf56e59d6..98cf160e8b5 100644
--- a/pkgs/development/libraries/srtp/default.nix
+++ b/pkgs/development/libraries/srtp/default.nix
@@ -1,51 +1,36 @@
-x@{builderDefsPackage
-  , autoconf, automake, libtool, doxygen, procps
-  , ...}:
-builderDefsPackage
-(a :  
-let 
-  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
-    [];
+{ stdenv, fetchFromGitHub, pkgconfig
+, openssl ? null, libpcap ? null
+}:
 
-  buildInputs = map (n: builtins.getAttr n x)
-    (builtins.attrNames (builtins.removeAttrs x helperArgNames));
-  sourceInfo = rec {
-    baseName="srtp";
-    version="1.4.4";
-    name="${baseName}-${version}";
-    url="mirror://sourceforge/${baseName}/${name}.tgz";
-    hash="057k191hx7sf84wdvc8wr1nk4whhrvbg1vv3r4nyswjir6qwphnr";
-  };
-in
-rec {
-  src = a.fetchurl {
-    url = sourceInfo.url;
-    sha256 = sourceInfo.hash;
+with stdenv.lib;
+stdenv.mkDerivation rec {
+  name = "libsrtp-${version}";
+  version = "1.5.2";
+
+  src = fetchFromGitHub {
+    owner = "cisco";
+    repo = "libsrtp";
+    rev = "v${version}";
+    sha256 = "0iy1il72gnjcwbi16wf4kzdqs1xx8is9qvs6m49pg37218s26gdw";
   };
 
-  inherit (sourceInfo) name version;
-  inherit buildInputs;
+  buildInputs = [ pkgconfig ];
+
+  # libsrtp.pc references -lcrypto -lpcap without -L
+  propagatedBuildInputs = [ openssl libpcap ];
 
-  /* doConfigure should be removed if not needed */
-  phaseNames = ["setVars" "doConfigure" "doMakeInstall"];
+  configureFlags = [
+    "--disable-debug"
+  ] ++ optional (openssl != null) "--enable-openssl";
 
-  setVars = a.fullDepEntry ''
-    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -fPIC"
-  '' ["minInit"];
+  postInstall = ''
+    rmdir $out/bin
+  '';
 
   meta = {
-    description = "Secure RTP";
-    maintainers = with a.lib.maintainers;
-    [
-      raskin
-    ];
-    platforms = with a.lib.platforms;
-      linux;
+    homepage = https://github.com/cisco/libsrtp;
+    description = "Secure RTP (SRTP) Reference Implementation";
+    license = licenses.bsd3;
+    platforms = platforms.all;
   };
-  passthru = {
-    updateInfo = {
-      downloadPage = "http://srtp.sourceforge.net/download.html";
-    };
-  };
-}) x
-
+}