2012-10-03 21:44:45 +00:00
|
|
|
{ stdenv, fetchurl, freetype, pkgconfig, yasm, freefont_ttf
|
|
|
|
, x11Support ? true, libX11 ? null, libXext ? null, mesa ? null
|
|
|
|
, xineramaSupport ? true, libXinerama ? null
|
|
|
|
, xvSupport ? true, libXv ? null
|
|
|
|
, alsaSupport ? true, alsaLib ? null
|
|
|
|
, screenSaverSupport ? true, libXScrnSaver ? null
|
|
|
|
, vdpauSupport ? false, libvdpau ? null
|
|
|
|
, cddaSupport ? true, cdparanoia ? null
|
|
|
|
, dvdnavSupport ? true, libdvdnav ? null
|
|
|
|
, bluraySupport ? true, libbluray ? null
|
|
|
|
, amrSupport ? false, amrnb ? null, amrwb ? null
|
|
|
|
, cacaSupport ? true, libcaca ? null
|
2010-05-25 18:39:29 +00:00
|
|
|
, lameSupport ? true, lame ? null
|
2012-05-09 10:01:35 +00:00
|
|
|
, speexSupport ? true, speex ? null
|
2012-10-03 21:44:45 +00:00
|
|
|
, theoraSupport ? true, libtheora ? null
|
|
|
|
, x264Support ? false, x264 ? null
|
|
|
|
, jackaudioSupport ? false, jackaudio ? null
|
|
|
|
, pulseSupport ? false, pulseaudio ? null
|
2013-05-16 23:18:48 +00:00
|
|
|
, bs2bSupport ? false, libbs2b ? null
|
2012-11-04 17:58:13 +00:00
|
|
|
# For screenshots
|
|
|
|
, libpngSupport ? true, libpng ? null
|
2013-01-14 22:08:27 +00:00
|
|
|
, useUnfreeCodecs ? false
|
2005-08-24 15:02:30 +00:00
|
|
|
}:
|
2003-11-11 15:01:07 +00:00
|
|
|
|
2012-10-03 21:44:45 +00:00
|
|
|
assert x11Support -> (libX11 != null && libXext != null && mesa != null);
|
2010-08-11 20:14:25 +00:00
|
|
|
assert xineramaSupport -> (libXinerama != null && x11Support);
|
2012-10-03 21:44:45 +00:00
|
|
|
assert xvSupport -> (libXv != null && x11Support);
|
|
|
|
assert alsaSupport -> alsaLib != null;
|
2010-08-29 11:09:23 +00:00
|
|
|
assert screenSaverSupport -> libXScrnSaver != null;
|
2010-12-27 18:48:16 +00:00
|
|
|
assert vdpauSupport -> libvdpau != null;
|
2012-10-03 21:44:45 +00:00
|
|
|
assert cddaSupport -> cdparanoia != null;
|
|
|
|
assert dvdnavSupport -> libdvdnav != null;
|
|
|
|
assert bluraySupport -> libbluray != null;
|
|
|
|
assert amrSupport -> (amrnb != null && amrwb != null);
|
|
|
|
assert cacaSupport -> libcaca != null;
|
|
|
|
assert lameSupport -> lame != null;
|
2012-05-09 10:01:35 +00:00
|
|
|
assert speexSupport -> speex != null;
|
2012-10-03 21:44:45 +00:00
|
|
|
assert theoraSupport -> libtheora != null;
|
|
|
|
assert x264Support -> x264 != null;
|
|
|
|
assert jackaudioSupport -> jackaudio != null;
|
|
|
|
assert pulseSupport -> pulseaudio != null;
|
2013-05-16 23:18:48 +00:00
|
|
|
assert bs2bSupport -> libbs2b != null;
|
2012-11-04 17:58:13 +00:00
|
|
|
assert libpngSupport -> libpng != 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";
|
2011-05-21 07:31:07 +00:00
|
|
|
|
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
|
|
|
|
'';
|
2011-05-21 07:31:07 +00:00
|
|
|
|
2013-01-14 22:08:27 +00:00
|
|
|
meta.license = "unfree";
|
2010-08-20 20:09:22 +00:00
|
|
|
} else null;
|
2012-01-21 21:25:41 +00:00
|
|
|
|
2011-05-21 07:31:07 +00:00
|
|
|
in
|
2006-12-05 22:28:45 +00:00
|
|
|
|
2010-08-20 21:36:11 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2012-10-03 21:44:45 +00:00
|
|
|
name = "mplayer-1.1";
|
2006-12-05 22:28:45 +00:00
|
|
|
|
2012-10-03 21:44:45 +00:00
|
|
|
src = fetchurl {
|
2011-04-23 21:06:39 +00:00
|
|
|
# Old kind of URL:
|
2013-06-25 12:05:48 +00:00
|
|
|
# url = http://tarballs.nixos.org/mplayer-snapshot-20101227.tar.bz2;
|
2011-04-23 21:06:39 +00:00
|
|
|
# Snapshot I took on 20110423
|
2011-05-20 08:06:02 +00:00
|
|
|
|
|
|
|
#Transient
|
|
|
|
#url = http://www.mplayerhq.hu/MPlayer/releases/mplayer-export-snapshot.tar.bz2;
|
|
|
|
#sha256 = "cc1b3fda75b172f02c3f46581cfb2c17f4090997fe9314ad046e464a76b858bb";
|
|
|
|
|
2012-10-03 21:44:45 +00:00
|
|
|
url = "http://www.mplayerhq.hu/MPlayer/releases/MPlayer-1.1.tar.xz";
|
|
|
|
sha256 = "173cmsfz7ckzy1hay9mpnc5as51127cfnxl20b521d2jvgm4gjvn";
|
2006-12-05 22:28:45 +00:00
|
|
|
};
|
|
|
|
|
2011-04-23 21:06:39 +00:00
|
|
|
prePatch = ''
|
|
|
|
sed -i /^_install_strip/d configure
|
|
|
|
'';
|
|
|
|
|
2012-10-03 21:44:45 +00:00
|
|
|
buildInputs = with stdenv.lib;
|
|
|
|
[ freetype pkgconfig ]
|
|
|
|
++ optionals x11Support [ libX11 libXext mesa ]
|
|
|
|
++ optional alsaSupport alsaLib
|
|
|
|
++ optional xvSupport libXv
|
|
|
|
++ optional theoraSupport libtheora
|
|
|
|
++ optional cacaSupport libcaca
|
|
|
|
++ optional xineramaSupport libXinerama
|
|
|
|
++ optional dvdnavSupport libdvdnav
|
|
|
|
++ optional bluraySupport libbluray
|
|
|
|
++ optional cddaSupport cdparanoia
|
|
|
|
++ optional jackaudioSupport jackaudio
|
|
|
|
++ optionals amrSupport [ amrnb amrwb ]
|
|
|
|
++ optional x264Support x264
|
|
|
|
++ optional pulseSupport pulseaudio
|
|
|
|
++ optional screenSaverSupport libXScrnSaver
|
|
|
|
++ optional lameSupport lame
|
|
|
|
++ optional vdpauSupport libvdpau
|
2012-11-04 17:58:13 +00:00
|
|
|
++ optional speexSupport speex
|
|
|
|
++ optional libpngSupport libpng
|
2013-05-16 23:18:48 +00:00
|
|
|
++ optional bs2bSupport libbs2b
|
2012-11-04 17:58:13 +00:00
|
|
|
;
|
2005-08-24 15:02:30 +00:00
|
|
|
|
2012-12-28 18:20:09 +00:00
|
|
|
nativeBuildInputs = [ yasm ];
|
2010-08-11 20:14:25 +00:00
|
|
|
|
2011-05-20 08:06:02 +00:00
|
|
|
postConfigure = ''
|
|
|
|
echo CONFIG_MPEGAUDIODSP=yes >> config.mak
|
2011-04-23 21:06:39 +00:00
|
|
|
'';
|
|
|
|
|
2012-10-03 21:44:45 +00:00
|
|
|
configureFlags = with stdenv.lib;
|
|
|
|
''
|
|
|
|
${if x11Support then "--enable-x11 --enable-gl" else "--disable-x11 --disable-gl"}
|
|
|
|
${if xineramaSupport then "--enable-xinerama" else "--disable-xinerama"}
|
|
|
|
${if xvSupport then "--enable-xv" else "--disable-xv"}
|
|
|
|
${if alsaSupport then "--enable-alsa" else "--disable-alsa"}
|
|
|
|
${if screenSaverSupport then "--enable-xss" else "--disable-xss"}
|
|
|
|
${if vdpauSupport then "--enable-vdpau" else "--disable-vdpau"}
|
|
|
|
${if cddaSupport then "--enable-cdparanoia" else "--disable-cdparanoia"}
|
|
|
|
${if dvdnavSupport then "--enable-dvdnav" else "--disable-dvdnav"}
|
|
|
|
${if bluraySupport then "--enable-bluray" else "--disable-bluray"}
|
|
|
|
${if amrSupport then "--enable-libopencore_amrnb" else "--disable-libopencore_amrnb"}
|
|
|
|
${if cacaSupport then "--enable-caca" else "--disable-caca"}
|
|
|
|
${if lameSupport then "--enable-mp3lame --disable-mp3lame-lavc" else "--disable-mp3lame --enable-mp3lame-lavc"}
|
|
|
|
${if speexSupport then "--enable-speex" else "--disable-speex"}
|
|
|
|
${if theoraSupport then "--enable-theora" else "--disable-theora"}
|
|
|
|
${if x264Support then "--enable-x264 --disable-x264-lavc" else "--disable-x264 --enable-x264-lavc"}
|
|
|
|
${if jackaudioSupport then "--enable-jack" else "--disable-jack"}
|
|
|
|
${if pulseSupport then "--enable-pulse" else "--disable-pulse"}
|
2013-01-14 22:08:27 +00:00
|
|
|
${optionalString (useUnfreeCodecs && codecs != null) "--codecsdir=${codecs}"}
|
2012-10-03 21:44:45 +00:00
|
|
|
${optionalString (stdenv.isi686 || stdenv.isx86_64) "--enable-runtime-cpudetection"}
|
|
|
|
--enable-freetype
|
|
|
|
--disable-xanim
|
|
|
|
--disable-ivtv
|
|
|
|
--disable-xvid --disable-xvid-lavc
|
|
|
|
--enable-vidix
|
|
|
|
--enable-fbdev
|
|
|
|
--disable-ossaudio
|
|
|
|
'';
|
2006-12-05 22:28:45 +00:00
|
|
|
|
2012-10-03 21:44:45 +00:00
|
|
|
NIX_LDFLAGS = stdenv.lib.optionalString x11Support "-lX11 -lXext";
|
2010-08-11 20:14:25 +00:00
|
|
|
|
2013-02-28 20:15:59 +00:00
|
|
|
installTargets = [ "install" ] ++ stdenv.lib.optional x11Support "install-gui";
|
|
|
|
|
2013-01-14 22:08:27 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2010-12-23 17:07:07 +00:00
|
|
|
# Provide a reasonable standard font. Maybe we should symlink here.
|
|
|
|
postInstall =
|
|
|
|
''
|
|
|
|
mkdir -p $out/share/mplayer
|
|
|
|
cp ${freefont_ttf}/share/fonts/truetype/FreeSans.ttf $out/share/mplayer/subfont.ttf
|
2013-02-28 20:15:59 +00:00
|
|
|
if test -f $out/share/applications/mplayer.desktop ; then
|
|
|
|
echo "NoDisplay=True" >> $out/share/applications/mplayer.desktop
|
|
|
|
fi
|
2010-12-23 17:07:07 +00:00
|
|
|
'';
|
|
|
|
|
2010-08-11 20:14:25 +00:00
|
|
|
crossAttrs = {
|
2011-04-23 21:06:39 +00:00
|
|
|
dontSetConfigureCross = true;
|
|
|
|
# Some things (vidix) are nanonote specific. Once someone cares, we can make options from them.
|
2012-10-03 21:44:45 +00:00
|
|
|
preConfigure = ''
|
2010-08-11 20:14:25 +00:00
|
|
|
configureFlags="`echo $configureFlags |
|
2011-04-23 21:06:39 +00:00
|
|
|
sed -e 's/--codecsdir[^ ]\+//' \
|
2010-08-11 20:14:25 +00:00
|
|
|
-e 's/--enable-runtime-cpudetection//' `"
|
|
|
|
configureFlags="$configureFlags --target=${stdenv.cross.arch}-linux
|
2011-04-23 21:06:39 +00:00
|
|
|
--enable-cross-compile --cc=$crossConfig-gcc --as=$crossConfig-as
|
|
|
|
--disable-vidix-pcidb --with-vidix-drivers=no --host-cc=gcc"
|
2010-08-11 20:14:25 +00:00
|
|
|
'';
|
|
|
|
};
|
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 ];
|
2012-01-28 14:39:56 +00:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2006-10-11 16:45:55 +00:00
|
|
|
};
|
2003-11-11 15:01:07 +00:00
|
|
|
}
|