2010-08-20 22:09:22 +02:00
|
|
|
{ alsaSupport ? true, xvSupport ? true, theoraSupport ? true, cacaSupport ? true
|
|
|
|
, xineramaSupport ? true, randrSupport ? true, dvdnavSupport ? true
|
2011-05-20 10:06:02 +02:00
|
|
|
, stdenv, fetchurl, fetchsvn, fetchgit, x11, freetype, fontconfig, zlib
|
2010-08-29 13:09:23 +02:00
|
|
|
, alsaLib ? null, libXv ? null, libtheora ? null, libcaca ? null
|
2007-10-26 21:47:35 +02:00
|
|
|
, libXinerama ? null, libXrandr ? null, libdvdnav ? null
|
2008-03-06 10:34:36 +01:00
|
|
|
, cdparanoia ? null, cddaSupport ? true
|
2009-10-04 23:31:34 +02:00
|
|
|
, amrnb ? null, amrwb ? null, amrSupport ? false
|
2010-09-01 10:36:09 +02:00
|
|
|
, x11Support ? true, libX11 ? null, libXext ? null
|
2010-04-14 14:13:01 +02:00
|
|
|
, jackaudioSupport ? false, jackaudio ? null
|
2010-04-30 10:33:47 +02:00
|
|
|
, x264Support ? false, x264 ? null
|
2010-04-30 23:47:09 +02:00
|
|
|
, xvidSupport ? false, xvidcore ? null
|
2010-05-25 20:39:29 +02:00
|
|
|
, lameSupport ? true, lame ? null
|
2010-08-20 22:09:22 +02:00
|
|
|
, screenSaverSupport ? true, libXScrnSaver
|
2010-08-29 13:09:23 +02:00
|
|
|
, pulseSupport ? false, pulseaudio
|
2010-12-23 18:07:07 +01:00
|
|
|
, mesa, pkgconfig, unzip, yasm, freefont_ttf
|
2010-12-27 19:48:16 +01:00
|
|
|
, vdpauSupport ? false, libvdpau ? null
|
2005-08-24 17:02:30 +02:00
|
|
|
}:
|
2003-11-11 16:01:07 +01:00
|
|
|
|
2010-08-29 13:09:23 +02:00
|
|
|
assert alsaSupport -> alsaLib != null;
|
2010-08-11 22:14:25 +02:00
|
|
|
assert x11Support -> libX11 != null;
|
|
|
|
assert xvSupport -> (libXv != null && x11Support);
|
2005-02-16 17:18:43 +01:00
|
|
|
assert theoraSupport -> libtheora != null;
|
2005-08-24 17:02:30 +02:00
|
|
|
assert cacaSupport -> libcaca != null;
|
2010-08-11 22:14:25 +02:00
|
|
|
assert xineramaSupport -> (libXinerama != null && x11Support);
|
|
|
|
assert randrSupport -> (libXrandr != null && x11Support);
|
2007-10-26 21:47:35 +02:00
|
|
|
assert dvdnavSupport -> libdvdnav != null;
|
2008-03-06 10:34:36 +01:00
|
|
|
assert cddaSupport -> cdparanoia != null;
|
2010-04-14 14:13:01 +02:00
|
|
|
assert jackaudioSupport -> jackaudio != null;
|
2009-10-04 23:31:34 +02:00
|
|
|
assert amrSupport -> (amrnb != null && amrwb != null);
|
2010-08-29 13:09:23 +02:00
|
|
|
assert screenSaverSupport -> libXScrnSaver != null;
|
2010-12-27 19:48:16 +01:00
|
|
|
assert vdpauSupport -> libvdpau != null;
|
2003-11-11 16:01:07 +01:00
|
|
|
|
2006-12-05 23:28:45 +01:00
|
|
|
let
|
2003-11-11 16:01:07 +01:00
|
|
|
|
2010-08-20 22:09:22 +02: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 14:13:01 +02:00
|
|
|
name = "MPlayer-codecs-essential-20071007";
|
2011-05-21 09:31:07 +02:00
|
|
|
|
2010-08-20 22:09:22 +02:00
|
|
|
src = codecs_src;
|
2004-04-01 20:06:09 +02:00
|
|
|
|
2010-04-14 14:13:01 +02:00
|
|
|
installPhase = ''
|
|
|
|
mkdir $out
|
|
|
|
cp -prv * $out
|
|
|
|
'';
|
2011-05-21 09:31:07 +02:00
|
|
|
|
2010-04-14 14:13:01 +02:00
|
|
|
meta = {
|
|
|
|
license = "unfree";
|
|
|
|
};
|
2010-08-20 22:09:22 +02:00
|
|
|
} else null;
|
2012-01-21 22:25:41 +01:00
|
|
|
|
2011-05-20 10:06:02 +02:00
|
|
|
ffmpegGit = fetchgit {
|
|
|
|
url = "git://git.videolan.org/ffmpeg.git";
|
2012-01-21 22:25:41 +01:00
|
|
|
rev = "9e53f62be1a171eaf9620958c225d42cf5142a30";
|
|
|
|
sha256 = "be0ef2a394c82a0eee0be66bc0b943d37efb90f74ce1030aa89606109434c943";
|
2011-05-20 10:06:02 +02:00
|
|
|
};
|
2012-01-21 22:25:41 +01:00
|
|
|
|
|
|
|
mplayerRev = "34586";
|
2008-04-11 00:12:14 +02:00
|
|
|
|
2011-05-21 09:31:07 +02:00
|
|
|
in
|
2006-12-05 23:28:45 +01:00
|
|
|
|
2010-08-20 23:36:11 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2012-01-21 22:25:45 +01:00
|
|
|
name = "mplayer-${mplayerRev}";
|
2006-12-05 23:28:45 +01:00
|
|
|
|
2011-05-20 10:06:02 +02:00
|
|
|
src = fetchsvn {
|
2011-04-23 23:06:39 +02:00
|
|
|
# Old kind of URL:
|
|
|
|
# url = http://nixos.org/tarballs/mplayer-snapshot-20101227.tar.bz2;
|
|
|
|
# Snapshot I took on 20110423
|
2011-05-20 10:06:02 +02:00
|
|
|
|
|
|
|
#Transient
|
|
|
|
#url = http://www.mplayerhq.hu/MPlayer/releases/mplayer-export-snapshot.tar.bz2;
|
|
|
|
#sha256 = "cc1b3fda75b172f02c3f46581cfb2c17f4090997fe9314ad046e464a76b858bb";
|
|
|
|
|
|
|
|
url = "svn://svn.mplayerhq.hu/mplayer/trunk";
|
|
|
|
rev = "${mplayerRev}";
|
2012-01-21 22:25:41 +01:00
|
|
|
sha256 = "5688add3256b5de8e0410194232aaaeb01531bb507459ffe4f07e69cb2d81bd7";
|
2006-12-05 23:28:45 +01:00
|
|
|
};
|
|
|
|
|
2011-04-23 23:06:39 +02:00
|
|
|
prePatch = ''
|
|
|
|
sed -i /^_install_strip/d configure
|
|
|
|
'';
|
|
|
|
|
2009-03-10 22:03:51 +01:00
|
|
|
buildInputs =
|
2011-04-24 01:04:22 +02:00
|
|
|
[ freetype zlib pkgconfig ]
|
2010-09-01 10:36:09 +02:00
|
|
|
++ stdenv.lib.optional x11Support [ libX11 libXext mesa ]
|
2010-08-20 22:09:22 +02:00
|
|
|
++ stdenv.lib.optional alsaSupport alsaLib
|
2009-03-10 22:03:51 +01: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 14:13:01 +02:00
|
|
|
++ stdenv.lib.optionals dvdnavSupport [ libdvdnav libdvdnav.libdvdread ]
|
2009-10-04 23:31:34 +02:00
|
|
|
++ stdenv.lib.optional cddaSupport cdparanoia
|
2010-04-14 14:13:01 +02:00
|
|
|
++ stdenv.lib.optional jackaudioSupport jackaudio
|
2010-04-30 10:33:47 +02:00
|
|
|
++ stdenv.lib.optionals amrSupport [ amrnb amrwb ]
|
2010-04-30 23:47:09 +02:00
|
|
|
++ stdenv.lib.optional x264Support x264
|
2010-05-25 20:39:29 +02:00
|
|
|
++ stdenv.lib.optional xvidSupport xvidcore
|
2010-08-20 22:09:22 +02:00
|
|
|
++ stdenv.lib.optional pulseSupport pulseaudio
|
|
|
|
++ stdenv.lib.optional screenSaverSupport libXScrnSaver
|
2010-12-27 19:48:16 +01:00
|
|
|
++ stdenv.lib.optional lameSupport lame
|
|
|
|
++ stdenv.lib.optional vdpauSupport libvdpau;
|
2005-08-24 17:02:30 +02:00
|
|
|
|
2010-08-11 22:14:25 +02:00
|
|
|
buildNativeInputs = [ yasm ];
|
|
|
|
|
2011-04-23 23:06:39 +02:00
|
|
|
preConfigure = ''
|
2011-05-20 10:06:02 +02:00
|
|
|
cp -r ${ffmpegGit} ffmpeg
|
|
|
|
chmod u+w -R ffmpeg
|
|
|
|
sed -ie '1i#include "libavutil/intreadwrite.h"' ffmpeg/libavcodec/libmp3lame.c
|
|
|
|
'';
|
|
|
|
|
|
|
|
postConfigure = ''
|
|
|
|
echo CONFIG_MPEGAUDIODSP=yes >> config.mak
|
2011-04-23 23:06:39 +02:00
|
|
|
'';
|
|
|
|
|
2009-03-10 22:03:51 +01:00
|
|
|
configureFlags = ''
|
2006-12-05 23:28:45 +01:00
|
|
|
${if cacaSupport then "--enable-caca" else "--disable-caca"}
|
2009-03-10 22:03:51 +01:00
|
|
|
${if dvdnavSupport then "--enable-dvdnav --enable-dvdread --disable-dvdread-internal" else ""}
|
2010-04-30 10:33:47 +02:00
|
|
|
${if x264Support then "--enable-x264 --extra-libs=-lx264" else ""}
|
2010-08-20 22:09:22 +02:00
|
|
|
${if codecs != null then "--codecsdir=${codecs}" else ""}
|
2010-09-01 10:36:09 +02:00
|
|
|
${if (stdenv.isi686 || stdenv.isx86_64) then "--enable-runtime-cpudetection" else ""}
|
2010-08-11 22:14:25 +02:00
|
|
|
${if x11Support then "--enable-x11" else ""}
|
2006-12-05 23:28:45 +01:00
|
|
|
--disable-xanim
|
2009-02-17 17:10:19 +01:00
|
|
|
--disable-ivtv
|
2011-04-23 23:06:39 +02:00
|
|
|
--enable-vidix
|
|
|
|
--enable-fbdev
|
2011-07-18 18:08:15 +02:00
|
|
|
--disable-ossaudio
|
2009-03-10 22:03:51 +01:00
|
|
|
'';
|
2006-12-05 23:28:45 +01:00
|
|
|
|
2010-08-11 22:14:25 +02:00
|
|
|
NIX_LDFLAGS = if x11Support then "-lX11 -lXext" else "";
|
|
|
|
|
2010-12-23 18:07:07 +01: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
|
|
|
|
'';
|
|
|
|
|
2010-08-11 22:14:25 +02:00
|
|
|
crossAttrs = {
|
2011-04-23 23:06:39 +02:00
|
|
|
dontSetConfigureCross = true;
|
|
|
|
# Some things (vidix) are nanonote specific. Once someone cares, we can make options from them.
|
|
|
|
preConfigure = preConfigure + ''
|
2010-08-11 22:14:25 +02:00
|
|
|
configureFlags="`echo $configureFlags |
|
2011-04-23 23:06:39 +02:00
|
|
|
sed -e 's/--codecsdir[^ ]\+//' \
|
2010-08-11 22:14:25 +02:00
|
|
|
-e 's/--enable-runtime-cpudetection//' `"
|
|
|
|
configureFlags="$configureFlags --target=${stdenv.cross.arch}-linux
|
2011-04-23 23:06:39 +02:00
|
|
|
--enable-cross-compile --cc=$crossConfig-gcc --as=$crossConfig-as
|
|
|
|
--disable-vidix-pcidb --with-vidix-drivers=no --host-cc=gcc"
|
2010-08-11 22:14:25 +02:00
|
|
|
'';
|
|
|
|
};
|
2007-10-26 21:47:35 +02:00
|
|
|
|
2006-10-11 18:45:55 +02:00
|
|
|
meta = {
|
|
|
|
description = "A movie player that supports many video formats";
|
2008-03-06 10:34:36 +01:00
|
|
|
homepage = "http://mplayerhq.hu";
|
|
|
|
license = "GPL";
|
2010-08-20 22:09:22 +02:00
|
|
|
maintainers = [ stdenv.lib.maintainers.eelco stdenv.lib.maintainers.urkud ];
|
2012-01-28 15:39:56 +01:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2006-10-11 18:45:55 +02:00
|
|
|
};
|
2003-11-11 16:01:07 +01:00
|
|
|
}
|