2010-08-20 20:09:22 +00:00
|
|
|
{ alsaSupport ? true, xvSupport ? true, theoraSupport ? true, cacaSupport ? true
|
|
|
|
, xineramaSupport ? true, randrSupport ? true, dvdnavSupport ? true
|
2010-04-14 12:13:01 +00:00
|
|
|
, stdenv, fetchurl, x11, freetype, fontconfig, zlib
|
2010-08-29 11:09:23 +00:00
|
|
|
, alsaLib ? null, libXv ? null, libtheora ? null, libcaca ? null
|
2007-10-26 19:47:35 +00:00
|
|
|
, libXinerama ? null, libXrandr ? null, libdvdnav ? null
|
2008-03-06 09:34:36 +00:00
|
|
|
, cdparanoia ? null, cddaSupport ? true
|
2009-10-04 21:31:34 +00:00
|
|
|
, amrnb ? null, amrwb ? null, amrSupport ? false
|
2010-09-01 08:36:09 +00:00
|
|
|
, x11Support ? true, libX11 ? null, libXext ? null
|
2010-04-14 12:13:01 +00:00
|
|
|
, jackaudioSupport ? false, jackaudio ? null
|
2010-04-30 08:33:47 +00:00
|
|
|
, x264Support ? false, x264 ? null
|
2010-04-30 21:47:09 +00:00
|
|
|
, xvidSupport ? false, xvidcore ? null
|
2010-05-25 18:39:29 +00:00
|
|
|
, lameSupport ? true, lame ? null
|
2010-08-20 20:09:22 +00:00
|
|
|
, screenSaverSupport ? true, libXScrnSaver
|
2010-08-29 11:09:23 +00:00
|
|
|
, pulseSupport ? false, pulseaudio
|
2010-05-25 18:39:29 +00:00
|
|
|
, mesa, pkgconfig, unzip, yasm
|
2005-08-24 15:02:30 +00:00
|
|
|
}:
|
2003-11-11 15:01:07 +00:00
|
|
|
|
2010-08-29 11:09:23 +00:00
|
|
|
assert alsaSupport -> alsaLib != null;
|
2010-08-11 20:14:25 +00:00
|
|
|
assert x11Support -> libX11 != null;
|
|
|
|
assert xvSupport -> (libXv != null && x11Support);
|
2005-02-16 16:18:43 +00:00
|
|
|
assert theoraSupport -> libtheora != null;
|
2005-08-24 15:02:30 +00:00
|
|
|
assert cacaSupport -> libcaca != null;
|
2010-08-11 20:14:25 +00:00
|
|
|
assert xineramaSupport -> (libXinerama != null && x11Support);
|
|
|
|
assert randrSupport -> (libXrandr != null && x11Support);
|
2007-10-26 19:47:35 +00:00
|
|
|
assert dvdnavSupport -> libdvdnav != null;
|
2008-03-06 09:34:36 +00:00
|
|
|
assert cddaSupport -> cdparanoia != null;
|
2010-04-14 12:13:01 +00:00
|
|
|
assert jackaudioSupport -> jackaudio != null;
|
2009-10-04 21:31:34 +00:00
|
|
|
assert amrSupport -> (amrnb != null && amrwb != null);
|
2010-08-29 11:09:23 +00:00
|
|
|
assert screenSaverSupport -> libXScrnSaver != null;
|
2003-11-11 15:01:07 +00:00
|
|
|
|
2006-12-05 22:28:45 +00:00
|
|
|
let
|
2003-11-11 15:01:07 +00:00
|
|
|
|
2010-08-20 20:09:22 +00:00
|
|
|
codecs_src =
|
|
|
|
let
|
|
|
|
dir = http://www.mplayerhq.hu/MPlayer/releases/codecs/;
|
|
|
|
in
|
|
|
|
if stdenv.system == "i686-linux" then fetchurl {
|
|
|
|
url = "${dir}/essential-20071007.tar.bz2";
|
|
|
|
sha256 = "18vls12n12rjw0mzw4pkp9vpcfmd1c21rzha19d7zil4hn7fs2ic";
|
|
|
|
} else if stdenv.system == "x86_64-linux" then fetchurl {
|
|
|
|
url = "${dir}/essential-amd64-20071007.tar.bz2";
|
|
|
|
sha256 = "13xf5b92w1ra5hw00ck151lypbmnylrnznq9hhb0sj36z5wz290x";
|
|
|
|
} else if stdenv.system == "powerpc-linux" then fetchurl {
|
|
|
|
url = "${dir}/essential-ppc-20071007.tar.bz2";
|
|
|
|
sha256 = "18mlj8dp4wnz42xbhdk1jlz2ygra6fbln9wyrcyvynxh96g1871z";
|
|
|
|
} else null;
|
|
|
|
|
|
|
|
codecs = if codecs_src != null then stdenv.mkDerivation {
|
2010-04-14 12:13:01 +00:00
|
|
|
name = "MPlayer-codecs-essential-20071007";
|
|
|
|
|
2010-08-20 20:09:22 +00:00
|
|
|
src = codecs_src;
|
2004-04-01 18:06:09 +00:00
|
|
|
|
2010-04-14 12:13:01 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir $out
|
|
|
|
cp -prv * $out
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
license = "unfree";
|
|
|
|
};
|
2010-08-20 20:09:22 +00:00
|
|
|
} else null;
|
2008-04-10 22:12:14 +00:00
|
|
|
|
2010-04-14 12:13:01 +00:00
|
|
|
in
|
2006-12-05 22:28:45 +00:00
|
|
|
|
2010-08-20 21:36:11 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "MPlayer-1.0-pre31984";
|
2006-12-05 22:28:45 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2010-08-20 21:36:11 +00:00
|
|
|
url = "http://www.loegria.net/misc/${name}.tar.bz2";
|
|
|
|
sha256 = "0mg6kggja113rsvvsk05gk50xl5qwzsms6pmb4ylc99mflh7m9km";
|
2006-12-05 22:28:45 +00:00
|
|
|
};
|
|
|
|
|
2009-03-10 21:03:51 +00:00
|
|
|
buildInputs =
|
2010-08-11 20:14:25 +00:00
|
|
|
[ freetype zlib pkgconfig ]
|
2010-09-01 08:36:09 +00:00
|
|
|
++ stdenv.lib.optional x11Support [ libX11 libXext mesa ]
|
2010-08-20 20:09:22 +00:00
|
|
|
++ stdenv.lib.optional alsaSupport alsaLib
|
2009-03-10 21:03:51 +00:00
|
|
|
++ stdenv.lib.optional xvSupport libXv
|
|
|
|
++ stdenv.lib.optional theoraSupport libtheora
|
|
|
|
++ stdenv.lib.optional cacaSupport libcaca
|
|
|
|
++ stdenv.lib.optional xineramaSupport libXinerama
|
|
|
|
++ stdenv.lib.optional randrSupport libXrandr
|
2010-04-14 12:13:01 +00:00
|
|
|
++ stdenv.lib.optionals dvdnavSupport [ libdvdnav libdvdnav.libdvdread ]
|
2009-10-04 21:31:34 +00:00
|
|
|
++ stdenv.lib.optional cddaSupport cdparanoia
|
2010-04-14 12:13:01 +00:00
|
|
|
++ stdenv.lib.optional jackaudioSupport jackaudio
|
2010-04-30 08:33:47 +00:00
|
|
|
++ stdenv.lib.optionals amrSupport [ amrnb amrwb ]
|
2010-04-30 21:47:09 +00:00
|
|
|
++ stdenv.lib.optional x264Support x264
|
2010-05-25 18:39:29 +00:00
|
|
|
++ stdenv.lib.optional xvidSupport xvidcore
|
2010-08-20 20:09:22 +00:00
|
|
|
++ stdenv.lib.optional pulseSupport pulseaudio
|
|
|
|
++ stdenv.lib.optional screenSaverSupport libXScrnSaver
|
2010-05-25 18:39:29 +00:00
|
|
|
++ stdenv.lib.optional lameSupport lame;
|
2005-08-24 15:02:30 +00:00
|
|
|
|
2010-08-11 20:14:25 +00:00
|
|
|
buildNativeInputs = [ yasm ];
|
|
|
|
|
2009-03-10 21:03:51 +00:00
|
|
|
configureFlags = ''
|
2006-12-05 22:28:45 +00:00
|
|
|
${if cacaSupport then "--enable-caca" else "--disable-caca"}
|
2009-03-10 21:03:51 +00:00
|
|
|
${if dvdnavSupport then "--enable-dvdnav --enable-dvdread --disable-dvdread-internal" else ""}
|
2010-04-30 08:33:47 +00:00
|
|
|
${if x264Support then "--enable-x264 --extra-libs=-lx264" else ""}
|
2010-08-20 20:09:22 +00:00
|
|
|
${if codecs != null then "--codecsdir=${codecs}" else ""}
|
2010-09-01 08:36:09 +00:00
|
|
|
${if (stdenv.isi686 || stdenv.isx86_64) then "--enable-runtime-cpudetection" else ""}
|
2010-08-11 20:14:25 +00:00
|
|
|
${if x11Support then "--enable-x11" else ""}
|
2006-12-05 22:28:45 +00:00
|
|
|
--disable-xanim
|
2009-02-17 16:10:19 +00:00
|
|
|
--disable-ivtv
|
2009-03-10 21:03:51 +00:00
|
|
|
'';
|
2006-12-05 22:28:45 +00:00
|
|
|
|
2010-08-11 20:14:25 +00:00
|
|
|
NIX_LDFLAGS = if x11Support then "-lX11 -lXext" else "";
|
|
|
|
|
|
|
|
crossAttrs = {
|
|
|
|
preConfigure = ''
|
|
|
|
configureFlags="`echo $configureFlags |
|
|
|
|
sed -e 's/--build[^ ]\+//' \
|
|
|
|
-e 's/--host[^ ]\+//' \
|
|
|
|
-e 's/--codecsdir[^ ]\+//' \
|
|
|
|
-e 's/--enable-runtime-cpudetection//' `"
|
|
|
|
configureFlags="$configureFlags --target=${stdenv.cross.arch}-linux
|
|
|
|
--cc=$crossConfig-gcc --as=$crossConfig-as"
|
|
|
|
'';
|
|
|
|
};
|
2007-10-26 19:47:35 +00:00
|
|
|
|
2006-10-11 16:45:55 +00:00
|
|
|
meta = {
|
|
|
|
description = "A movie player that supports many video formats";
|
2008-03-06 09:34:36 +00:00
|
|
|
homepage = "http://mplayerhq.hu";
|
|
|
|
license = "GPL";
|
2010-08-20 20:09:22 +00:00
|
|
|
maintainers = [ stdenv.lib.maintainers.eelco stdenv.lib.maintainers.urkud ];
|
2006-10-11 16:45:55 +00:00
|
|
|
};
|
2003-11-11 15:01:07 +00:00
|
|
|
}
|