summary refs log tree commit diff
diff options
context:
space:
mode:
authorLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2009-10-04 21:31:34 +0000
committerLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2009-10-04 21:31:34 +0000
commit954a8d0cdc239044a9fa8bad813b777e4f3296a7 (patch)
tree7251155cd0e074bba10b1fe22431c4b189043275
parentad30d22e827045d2ccd862c1d5ef5ca076ce4184 (diff)
downloadnixpkgs-954a8d0cdc239044a9fa8bad813b777e4f3296a7.tar
nixpkgs-954a8d0cdc239044a9fa8bad813b777e4f3296a7.tar.gz
nixpkgs-954a8d0cdc239044a9fa8bad813b777e4f3296a7.tar.bz2
nixpkgs-954a8d0cdc239044a9fa8bad813b777e4f3296a7.tar.lz
nixpkgs-954a8d0cdc239044a9fa8bad813b777e4f3296a7.tar.xz
nixpkgs-954a8d0cdc239044a9fa8bad813b777e4f3296a7.tar.zst
nixpkgs-954a8d0cdc239044a9fa8bad813b777e4f3296a7.zip
Adding amr support in mplayer. That should be enabled by the user, because those libraries are not redistributable.
I don't know if the 'unfree' in the amr libraries will stop mplayer being built without its support. We would have to write the all-packages MPlayer expression different, in this case.

svn path=/nixpkgs/trunk/; revision=17635
-rw-r--r--pkgs/applications/video/MPlayer/default.nix22
-rw-r--r--pkgs/development/libraries/amrnb/default.nix31
-rw-r--r--pkgs/development/libraries/amrwb/default.nix41
-rw-r--r--pkgs/top-level/all-packages.nix11
4 files changed, 102 insertions, 3 deletions
diff --git a/pkgs/applications/video/MPlayer/default.nix b/pkgs/applications/video/MPlayer/default.nix
index 415769cc9ce..0c1e9548c8d 100644
--- a/pkgs/applications/video/MPlayer/default.nix
+++ b/pkgs/applications/video/MPlayer/default.nix
@@ -4,7 +4,8 @@
 , alsa ? null, libX11, libXv ? null, libtheora ? null, libcaca ? null
 , libXinerama ? null, libXrandr ? null, libdvdnav ? null
 , cdparanoia ? null, cddaSupport ? true
-, mesa, pkgconfig
+, amrnb ? null, amrwb ? null, amrSupport ? false
+, mesa, pkgconfig, unzip
 }:
 
 assert alsaSupport -> alsa != null;
@@ -15,6 +16,7 @@ assert xineramaSupport -> libXinerama != null;
 assert randrSupport -> libXrandr != null;
 assert dvdnavSupport -> libdvdnav != null;
 assert cddaSupport -> cdparanoia != null;
+assert amrSupport -> (amrnb != null && amrwb != null);
 
 let
 
@@ -26,6 +28,21 @@ let
     inherit stdenv fetchurl;
   };
 
+  srcAmr = fetchurl {
+    url = http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-530.zip;
+    sha256 = "1qyla52jjymhcnbidhwc6a1vm4v1wl27mj4ygp3cpn33swcmkgd0";
+  };
+
+  srcAmrFloat = fetchurl {
+    url = http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-540.zip;
+    sha256 = "1d337h3051w7azipsq7nzf4d25csia2snq3qlhw2sj7282ab042z";
+  };
+
+  srcAmrWBFloat = fetchurl {
+    url = http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26204-540.zip;
+    sha256 = "1mb7g3fy5faz26jjbibxvlbb5b81vwmdsldl3kl8hzg14vcrv1q9";
+  };
+
 in
 
 stdenv.mkDerivation {
@@ -46,7 +63,8 @@ stdenv.mkDerivation {
     ++ stdenv.lib.optional xineramaSupport libXinerama
     ++ stdenv.lib.optional randrSupport libXrandr
     ++ stdenv.lib.optionals dvdnavSupport [libdvdnav libdvdnav.libdvdread]
-    ++ stdenv.lib.optional cddaSupport cdparanoia;
+    ++ stdenv.lib.optional cddaSupport cdparanoia
+    ++ stdenv.lib.optionals amrSupport [amrnb amrwb];
 
   configureFlags = ''
     ${if cacaSupport then "--enable-caca" else "--disable-caca"}
diff --git a/pkgs/development/libraries/amrnb/default.nix b/pkgs/development/libraries/amrnb/default.nix
new file mode 100644
index 00000000000..a2ed7393493
--- /dev/null
+++ b/pkgs/development/libraries/amrnb/default.nix
@@ -0,0 +1,31 @@
+{stdenv, fetchurl, unzip}:
+
+stdenv.mkDerivation {
+  name = "amrnb-7.0.0.2";
+  srcAmr = fetchurl {
+    url = http://www.3gpp.org/ftp/Specs/latest/Rel-7/26_series/26104-700.zip;
+    sha256 = "0hgm8dddrqiinjdjxnsw0x899czjlvplq69z4kv8y4zqnrjlwzni";
+  };
+
+  src = fetchurl {
+    url = http://ftp.penguin.cz/pub/users/utx/amr/amrnb-7.0.0.2.tar.bz2;
+    sha256 = "0z4wjr0jml973vd0dvxlmy34daiswy5axlmpvc85k8qcr08i8zaa";
+  };
+
+  buildInputs = [ unzip ];
+
+  configureFlags = [ "--cache-file=config.cache" "--with-downloader=true" ];
+
+  postConfigure = ''
+    cp $srcAmr 26104-700.zip 
+  '';
+
+  meta = {
+    homepage = http://www.penguin.cz/~utx/amr;
+    description = "AMR Narrow-Band Codec";
+    # The wrapper code is free, but not the libraries from 3gpp.
+    # It's a source code reference implementation with patents and licenses on
+    # some countries, not redistributable.
+    license = "unfree";
+  };
+}
diff --git a/pkgs/development/libraries/amrwb/default.nix b/pkgs/development/libraries/amrwb/default.nix
new file mode 100644
index 00000000000..fc8d0415c36
--- /dev/null
+++ b/pkgs/development/libraries/amrwb/default.nix
@@ -0,0 +1,41 @@
+{stdenv, fetchurl, unzip}:
+
+stdenv.mkDerivation {
+  # The 'src' 7.0.0.3 expects amrwb 700, but there is only 710 available now,
+  # so I guess in 3gpp they updated to 7.1.0, but amrwb did not update the libraries.
+  # I guess amrwb uses the first version numbers to match those of 3gpp,
+  # so I set the name to 7.1.0.3 in this case
+  name = "amrwb-7.1.0.3";
+
+  srcAmr = fetchurl {
+    url = http://www.3gpp.org/ftp/Specs/latest/Rel-7/26_series/26204-710.zip;
+    sha256 = "1wnx72m20y8bdlyndyy8rskr0hi4llk1h1hcr34awxfmi9l4922i";
+  };
+
+  src = fetchurl {
+    url = http://ftp.penguin.cz/pub/users/utx/amr/amrwb-7.0.0.3.tar.bz2;
+    sha256 = "0nn94i3gw3d5fgks43wdhshdlhpd4rcrzj46f2vsby0viwkxxp8z";
+  };
+
+  buildInputs = [ unzip ];
+
+  patchPhase = ''
+    sed -i s/26204-700/26204-710/g Makefile.am Makefile.in configure configure.ac \
+      prepare_sources.sh.in
+  '';
+
+  configureFlags = [ "--cache-file=config.cache" "--with-downloader=true" ];
+
+  postConfigure = ''
+    cp $srcAmr 26204-710.zip 
+  '';
+
+  meta = {
+    homepage = http://www.penguin.cz/~utx/amr;
+    description = "AMR Wide-Band Codec";
+    # The wrapper code is free, but not the libraries from 3gpp.
+    # It's a source code reference implementation with patents and licenses on
+    # some countries, not redistributable.
+    license = "unfree";
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 538be82c612..ee411a0e556 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -2876,6 +2876,14 @@ let
     inherit (xlibs) libX11;
   };
 
+  amrnb = import ../development/libraries/amrnb {
+    inherit fetchurl stdenv unzip;
+  };
+
+  amrwb = import ../development/libraries/amrwb {
+    inherit fetchurl stdenv unzip;
+  };
+
   apr = makeOverridable (import ../development/libraries/apr) {
     inherit (pkgsOverriden) fetchurl stdenv;
   };
@@ -7227,7 +7235,7 @@ let
 
   MPlayer = import ../applications/video/MPlayer {
     inherit fetchurl stdenv freetype x11 zlib libtheora libcaca freefont_ttf libdvdnav
-      cdparanoia mesa pkgconfig;
+      cdparanoia mesa pkgconfig unzip amrnb amrwb;
     inherit (xlibs) libX11 libXv libXinerama libXrandr;
     alsaSupport = true;
     alsa = alsaLib;
@@ -7236,6 +7244,7 @@ let
     xineramaSupport = true;
     randrSupport = true;
     cddaSupport = true;
+    amrSupport = getConfig [ "MPlayer" "amr" ] false;
   };
 
   MPlayerPlugin = browser: