From a88f348d5b8414dcc9bdd694403cb2c94aa0b7e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Wed, 1 Sep 2010 08:36:09 +0000 Subject: [PATCH] Make mplayer build on the loongson2f svn path=/nixpkgs/branches/stdenv-updates/; revision=23578 --- pkgs/applications/video/MPlayer/default.nix | 6 +-- pkgs/development/libraries/ffmpeg/default.nix | 39 ++++++++++--------- pkgs/development/libraries/libvpx/default.nix | 15 ++++++- pkgs/top-level/all-packages.nix | 4 +- 4 files changed, 39 insertions(+), 25 deletions(-) diff --git a/pkgs/applications/video/MPlayer/default.nix b/pkgs/applications/video/MPlayer/default.nix index 879845793e2..47c68df1ba3 100644 --- a/pkgs/applications/video/MPlayer/default.nix +++ b/pkgs/applications/video/MPlayer/default.nix @@ -5,7 +5,7 @@ , libXinerama ? null, libXrandr ? null, libdvdnav ? null , cdparanoia ? null, cddaSupport ? true , amrnb ? null, amrwb ? null, amrSupport ? false -, x11Support ? true, libX11 ? null +, x11Support ? true, libX11 ? null, libXext ? null , jackaudioSupport ? false, jackaudio ? null , x264Support ? false, x264 ? null , xvidSupport ? false, xvidcore ? null @@ -72,7 +72,7 @@ stdenv.mkDerivation rec { buildInputs = [ freetype zlib pkgconfig ] - ++ stdenv.lib.optional x11Support [ libX11 mesa ] + ++ stdenv.lib.optional x11Support [ libX11 libXext mesa ] ++ stdenv.lib.optional alsaSupport alsaLib ++ stdenv.lib.optional xvSupport libXv ++ stdenv.lib.optional theoraSupport libtheora @@ -96,7 +96,7 @@ stdenv.mkDerivation rec { ${if dvdnavSupport then "--enable-dvdnav --enable-dvdread --disable-dvdread-internal" else ""} ${if x264Support then "--enable-x264 --extra-libs=-lx264" else ""} ${if codecs != null then "--codecsdir=${codecs}" else ""} - --enable-runtime-cpudetection + ${if (stdenv.isi686 || stdenv.isx86_64) then "--enable-runtime-cpudetection" else ""} ${if x11Support then "--enable-x11" else ""} --disable-xanim --disable-ivtv diff --git a/pkgs/development/libraries/ffmpeg/default.nix b/pkgs/development/libraries/ffmpeg/default.nix index 01479564dd7..d9f9d0af01d 100644 --- a/pkgs/development/libraries/ffmpeg/default.nix +++ b/pkgs/development/libraries/ffmpeg/default.nix @@ -1,5 +1,5 @@ {stdenv, fetchurl, faad2, libtheora, speex, libvorbis, x264, pkgconfig, xvidcore, lame, yasm -, libvpx}: +, vpxSupport ? false, libvpx ? null}: stdenv.mkDerivation { name = "ffmpeg-0.6"; @@ -12,25 +12,26 @@ stdenv.mkDerivation { # `--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. - configureFlags = '' - --enable-gpl - --enable-postproc - --enable-swscale - --disable-ffserver - --disable-ffplay - --enable-libfaad - --enable-shared - --enable-libtheora - --enable-libvorbis - --enable-libspeex - --enable-libx264 - --enable-libxvid - --enable-libmp3lame - --enable-runtime-cpudetect - --enable-libvpx - ''; + configureFlags = [ + "--enable-gpl" + "--enable-postproc" + "--enable-swscale" + "--disable-ffserver" + "--disable-ffplay" + "--enable-libfaad" + "--enable-shared" + "--enable-libtheora" + "--enable-libvorbis" + "--enable-libspeex" + "--enable-libx264" + "--enable-libxvid" + "--enable-libmp3lame" + "--enable-runtime-cpudetect" + ] ++ + stdenv.lib.optional vpxSupport "--enable-libvpx"; - buildInputs = [faad2 libtheora speex libvorbis x264 pkgconfig xvidcore lame yasm libvpx]; + buildInputs = [ faad2 libtheora speex libvorbis x264 pkgconfig xvidcore lame yasm ] + ++ stdenv.lib.optional vpxSupport libvpx; meta = { homepage = http://www.ffmpeg.org/; diff --git a/pkgs/development/libraries/libvpx/default.nix b/pkgs/development/libraries/libvpx/default.nix index 7cd2e4d639b..e6c8149edc0 100644 --- a/pkgs/development/libraries/libvpx/default.nix +++ b/pkgs/development/libraries/libvpx/default.nix @@ -11,14 +11,25 @@ stdenv.mkDerivation rec { patchPhase = '' sed -e 's,/bin/bash,${bash}/bin/bash,' -i configure build/make/version.sh \ examples/gen_example_code.sh + sed -e '/enable linux/d' -i configure ''; - configurePhase = '' + configureScript = "../configure"; + + preConfigure = '' mkdir -p build cd build - ../configure --disable-install-srcs --disable-examples --enable-vp8 --enable-runtime-cpu-detect --enable-shared --enable-pic ''; + configureFlags = [ + "--disable-install-srcs" + "--disable-examples" + "--enable-vp8" + "--enable-runtime-cpu-detect" + "--enable-shared" + "--enable-pic" + ]; + installPhase = '' make quiet=false DIST_DIR=$out install ''; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 05886c41130..40f9dcd5dac 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2723,7 +2723,9 @@ let fcgi = callPackage ../development/libraries/fcgi { }; - ffmpeg = callPackage ../development/libraries/ffmpeg { }; + ffmpeg = callPackage ../development/libraries/ffmpeg { + vpxSupport = if !stdenv.isMips then true else false; + }; fftw = callPackage ../development/libraries/fftw { singlePrecision = false;