summary refs log tree commit diff
path: root/pkgs/applications/misc/audio/sox/default.nix
blob: 07dbde2939bea237f6b796f8b0ca3f71e2836067 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{ lib, stdenv, fetchurl
, enableAlsa ? true, alsaLib ? null
, enableLibao ? true, libao ? null
, enableLame ? false, lame ? null
, enableLibmad ? true, libmad ? null
, enableLibogg ? true, libogg ? null, libvorbis ? null
, enableFLAC ? true, flac ? null
, enablePNG ? true, libpng ? null
}:

with stdenv.lib;

stdenv.mkDerivation rec {
  name = "sox-14.4.1";

  src = fetchurl {
    url = "mirror://sourceforge/sox/${name}.tar.gz";
    sha256 = "16x8gykfjdhxg0kdxwzcwgwpm5caa08y2mx18siqsq0ywmpjr34s";
  };

  patches = [
    # Patches for CVE-2014-8145, found via RedHat bug 1174792.  It was not
    # clear whether these address a NULL deref and a division by zero.
    ./0001-Check-for-minimum-size-sphere-headers.patch
    ./0002-More-checks-for-invalid-MS-ADPCM-blocks.patch
  ];

  buildInputs =
    optional (enableAlsa && stdenv.isLinux) alsaLib ++
    optional enableLibao libao ++
    optional enableLame lame ++
    optional enableLibmad libmad ++
    optionals enableLibogg [ libogg libvorbis ] ++
    optional enableFLAC flac ++
    optional enablePNG libpng;

  meta = {
    description = "Sample Rate Converter for audio";
    homepage = http://sox.sourceforge.net/;
    maintainers = [ lib.maintainers.marcweber lib.maintainers.shlevy ];
    license = lib.licenses.gpl2Plus;
    platforms = lib.platforms.linux ++ lib.platforms.darwin;
  };
}