Added CDDA support to MPlayer

svn path=/nixpkgs/trunk/; revision=10978
This commit is contained in:
Michael Raskin 2008-03-06 09:34:36 +00:00
parent a463854cd7
commit 003a6d10b5
3 changed files with 28 additions and 5 deletions

View File

@ -3,6 +3,9 @@
, stdenv, fetchurl, x11, freetype, freefont_ttf, zlib , stdenv, fetchurl, x11, freetype, freefont_ttf, zlib
, alsa ? null, libX11, libXv ? null, libtheora ? null, libcaca ? null , alsa ? null, libX11, libXv ? null, libtheora ? null, libcaca ? null
, libXinerama ? null, libXrandr ? null, libdvdnav ? null , libXinerama ? null, libXrandr ? null, libdvdnav ? null
, cdparanoia ? null, cddaSupport ? true
, extraBuildInputs ? []
, extraConfigureFlags ? ""
}: }:
assert alsaSupport -> alsa != null; assert alsaSupport -> alsa != null;
@ -12,6 +15,7 @@ assert cacaSupport -> libcaca != null;
assert xineramaSupport -> libXinerama != null; assert xineramaSupport -> libXinerama != null;
assert randrSupport -> libXrandr != null; assert randrSupport -> libXrandr != null;
assert dvdnavSupport -> libdvdnav != null; assert dvdnavSupport -> libdvdnav != null;
assert cddaSupport -> cdparanoia != null;
let let
@ -38,7 +42,10 @@ stdenv.mkDerivation {
(if xineramaSupport then libXinerama else null) (if xineramaSupport then libXinerama else null)
(if randrSupport then libXrandr else null) (if randrSupport then libXrandr else null)
(if dvdnavSupport then libdvdnav else null) (if dvdnavSupport then libdvdnav else null)
]; (if cddaSupport then cdparanoia else null)
]
++ extraBuildInputs
;
configureFlags = " configureFlags = "
${if cacaSupport then "--enable-caca" else "--disable-caca"} ${if cacaSupport then "--enable-caca" else "--disable-caca"}
@ -48,7 +55,9 @@ stdenv.mkDerivation {
--enable-runtime-cpudetection --enable-runtime-cpudetection
--enable-x11 --with-extraincdir=${libX11}/include --enable-x11 --with-extraincdir=${libX11}/include
--disable-xanim --disable-xanim
"; "
+ extraConfigureFlags
;
NIX_LDFLAGS = "-lX11 -lXext " # !!! hack, necessary to get libX11/Xext in the RPATH NIX_LDFLAGS = "-lX11 -lXext " # !!! hack, necessary to get libX11/Xext in the RPATH
+ (if dvdnavSupport then "-ldvdnav" else ""); + (if dvdnavSupport then "-ldvdnav" else "");
@ -66,6 +75,7 @@ stdenv.mkDerivation {
meta = { meta = {
description = "A movie player that supports many video formats"; description = "A movie player that supports many video formats";
homepage = "GPL"; homepage = "http://mplayerhq.hu";
license = "GPL";
}; };
} }

View File

@ -23,6 +23,15 @@ rec {
else (innerSumArgs f (x // y))); else (innerSumArgs f (x // y)));
sumArgs = f : innerSumArgs f {}; sumArgs = f : innerSumArgs f {};
# Advanced sumArgs version. Hm, twice as slow, I'm afraid.
# composedArgs id (x:x//{a="b";}) (x:x//{b=x.a + "c";}) null;
# {a="b" ; b="bc";};
innerComposedArgs = f : x : y : (if y==null then (f x)
else (if (builtins.isAttrs y) then
(innerComposedArgs f (x//y))
else (innerComposedArgs f (y x))));
composedArgs = f: innerComposedArgs f {};
# example a = pairMap (x : y : x + y) ["a" "b" "c" "d"]; # example a = pairMap (x : y : x + y) ["a" "b" "c" "d"];
# result: ["ab" "cd"] # result: ["ab" "cd"]
innerPairMap = acc: f: l: innerPairMap = acc: f: l:

View File

@ -5259,8 +5259,9 @@ rec {
inherit stdenv fetchurl libao libmad libid3tag zlib; inherit stdenv fetchurl libao libmad libid3tag zlib;
}; };
MPlayer = import ../applications/video/MPlayer { MPlayerFun = lib.composedArgs (import ../applications/video/MPlayer) {
inherit fetchurl stdenv freetype x11 zlib libtheora libcaca freefont_ttf libdvdnav; inherit fetchurl stdenv freetype x11 zlib libtheora libcaca freefont_ttf libdvdnav
cdparanoia;
inherit (xlibs) libX11 libXv libXinerama libXrandr; inherit (xlibs) libX11 libXv libXinerama libXrandr;
alsaSupport = true; alsaSupport = true;
alsa = alsaLib; alsa = alsaLib;
@ -5268,8 +5269,11 @@ rec {
cacaSupport = true; cacaSupport = true;
xineramaSupport = true; xineramaSupport = true;
randrSupport = true; randrSupport = true;
cddaSupport = true;
}; };
MPlayer = MPlayerFun null;
# commented out because it's using the new configuration style proposal which is unstable # commented out because it's using the new configuration style proposal which is unstable
# should be the same as the nix expression above except support for esound :) # should be the same as the nix expression above except support for esound :)
/* /*