1{
2 lib,
3 stdenv,
4 fetchgit,
5 zlib,
6 gnutlsSupport ? false,
7 gnutls,
8 nettle,
9 opensslSupport ? true,
10 openssl,
11}:
12
13assert (gnutlsSupport || opensslSupport);
14
15stdenv.mkDerivation {
16 pname = "rtmpdump";
17 version = "2.6";
18
19 src = fetchgit {
20 url = "git://git.ffmpeg.org/rtmpdump";
21 # Releases are not tagged.
22 rev = "6f6bb1353fc84f4cc37138baa99f586750028a01";
23 hash = "sha256-rwMA9eougKnkpG+fe6vZIwOBt2CC1d9qI9a079EbE5o=";
24 };
25
26 preBuild = ''
27 makeFlagsArray+=(CC="$CC")
28 '';
29
30 makeFlags = [
31 "prefix=$(out)"
32 "CROSS_COMPILE=${stdenv.cc.targetPrefix}"
33 ]
34 ++ lib.optional gnutlsSupport "CRYPTO=GNUTLS"
35 ++ lib.optional opensslSupport "CRYPTO=OPENSSL"
36 ++ lib.optional stdenv.hostPlatform.isDarwin "SYS=darwin";
37
38 propagatedBuildInputs = [
39 zlib
40 ]
41 ++ lib.optionals gnutlsSupport [
42 gnutls
43 nettle
44 ]
45 ++ lib.optional opensslSupport openssl;
46
47 outputs = [
48 "out"
49 "dev"
50 ];
51
52 separateDebugInfo = true;
53
54 meta = with lib; {
55 description = "Toolkit for RTMP streams";
56 homepage = "https://rtmpdump.mplayerhq.hu/";
57 license = licenses.gpl2Plus;
58 platforms = platforms.unix;
59 maintainers = with maintainers; [ codyopel ];
60 };
61}