2011-07-25 14:46:04 +00:00
|
|
|
{ stdenv, fetchurl, pkgconfig, yasm, zlib, bzip2
|
2011-04-23 20:58:52 +00:00
|
|
|
, mp3Support ? true, lame ? null
|
|
|
|
, speexSupport ? true, speex ? null
|
|
|
|
, theoraSupport ? true, libtheora ? null
|
2011-07-25 14:35:54 +00:00
|
|
|
, vorbisSupport ? false, libvorbis ? null
|
2011-04-23 20:58:52 +00:00
|
|
|
, vpxSupport ? false, libvpx ? null
|
|
|
|
, x264Support ? true, x264 ? null
|
2011-07-25 14:35:54 +00:00
|
|
|
, xvidSupport ? false, xvidcore ? null
|
2011-05-12 20:43:33 +00:00
|
|
|
, faacSupport ? false, faac ? null
|
|
|
|
}:
|
2006-06-29 12:41:25 +00:00
|
|
|
|
2011-04-23 20:58:52 +00: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;
|
2011-07-27 21:00:09 +00:00
|
|
|
assert faacSupport -> faac != null;
|
2011-04-23 20:58:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2011-07-25 14:35:54 +00:00
|
|
|
name = "ffmpeg-0.8";
|
2009-03-10 21:03:51 +00:00
|
|
|
|
2006-06-29 12:41:25 +00:00
|
|
|
src = fetchurl {
|
2011-05-12 20:43:33 +00:00
|
|
|
url = "http://www.ffmpeg.org/releases/${name}.tar.bz2";
|
2011-07-25 14:35:54 +00:00
|
|
|
sha256 = "03zwwc1qs117pfjk9r071fbx4al3j0c85j97dgwqc0wp2z1zs9iy";
|
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 08:36:09 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--enable-gpl"
|
|
|
|
"--enable-postproc"
|
|
|
|
"--enable-swscale"
|
|
|
|
"--disable-ffserver"
|
|
|
|
"--disable-ffplay"
|
|
|
|
"--enable-shared"
|
|
|
|
"--enable-runtime-cpudetect"
|
2011-04-23 20:58:52 +00: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 20:43:33 +00:00
|
|
|
++ stdenv.lib.optional xvidSupport "--enable-libxvid"
|
|
|
|
++ stdenv.lib.optional faacSupport "--enable-libfaac --enable-nonfree";
|
2011-04-23 20:58:52 +00:00
|
|
|
|
2011-07-25 14:46:04 +00:00
|
|
|
buildInputs = [ pkgconfig lame yasm zlib bzip2 ]
|
2011-04-23 20:58:52 +00: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 20:43:33 +00:00
|
|
|
++ stdenv.lib.optional xvidSupport xvidcore
|
|
|
|
++ stdenv.lib.optional faacSupport faac;
|
2009-03-10 21:03:51 +00:00
|
|
|
|
2011-07-25 14:35:54 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2011-04-23 20:58:52 +00: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
|
|
|
|
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 12:41:25 +00:00
|
|
|
};
|
|
|
|
}
|