1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 autoreconfHook,
6 pkg-config,
7 ffmpeg,
8 zlib,
9}:
10
11stdenv.mkDerivation rec {
12 pname = "ffms";
13 version = "5.0";
14
15 src = fetchFromGitHub {
16 owner = "FFMS";
17 repo = "ffms2";
18 rev = version;
19 sha256 = "sha256-Ildl8hbKSFGh4MUBK+k8uYMDrOZD9NSMdPAWIIaGy4E=";
20 };
21
22 env.NIX_CFLAGS_COMPILE = "-fPIC";
23
24 nativeBuildInputs = [
25 autoreconfHook
26 pkg-config
27 ];
28
29 preAutoreconf = ''
30 mkdir src/config
31 '';
32
33 buildInputs = [
34 ffmpeg
35 zlib
36 ];
37
38 # ffms includes a built-in vapoursynth plugin, see:
39 # https://github.com/FFMS/ffms2#avisynth-and-vapoursynth-plugin
40 postInstall = ''
41 mkdir $out/lib/vapoursynth
42 ln -s $out/lib/libffms2${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/vapoursynth/libffms2${stdenv.hostPlatform.extensions.sharedLibrary}
43 '';
44
45 meta = with lib; {
46 homepage = "https://github.com/FFMS/ffms2";
47 description = "FFmpeg based source library for easy frame accurate access";
48 mainProgram = "ffmsindex";
49 license = licenses.mit;
50 maintainers = with maintainers; [ wegank ];
51 platforms = platforms.unix;
52 };
53}