From 003a6d10b55fb0b68db789410a39b073361635d7 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Thu, 6 Mar 2008 09:34:36 +0000 Subject: [PATCH] Added CDDA support to MPlayer svn path=/nixpkgs/trunk/; revision=10978 --- pkgs/applications/video/MPlayer/default.nix | 16 +++++++++++++--- pkgs/lib/default.nix | 9 +++++++++ pkgs/top-level/all-packages.nix | 8 ++++++-- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/video/MPlayer/default.nix b/pkgs/applications/video/MPlayer/default.nix index 9b3065ad08ab..78ade5c23469 100644 --- a/pkgs/applications/video/MPlayer/default.nix +++ b/pkgs/applications/video/MPlayer/default.nix @@ -3,6 +3,9 @@ , stdenv, fetchurl, x11, freetype, freefont_ttf, zlib , alsa ? null, libX11, libXv ? null, libtheora ? null, libcaca ? null , libXinerama ? null, libXrandr ? null, libdvdnav ? null +, cdparanoia ? null, cddaSupport ? true +, extraBuildInputs ? [] +, extraConfigureFlags ? "" }: assert alsaSupport -> alsa != null; @@ -12,6 +15,7 @@ assert cacaSupport -> libcaca != null; assert xineramaSupport -> libXinerama != null; assert randrSupport -> libXrandr != null; assert dvdnavSupport -> libdvdnav != null; +assert cddaSupport -> cdparanoia != null; let @@ -38,7 +42,10 @@ stdenv.mkDerivation { (if xineramaSupport then libXinerama else null) (if randrSupport then libXrandr else null) (if dvdnavSupport then libdvdnav else null) - ]; + (if cddaSupport then cdparanoia else null) + ] + ++ extraBuildInputs + ; configureFlags = " ${if cacaSupport then "--enable-caca" else "--disable-caca"} @@ -48,7 +55,9 @@ stdenv.mkDerivation { --enable-runtime-cpudetection --enable-x11 --with-extraincdir=${libX11}/include --disable-xanim - "; + " + + extraConfigureFlags + ; NIX_LDFLAGS = "-lX11 -lXext " # !!! hack, necessary to get libX11/Xext in the RPATH + (if dvdnavSupport then "-ldvdnav" else ""); @@ -66,6 +75,7 @@ stdenv.mkDerivation { meta = { description = "A movie player that supports many video formats"; - homepage = "GPL"; + homepage = "http://mplayerhq.hu"; + license = "GPL"; }; } diff --git a/pkgs/lib/default.nix b/pkgs/lib/default.nix index 20a441b5b433..eaeea3af8c1c 100644 --- a/pkgs/lib/default.nix +++ b/pkgs/lib/default.nix @@ -23,6 +23,15 @@ rec { else (innerSumArgs f (x // y))); 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"]; # result: ["ab" "cd"] innerPairMap = acc: f: l: diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 91fecb5159f9..a94fa85c27a8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5259,8 +5259,9 @@ rec { inherit stdenv fetchurl libao libmad libid3tag zlib; }; - MPlayer = import ../applications/video/MPlayer { - inherit fetchurl stdenv freetype x11 zlib libtheora libcaca freefont_ttf libdvdnav; + MPlayerFun = lib.composedArgs (import ../applications/video/MPlayer) { + inherit fetchurl stdenv freetype x11 zlib libtheora libcaca freefont_ttf libdvdnav + cdparanoia; inherit (xlibs) libX11 libXv libXinerama libXrandr; alsaSupport = true; alsa = alsaLib; @@ -5268,8 +5269,11 @@ rec { cacaSupport = true; xineramaSupport = true; randrSupport = true; + cddaSupport = true; }; + MPlayer = MPlayerFun null; + # 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 :) /*