@@ -1,51 +1,36 @@
1−x@{builderDefsPackage
2− , autoconf, automake, libtool, doxygen, procps
3− , ...}:
4−builderDefsPackage
5−(a :
6−let
7− helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
8− [];
1+{ stdenv, fetchFromGitHub, pkgconfig
2+, openssl ? null, libpcap ? null
3+}:
94
10− buildInputs = map (n: builtins.getAttr n x)
11− (builtins.attrNames (builtins.removeAttrs x helperArgNames));
12− sourceInfo = rec {
13− baseName="srtp";
14− version="1.4.4";
15− name="${baseName}-${version}";
16− url="mirror://sourceforge/${baseName}/${name}.tgz";
17− hash="057k191hx7sf84wdvc8wr1nk4whhrvbg1vv3r4nyswjir6qwphnr";
18− };
19−in
20−rec {
21− src = a.fetchurl {
22− url = sourceInfo.url;
23− sha256 = sourceInfo.hash;
5+with stdenv.lib;
6+stdenv.mkDerivation rec {
7+ name = "libsrtp-${version}";
8+ version = "1.5.2";
9+
10+ src = fetchFromGitHub {
11+ owner = "cisco";
12+ repo = "libsrtp";
13+ rev = "v${version}";
14+ sha256 = "0iy1il72gnjcwbi16wf4kzdqs1xx8is9qvs6m49pg37218s26gdw";
2415 };
2516
26− inherit (sourceInfo) name version;
27− inherit buildInputs;
17+ buildInputs = [ pkgconfig ];
18+
19+ # libsrtp.pc references -lcrypto -lpcap without -L
20+ propagatedBuildInputs = [ openssl libpcap ];
2821
29− /* doConfigure should be removed if not needed */
30− phaseNames = ["setVars" "doConfigure" "doMakeInstall"];
22+ configureFlags = [
23+ "--disable-debug"
24+ ] ++ optional (openssl != null) "--enable-openssl";
3125
32− setVars = a.fullDepEntry ''
33− export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -fPIC"
34− '' ["minInit"];
26+ postInstall = ''
27+ rmdir $out/bin
28+ '';
3529
3630 meta = {
37− description = "Secure RTP";
38− maintainers = with a.lib.maintainers;
39− [
40− raskin
41− ];
42− platforms = with a.lib.platforms;
43− linux;
31+ homepage = https://github.com/cisco/libsrtp;
32+ description = "Secure RTP (SRTP) Reference Implementation";
33+ license = licenses.bsd3;
34+ platforms = platforms.all;
4435 };
45− passthru = {
46− updateInfo = {
47− downloadPage = "http://srtp.sourceforge.net/download.html";
48− };
49− };
50−}) x
51−
36+}