summary refs log tree commit diff
path: root/pkgs/development/libraries/smpeg2/default.nix
blob: d57cc91f26e28049f327b333cd40b5044d83fd26 (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
41
42
43
44
45
46
47
48
49
{ lib, stdenv
, autoconf
, automake
, darwin
, fetchsvn
, makeWrapper
, pkg-config
, SDL2
}:

stdenv.mkDerivation rec {
  pname = "smpeg2";
  version = "unstable-2017-10-18";

  src = fetchsvn {
    url = "svn://svn.icculus.org/smpeg/trunk";
    rev = "413";
    sha256 = "193amdwgxkb1zp7pgr72fvrdhcg3ly72qpixfxxm85rzz8g2kr77";
  };

  patches = [
    ./hufftable-uint_max.patch
  ];

  nativeBuildInputs = [ autoconf automake makeWrapper pkg-config ];

  buildInputs = [ SDL2 ]
    ++ lib.optional stdenv.isDarwin darwin.libobjc;

  preConfigure = ''
    sh autogen.sh
  '';

  postInstall = ''
    wrapProgram $out/bin/smpeg2-config \
      --prefix PATH ":" "${pkg-config}/bin" \
      --prefix PKG_CONFIG_PATH ":" "${SDL2.dev}/lib/pkgconfig"
  '';

  enableParallelBuilding = true;

  meta = with lib; {
    homepage = "http://icculus.org/smpeg/";
    description = "SDL2 MPEG Player Library";
    license = licenses.lgpl2;
    platforms = platforms.unix;
    maintainers = with maintainers; [ orivej ];
  };
}