1{stdenv, fetchurl, unzip}:
2
3stdenv.mkDerivation {
4 # The 'src' 7.0.0.3 expects amrwb 700, but there is only 710 available now,
5 # so I guess in 3gpp they updated to 7.1.0, but amrwb did not update the libraries.
6 # I guess amrwb uses the first version numbers to match those of 3gpp,
7 # so I set the name to 7.1.0.3 in this case
8 name = "amrwb-7.1.0.3";
9
10 srcAmr = fetchurl {
11 url = http://www.3gpp.org/ftp/Specs/latest/Rel-7/26_series/26204-710.zip;
12 sha256 = "1wnx72m20y8bdlyndyy8rskr0hi4llk1h1hcr34awxfmi9l4922i";
13 };
14
15 src = fetchurl {
16 url = http://ftp.penguin.cz/pub/users/utx/amr/amrwb-7.0.0.3.tar.bz2;
17 sha256 = "0nn94i3gw3d5fgks43wdhshdlhpd4rcrzj46f2vsby0viwkxxp8z";
18 };
19
20 buildInputs = [ unzip ];
21
22 patchPhase = ''
23 sed -i s/26204-700/26204-710/g Makefile.am Makefile.in configure configure.ac \
24 prepare_sources.sh.in
25 '';
26
27 configureFlags = [ "--cache-file=config.cache" "--with-downloader=true" ];
28
29 postConfigure = ''
30 cp $srcAmr 26204-710.zip
31 '';
32
33 meta = {
34 homepage = http://www.penguin.cz/~utx/amr;
35 description = "AMR Wide-Band Codec";
36 # The wrapper code is free, but not the libraries from 3gpp.
37 # It's a source code reference implementation with patents and licenses on
38 # some countries, not redistributable.
39 license = stdenv.lib.licenses.unfree;
40 };
41}