1 { lib, stdenv, fetchurl
2 , nasmSupport ? true, nasm # Assembly optimizations
3 , cpmlSupport ? true # Compaq's fast math library
4 #, efenceSupport ? false, libefence # Use ElectricFence for malloc debugging
5 , sndfileFileIOSupport ? false, libsndfile # Use libsndfile, instead of lame's internal routines
6 , analyzerHooksSupport ? true # Use analyzer hooks
7 , decoderSupport ? true # mpg123 decoder
8 , frontendSupport ? true # Build the lame executable
9 #, mp3xSupport ? false, gtk1 # Build GTK frame analyzer
10 , mp3rtpSupport ? false # Build mp3rtp
11 , debugSupport ? false # Debugging (disables optimizations)
14 stdenv.mkDerivation rec {
19 url = "mirror://sourceforge/lame/${pname}-${version}.tar.gz";
20 sha256 = "07nsn5sy3a8xbmw1bidxnsj5fj6kg9ai04icmqw40ybkp353dznx";
23 outputs = [ "out" "lib" "doc" ]; # a small single header
26 nativeBuildInputs = [ ]
27 ++ lib.optional nasmSupport nasm;
30 #++ optional efenceSupport libefence
31 #++ optional mp3xSupport gtk1
32 ++ lib.optional sndfileFileIOSupport libsndfile;
35 (lib.enableFeature nasmSupport "nasm")
36 (lib.enableFeature cpmlSupport "cpml")
37 #(enableFeature efenceSupport "efence")
38 (if sndfileFileIOSupport then "--with-fileio=sndfile" else "--with-fileio=lame")
39 (lib.enableFeature analyzerHooksSupport "analyzer-hooks")
40 (lib.enableFeature decoderSupport "decoder")
41 (lib.enableFeature frontendSupport "frontend")
42 (lib.enableFeature frontendSupport "dynamic-frontends")
43 #(enableFeature mp3xSupport "mp3x")
44 (lib.enableFeature mp3rtpSupport "mp3rtp")
45 (lib.optionalString debugSupport "--enable-debug=alot")
49 # Prevent a build failure for 3.100 due to using outdated symbol list
50 # https://hydrogenaud.io/index.php/topic,114777.msg946373.html#msg946373
51 sed -i '/lame_init_old/d' include/libmp3lame.sym
55 description = "High quality MPEG Audio Layer III (MP3) encoder";
56 homepage = "http://lame.sourceforge.net";
57 license = licenses.lgpl2;
58 maintainers = with maintainers; [ codyopel ];
59 platforms = platforms.all;