summary refs log tree commit diff
path: root/pkgs/tools/video/rtmpdump/default.nix
blob: 55240be19a44bd59783ddf1c09a30eb7ae936323 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{ stdenv, fetchgit, zlib
, gnutlsSupport ? true, gnutls ? null
, opensslSupport ? false, openssl ? null
}:

# Must have an ssl library enabled
assert (gnutlsSupport || opensslSupport);
assert gnutlsSupport -> ((gnutlsSupport != null) && (!opensslSupport));
assert opensslSupport -> ((openssl != null) && (!gnutlsSupport));

with stdenv.lib;
stdenv.mkDerivation rec {
  name = "rtmpdump-${version}";
  version = "2.4";

  src = fetchgit {
    url = git://git.ffmpeg.org/rtmpdump;
    # Currently the latest commit is used (a release has not been made since 2011, i.e. '2.4')
    rev = "a107cef9b392616dff54fabfd37f985ee2190a6f";
    sha256 = "178h5j7w20g2h9mn6cb7dfr3fa4g4850hpl1lzxmi0nk3blzcsvl";
  };

  makeFlags = [ ''prefix=$(out)'' ]
    ++ optional gnutlsSupport "CRYPTO=GNUTLS"
    ++ optional opensslSupport "CRYPTO=OPENSSL"
    ++ optional stdenv.isDarwin "SYS=darwin"
    ++ optional (stdenv.cc.cc.isClang or false) "CC=clang";

  buildInputs = [ zlib ]
    ++ optional gnutlsSupport gnutls
    ++ optional opensslSupport openssl;

  meta = {
    description = "Toolkit for RTMP streams";
    homepage    = http://rtmpdump.mplayerhq.hu/;
    license     = licenses.gpl2;
    platforms   = platforms.unix;
    maintainers = with maintainers; [ codyopel viric ];
  };
}