summary refs log tree commit diff
path: root/pkgs/applications/misc/audio/sox/default.nix
blob: 50aa92f8d293b7f18dd28d674ef199c6efda9b05 (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
45
46
47
48
49
50
51
52
53
{ composableDerivation, lib, fetchurl, alsaLib, libao, lame, libmad }:

let inherit (composableDerivation) edf; in

composableDerivation.composableDerivation {} {
  name = "sox-14.3.0";

  src = fetchurl {
    url = mirror://sourceforge/sox/sox-14.3.0.tar.gz;
    sha256 = "15r39dq9nlwrypm0vpxmbxyqqv0bd6284djbi1fdfrlkjhf43gws";
  };

  flags =
    # are these options of interest? We'll see
    #--disable-fftw          disable usage of FFTW
    #--enable-debug          enable debugging
    #--disable-cpu-clip      disable tricky cpu specific clipper
    edf { name = "alsa"; enable = { buildInputs = [alsaLib]; }; }
    // edf { name = "libao"; enable = { buildInputs = [libao]; }; }
    // edf { name = "oss"; }
    // edf { name = "sun_audio"; }
    // edf { name = "dl-lame"; enable.buildInputs = [ lame ]; } # use shared library
    // edf { name = "lame";    enable.buildInputs = [ lame ]; }
    // edf { name = "dl-mad"; enable.buildInputs = [ libmad ]; } # use shared library
    // edf { name = "mad";    enable.buildInputs =[ libmad ]; }
    ;

  cfg = {
    ossSupport = false;
    sun_audioSupport = false;
  } // lib.listToAttrs
    [ { name = "dl-lameSupport"; value = true; }
      { name = "dl-madSupport"; value = true; }
    ];

  configureFlags = ["-enable-dl-lame"];

  optionals = [ "libsndfile" "libogg" "flac" "ffmpeg" "libmad" "lame"
                 /* "amr-wb" "amr-nb" */
                "libsamplerate" /* "ladspa" */ ];

  meta = {
    description = "Sample Rate Converter for audio";
    homepage = http://www.mega-nerd.com/SRC/index.html;
    maintainers = [lib.maintainers.marcweber];
    # you can choose one of the following licenses:
    license = [
      "GPL"
      # http://www.mega-nerd.com/SRC/libsamplerate-cul.pdf
      "libsamplerate Commercial Use License"
    ];
  };
}