2011-07-25 16:46:04 +02:00
|
|
|
{ stdenv, fetchurl, pkgconfig, yasm, zlib, bzip2
|
2011-04-23 22:58:52 +02:00
|
|
|
, mp3Support ? true, lame ? null
|
|
|
|
, speexSupport ? true, speex ? null
|
|
|
|
, theoraSupport ? true, libtheora ? null
|
2011-07-25 16:35:54 +02:00
|
|
|
, vorbisSupport ? false, libvorbis ? null
|
2011-04-23 22:58:52 +02:00
|
|
|
, vpxSupport ? false, libvpx ? null
|
|
|
|
, x264Support ? true, x264 ? null
|
2011-07-25 16:35:54 +02:00
|
|
|
, xvidSupport ? false, xvidcore ? null
|
2011-05-12 22:43:33 +02:00
|
|
|
, faacSupport ? false, faac ? null
|
|
|
|
}:
|
2006-06-29 14:41:25 +02:00
|
|
|
|
2011-04-23 22:58:52 +02: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 23:00:09 +02:00
|
|
|
assert faacSupport -> faac != null;
|
2011-04-23 22:58:52 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2011-07-25 16:35:54 +02:00
|
|
|
name = "ffmpeg-0.8";
|
2009-03-10 22:03:51 +01:00
|
|
|
|
2006-06-29 14:41:25 +02:00
|
|
|
src = fetchurl {
|
2011-05-12 22:43:33 +02:00
|
|
|
url = "http://www.ffmpeg.org/releases/${name}.tar.bz2";
|
2011-07-25 16:35:54 +02:00
|
|
|
sha256 = "03zwwc1qs117pfjk9r071fbx4al3j0c85j97dgwqc0wp2z1zs9iy";
|
2009-03-10 22:03:51 +01: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 10:36:09 +02:00
|
|
|
configureFlags = [
|
|
|
|
"--enable-gpl"
|
|
|
|
"--enable-postproc"
|
|
|
|
"--enable-swscale"
|
|
|
|
"--disable-ffserver"
|
|
|
|
"--disable-ffplay"
|
|
|
|
"--enable-shared"
|
|
|
|
"--enable-runtime-cpudetect"
|
2011-04-23 22:58:52 +02: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 22:43:33 +02:00
|
|
|
++ stdenv.lib.optional xvidSupport "--enable-libxvid"
|
|
|
|
++ stdenv.lib.optional faacSupport "--enable-libfaac --enable-nonfree";
|
2011-04-23 22:58:52 +02:00
|
|
|
|
2011-07-25 16:46:04 +02:00
|
|
|
buildInputs = [ pkgconfig lame yasm zlib bzip2 ]
|
2011-04-23 22:58:52 +02: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 22:43:33 +02:00
|
|
|
++ stdenv.lib.optional xvidSupport xvidcore
|
|
|
|
++ stdenv.lib.optional faacSupport faac;
|
2009-03-10 22:03:51 +01:00
|
|
|
|
2011-07-25 16:35:54 +02:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2011-04-23 22:58:52 +02:00
|
|
|
crossAttrs = {
|
|
|
|
dontSetConfigureCross = true;
|
|
|
|
configureFlags = configureFlags ++ [
|
|
|
|
"--cross-prefix=${stdenv.cross.config}-"
|
|
|
|
"--enable-cross-compile"
|
|
|
|
"--target_os=linux"
|
|
|
|
"--arch=${stdenv.cross.arch}"
|
|
|
|
];
|
|
|
|
};
|
2009-03-10 23:45:27 +01:00
|
|
|
|
2009-03-10 22:03:51 +01:00
|
|
|
meta = {
|
|
|
|
homepage = http://www.ffmpeg.org/;
|
|
|
|
description = "A complete, cross-platform solution to record, convert and stream audio and video";
|
2006-06-29 14:41:25 +02:00
|
|
|
};
|
|
|
|
}
|