2012-07-24 16:43:29 +01:00
|
|
|
{ stdenv, fetchurl, pkgconfig, yasm, zlib, bzip2
|
2011-04-23 21:58:52 +01:00
|
|
|
, mp3Support ? true, lame ? null
|
|
|
|
, speexSupport ? true, speex ? null
|
|
|
|
, theoraSupport ? true, libtheora ? null
|
2012-02-08 19:54:16 +00:00
|
|
|
, vorbisSupport ? true, libvorbis ? null
|
2011-04-23 21:58:52 +01:00
|
|
|
, vpxSupport ? false, libvpx ? null
|
|
|
|
, x264Support ? true, x264 ? null
|
2012-02-08 19:54:16 +00:00
|
|
|
, xvidSupport ? true, xvidcore ? null
|
2012-07-02 15:17:16 +01:00
|
|
|
, vdpauSupport ? true, libvdpau ? null
|
2011-05-12 21:43:33 +01:00
|
|
|
, faacSupport ? false, faac ? null
|
2012-07-06 11:01:58 +01:00
|
|
|
, dc1394Support ? false, libdc1394 ? null
|
2011-05-12 21:43:33 +01:00
|
|
|
}:
|
2006-06-29 13:41:25 +01:00
|
|
|
|
2011-04-23 21:58:52 +01:00
|
|
|
assert speexSupport -> speex != null;
|
|
|
|
assert theoraSupport -> libtheora != null;
|
|
|
|
assert vorbisSupport -> libvorbis != null;
|
|
|
|
assert vpxSupport -> libvpx != null;
|
|
|
|
assert x264Support -> x264 != null;
|
|
|
|
assert xvidSupport -> xvidcore != null;
|
2012-07-02 15:17:16 +01:00
|
|
|
assert vdpauSupport -> libvdpau != null;
|
2011-07-27 22:00:09 +01:00
|
|
|
assert faacSupport -> faac != null;
|
2011-04-23 21:58:52 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2012-07-24 16:43:31 +01:00
|
|
|
name = "ffmpeg-0.10";
|
2009-03-10 21:03:51 +00:00
|
|
|
|
2006-06-29 13:41:25 +01:00
|
|
|
src = fetchurl {
|
2011-05-12 21:43:33 +01:00
|
|
|
url = "http://www.ffmpeg.org/releases/${name}.tar.bz2";
|
2012-07-24 16:43:31 +01:00
|
|
|
sha256 = "1ybzw6d5axr807141izvm2yf4pa0hc1zcywj89nsn3qsdnknlna3";
|
2009-03-10 21:03:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# `--enable-gpl' (as well as the `postproc' and `swscale') mean that
|
|
|
|
# the resulting library is GPL'ed, so it can only be used in GPL'ed
|
|
|
|
# applications.
|
2010-09-01 09:36:09 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--enable-gpl"
|
|
|
|
"--enable-postproc"
|
|
|
|
"--enable-swscale"
|
|
|
|
"--disable-ffplay"
|
|
|
|
"--enable-shared"
|
|
|
|
"--enable-runtime-cpudetect"
|
2011-04-23 21:58:52 +01:00
|
|
|
]
|
|
|
|
++ stdenv.lib.optional mp3Support "--enable-libmp3lame"
|
|
|
|
++ stdenv.lib.optional speexSupport "--enable-libspeex"
|
|
|
|
++ stdenv.lib.optional theoraSupport "--enable-libtheora"
|
|
|
|
++ stdenv.lib.optional vorbisSupport "--enable-libvorbis"
|
|
|
|
++ stdenv.lib.optional vpxSupport "--enable-libvpx"
|
|
|
|
++ stdenv.lib.optional x264Support "--enable-libx264"
|
2011-05-12 21:43:33 +01:00
|
|
|
++ stdenv.lib.optional xvidSupport "--enable-libxvid"
|
2012-07-02 15:17:16 +01:00
|
|
|
++ stdenv.lib.optional vdpauSupport "--enable-vdpau"
|
2012-07-06 11:01:58 +01:00
|
|
|
++ stdenv.lib.optional faacSupport "--enable-libfaac --enable-nonfree"
|
2012-07-24 16:43:30 +01:00
|
|
|
++ stdenv.lib.optional dc1394Support "--enable-libdc1394";
|
2011-04-23 21:58:52 +01:00
|
|
|
|
2012-07-24 16:43:29 +01:00
|
|
|
buildInputs = [ pkgconfig lame yasm zlib bzip2 ]
|
2011-04-23 21:58:52 +01:00
|
|
|
++ stdenv.lib.optional mp3Support lame
|
|
|
|
++ stdenv.lib.optional speexSupport speex
|
|
|
|
++ stdenv.lib.optional theoraSupport libtheora
|
|
|
|
++ stdenv.lib.optional vorbisSupport libvorbis
|
|
|
|
++ stdenv.lib.optional vpxSupport libvpx
|
|
|
|
++ stdenv.lib.optional x264Support x264
|
2011-05-12 21:43:33 +01:00
|
|
|
++ stdenv.lib.optional xvidSupport xvidcore
|
2012-07-02 15:17:16 +01:00
|
|
|
++ stdenv.lib.optional vdpauSupport libvdpau
|
2012-07-06 11:01:58 +01:00
|
|
|
++ stdenv.lib.optional faacSupport faac
|
2012-07-24 16:43:30 +01:00
|
|
|
++ stdenv.lib.optional dc1394Support libdc1394;
|
2009-03-10 21:03:51 +00:00
|
|
|
|
2011-07-25 15:35:54 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2011-04-23 21:58:52 +01:00
|
|
|
crossAttrs = {
|
|
|
|
dontSetConfigureCross = true;
|
|
|
|
configureFlags = configureFlags ++ [
|
|
|
|
"--cross-prefix=${stdenv.cross.config}-"
|
|
|
|
"--enable-cross-compile"
|
|
|
|
"--target_os=linux"
|
|
|
|
"--arch=${stdenv.cross.arch}"
|
|
|
|
];
|
|
|
|
};
|
2009-03-10 22:45:27 +00:00
|
|
|
|
2013-01-05 21:05:34 +00:00
|
|
|
passthru = {
|
|
|
|
inherit vdpauSupport;
|
|
|
|
};
|
|
|
|
|
2009-03-10 21:03:51 +00:00
|
|
|
meta = {
|
|
|
|
homepage = http://www.ffmpeg.org/;
|
|
|
|
description = "A complete, cross-platform solution to record, convert and stream audio and video";
|
2006-06-29 13:41:25 +01:00
|
|
|
};
|
|
|
|
}
|