1{ lib, stdenv
2, autoconf
3, automake
4, darwin
5, fetchFromGitHub
6, makeWrapper
7, pkg-config
8, SDL2
9}:
10
11stdenv.mkDerivation rec {
12 pname = "smpeg2";
13 version = "unstable-2022-05-26";
14
15 src = fetchFromGitHub {
16 owner = "icculus";
17 repo = "smpeg";
18 rev = "c5793e5f3f2765fc09c24380d7e92136a0e33d3b";
19 sha256 = "sha256-Z0u83K1GIXd0jUYo5ZyWUH2Zt7Hn8z+yr06DAtAEukw=";
20 };
21
22 nativeBuildInputs = [ autoconf automake makeWrapper pkg-config ];
23
24 buildInputs = [ SDL2 ]
25 ++ lib.optional stdenv.isDarwin darwin.libobjc;
26
27 outputs = [ "out" "dev" "man" ];
28
29 preConfigure = ''
30 sh autogen.sh
31 '';
32
33 postInstall = ''
34 moveToOutput bin/smpeg2-config "$dev"
35 wrapProgram $dev/bin/smpeg2-config \
36 --prefix PATH ":" "${pkg-config}/bin" \
37 --prefix PKG_CONFIG_PATH ":" "${SDL2.dev}/lib/pkgconfig"
38 '';
39
40 enableParallelBuilding = true;
41
42 meta = with lib; {
43 homepage = "http://icculus.org/smpeg/";
44 description = "SDL2 MPEG Player Library";
45 license = licenses.lgpl2;
46 platforms = platforms.unix;
47 maintainers = with maintainers; [ orivej ];
48 };
49}