MPlayer: upgrade to 1.1
- big cleanup of optional dependency handling I hope I didn't miss any cases. - XVID xvid support seams broken, both built-in as external. I didn't notice any issues playing xvid video's though, as ffmpeg's default mpeg4 decoder handles xvid-encoded files just fine. It seems the only users affected by this are users who still encode xvid with mencoder (instead of plain ffmpeg). If this really is an issue to anyone, please let me know, so I can look into it some more, or retain an older mplayer version next to this one.
This commit is contained in:
parent
4c96b8587b
commit
e3ae9289e0
@ -1,36 +1,41 @@
|
|||||||
{ alsaSupport ? true, xvSupport ? true, theoraSupport ? true, cacaSupport ? true
|
{ stdenv, fetchurl, freetype, pkgconfig, yasm, freefont_ttf
|
||||||
, xineramaSupport ? true, randrSupport ? true, dvdnavSupport ? true
|
, x11Support ? true, libX11 ? null, libXext ? null, mesa ? null
|
||||||
, stdenv, fetchurl, fetchsvn, fetchgit, x11, freetype, fontconfig, zlib
|
, xineramaSupport ? true, libXinerama ? null
|
||||||
, alsaLib ? null, libXv ? null, libtheora ? null, libcaca ? null
|
, xvSupport ? true, libXv ? null
|
||||||
, libXinerama ? null, libXrandr ? null, libdvdnav ? null
|
, alsaSupport ? true, alsaLib ? null
|
||||||
, cdparanoia ? null, cddaSupport ? true
|
, screenSaverSupport ? true, libXScrnSaver ? null
|
||||||
, amrnb ? null, amrwb ? null, amrSupport ? false
|
, vdpauSupport ? false, libvdpau ? null
|
||||||
, x11Support ? true, libX11 ? null, libXext ? null
|
, cddaSupport ? true, cdparanoia ? null
|
||||||
, jackaudioSupport ? false, jackaudio ? null
|
, dvdnavSupport ? true, libdvdnav ? null
|
||||||
, x264Support ? false, x264 ? null
|
, bluraySupport ? true, libbluray ? null
|
||||||
, xvidSupport ? false, xvidcore ? null
|
, amrSupport ? false, amrnb ? null, amrwb ? null
|
||||||
|
, cacaSupport ? true, libcaca ? null
|
||||||
, lameSupport ? true, lame ? null
|
, lameSupport ? true, lame ? null
|
||||||
, speexSupport ? true, speex ? null
|
, speexSupport ? true, speex ? null
|
||||||
, screenSaverSupport ? true, libXScrnSaver
|
, theoraSupport ? true, libtheora ? null
|
||||||
, pulseSupport ? false, pulseaudio
|
, x264Support ? false, x264 ? null
|
||||||
, mesa, pkgconfig, unzip, yasm, freefont_ttf
|
, jackaudioSupport ? false, jackaudio ? null
|
||||||
, vdpauSupport ? false, libvdpau ? null
|
, pulseSupport ? false, pulseaudio ? null
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert alsaSupport -> alsaLib != null;
|
assert x11Support -> (libX11 != null && libXext != null && mesa != null);
|
||||||
assert x11Support -> libX11 != null;
|
|
||||||
assert xvSupport -> (libXv != null && x11Support);
|
|
||||||
assert theoraSupport -> libtheora != null;
|
|
||||||
assert cacaSupport -> libcaca != null;
|
|
||||||
assert xineramaSupport -> (libXinerama != null && x11Support);
|
assert xineramaSupport -> (libXinerama != null && x11Support);
|
||||||
assert randrSupport -> (libXrandr != null && x11Support);
|
assert xvSupport -> (libXv != null && x11Support);
|
||||||
assert dvdnavSupport -> libdvdnav != null;
|
assert alsaSupport -> alsaLib != null;
|
||||||
assert cddaSupport -> cdparanoia != null;
|
|
||||||
assert jackaudioSupport -> jackaudio != null;
|
|
||||||
assert amrSupport -> (amrnb != null && amrwb != null);
|
|
||||||
assert screenSaverSupport -> libXScrnSaver != null;
|
assert screenSaverSupport -> libXScrnSaver != null;
|
||||||
assert vdpauSupport -> libvdpau != null;
|
assert vdpauSupport -> libvdpau != null;
|
||||||
|
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;
|
||||||
assert speexSupport -> speex != null;
|
assert speexSupport -> speex != null;
|
||||||
|
assert theoraSupport -> libtheora != null;
|
||||||
|
assert x264Support -> x264 != null;
|
||||||
|
assert jackaudioSupport -> jackaudio != null;
|
||||||
|
assert pulseSupport -> pulseaudio != null;
|
||||||
|
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
@ -64,20 +69,12 @@ let
|
|||||||
};
|
};
|
||||||
} else null;
|
} else null;
|
||||||
|
|
||||||
ffmpegGit = fetchgit {
|
|
||||||
url = "git://git.videolan.org/ffmpeg.git";
|
|
||||||
rev = "9e53f62be1a171eaf9620958c225d42cf5142a30";
|
|
||||||
sha256 = "be0ef2a394c82a0eee0be66bc0b943d37efb90f74ce1030aa89606109434c943";
|
|
||||||
};
|
|
||||||
|
|
||||||
mplayerRev = "34586";
|
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "mplayer-${mplayerRev}";
|
name = "mplayer-1.1";
|
||||||
|
|
||||||
src = fetchsvn {
|
src = fetchurl {
|
||||||
# Old kind of URL:
|
# Old kind of URL:
|
||||||
# url = http://nixos.org/tarballs/mplayer-snapshot-20101227.tar.bz2;
|
# url = http://nixos.org/tarballs/mplayer-snapshot-20101227.tar.bz2;
|
||||||
# Snapshot I took on 20110423
|
# Snapshot I took on 20110423
|
||||||
@ -86,64 +83,72 @@ stdenv.mkDerivation rec {
|
|||||||
#url = http://www.mplayerhq.hu/MPlayer/releases/mplayer-export-snapshot.tar.bz2;
|
#url = http://www.mplayerhq.hu/MPlayer/releases/mplayer-export-snapshot.tar.bz2;
|
||||||
#sha256 = "cc1b3fda75b172f02c3f46581cfb2c17f4090997fe9314ad046e464a76b858bb";
|
#sha256 = "cc1b3fda75b172f02c3f46581cfb2c17f4090997fe9314ad046e464a76b858bb";
|
||||||
|
|
||||||
url = "svn://svn.mplayerhq.hu/mplayer/trunk";
|
url = "http://www.mplayerhq.hu/MPlayer/releases/MPlayer-1.1.tar.xz";
|
||||||
rev = "${mplayerRev}";
|
sha256 = "173cmsfz7ckzy1hay9mpnc5as51127cfnxl20b521d2jvgm4gjvn";
|
||||||
sha256 = "5688add3256b5de8e0410194232aaaeb01531bb507459ffe4f07e69cb2d81bd7";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
prePatch = ''
|
prePatch = ''
|
||||||
sed -i /^_install_strip/d configure
|
sed -i /^_install_strip/d configure
|
||||||
'';
|
'';
|
||||||
|
|
||||||
buildInputs =
|
buildInputs = with stdenv.lib;
|
||||||
[ freetype zlib pkgconfig ]
|
[ freetype pkgconfig ]
|
||||||
++ stdenv.lib.optionals x11Support [ libX11 libXext mesa ]
|
++ optionals x11Support [ libX11 libXext mesa ]
|
||||||
++ stdenv.lib.optional alsaSupport alsaLib
|
++ optional alsaSupport alsaLib
|
||||||
++ stdenv.lib.optional xvSupport libXv
|
++ optional xvSupport libXv
|
||||||
++ stdenv.lib.optional theoraSupport libtheora
|
++ optional theoraSupport libtheora
|
||||||
++ stdenv.lib.optional cacaSupport libcaca
|
++ optional cacaSupport libcaca
|
||||||
++ stdenv.lib.optional xineramaSupport libXinerama
|
++ optional xineramaSupport libXinerama
|
||||||
++ stdenv.lib.optional randrSupport libXrandr
|
++ optional dvdnavSupport libdvdnav
|
||||||
++ stdenv.lib.optionals dvdnavSupport [ libdvdnav libdvdnav.libdvdread ]
|
++ optional bluraySupport libbluray
|
||||||
++ stdenv.lib.optional cddaSupport cdparanoia
|
++ optional cddaSupport cdparanoia
|
||||||
++ stdenv.lib.optional jackaudioSupport jackaudio
|
++ optional jackaudioSupport jackaudio
|
||||||
++ stdenv.lib.optionals amrSupport [ amrnb amrwb ]
|
++ optionals amrSupport [ amrnb amrwb ]
|
||||||
++ stdenv.lib.optional x264Support x264
|
++ optional x264Support x264
|
||||||
++ stdenv.lib.optional xvidSupport xvidcore
|
++ optional pulseSupport pulseaudio
|
||||||
++ stdenv.lib.optional pulseSupport pulseaudio
|
++ optional screenSaverSupport libXScrnSaver
|
||||||
++ stdenv.lib.optional screenSaverSupport libXScrnSaver
|
++ optional lameSupport lame
|
||||||
++ stdenv.lib.optional lameSupport lame
|
++ optional vdpauSupport libvdpau
|
||||||
++ stdenv.lib.optional vdpauSupport libvdpau
|
++ optional speexSupport speex;
|
||||||
++ stdenv.lib.optional speexSupport speex;
|
|
||||||
|
|
||||||
buildNativeInputs = [ yasm ];
|
buildNativeInputs = [ yasm ];
|
||||||
|
|
||||||
preConfigure = ''
|
|
||||||
cp -r ${ffmpegGit} ffmpeg
|
|
||||||
chmod u+w -R ffmpeg
|
|
||||||
sed -ie '1i#include "libavutil/intreadwrite.h"' ffmpeg/libavcodec/libmp3lame.c
|
|
||||||
'';
|
|
||||||
|
|
||||||
postConfigure = ''
|
postConfigure = ''
|
||||||
echo CONFIG_MPEGAUDIODSP=yes >> config.mak
|
echo CONFIG_MPEGAUDIODSP=yes >> config.mak
|
||||||
'';
|
'';
|
||||||
|
|
||||||
configureFlags = ''
|
configureFlags = with stdenv.lib;
|
||||||
${if cacaSupport then "--enable-caca" else "--disable-caca"}
|
''
|
||||||
${if dvdnavSupport then "--enable-dvdnav --enable-dvdread --disable-dvdread-internal" else ""}
|
${if x11Support then "--enable-x11 --enable-gl" else "--disable-x11 --disable-gl"}
|
||||||
${if x264Support then "--enable-x264 --extra-libs=-lx264" else ""}
|
${if xineramaSupport then "--enable-xinerama" else "--disable-xinerama"}
|
||||||
${if codecs != null then "--codecsdir=${codecs}" else ""}
|
${if xvSupport then "--enable-xv" else "--disable-xv"}
|
||||||
${if (stdenv.isi686 || stdenv.isx86_64) then "--enable-runtime-cpudetection" else ""}
|
${if alsaSupport then "--enable-alsa" else "--disable-alsa"}
|
||||||
${if x11Support then "--enable-x11" else ""}
|
${if screenSaverSupport then "--enable-xss" else "--disable-xss"}
|
||||||
${stdenv.lib.optionalString speexSupport "--enable-speex"}
|
${if vdpauSupport then "--enable-vdpau" else "--disable-vdpau"}
|
||||||
--disable-xanim
|
${if cddaSupport then "--enable-cdparanoia" else "--disable-cdparanoia"}
|
||||||
--disable-ivtv
|
${if dvdnavSupport then "--enable-dvdnav" else "--disable-dvdnav"}
|
||||||
--enable-vidix
|
${if bluraySupport then "--enable-bluray" else "--disable-bluray"}
|
||||||
--enable-fbdev
|
${if amrSupport then "--enable-libopencore_amrnb" else "--disable-libopencore_amrnb"}
|
||||||
--disable-ossaudio
|
${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"}
|
||||||
|
|
||||||
NIX_LDFLAGS = if x11Support then "-lX11 -lXext" else "";
|
${optionalString (codecs != null) "--codecsdir=${codecs}"}
|
||||||
|
${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
|
||||||
|
'';
|
||||||
|
|
||||||
|
NIX_LDFLAGS = stdenv.lib.optionalString x11Support "-lX11 -lXext";
|
||||||
|
|
||||||
# Provide a reasonable standard font. Maybe we should symlink here.
|
# Provide a reasonable standard font. Maybe we should symlink here.
|
||||||
postInstall =
|
postInstall =
|
||||||
@ -155,7 +160,7 @@ stdenv.mkDerivation rec {
|
|||||||
crossAttrs = {
|
crossAttrs = {
|
||||||
dontSetConfigureCross = true;
|
dontSetConfigureCross = true;
|
||||||
# Some things (vidix) are nanonote specific. Once someone cares, we can make options from them.
|
# Some things (vidix) are nanonote specific. Once someone cares, we can make options from them.
|
||||||
preConfigure = preConfigure + ''
|
preConfigure = ''
|
||||||
configureFlags="`echo $configureFlags |
|
configureFlags="`echo $configureFlags |
|
||||||
sed -e 's/--codecsdir[^ ]\+//' \
|
sed -e 's/--codecsdir[^ ]\+//' \
|
||||||
-e 's/--enable-runtime-cpudetection//' `"
|
-e 's/--enable-runtime-cpudetection//' `"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user