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)
15 stdenv.mkDerivation rec {
20 url = "mirror://sourceforge/lame/${pname}-${version}.tar.gz";
21 sha256 = "07nsn5sy3a8xbmw1bidxnsj5fj6kg9ai04icmqw40ybkp353dznx";
24 outputs = [ "out" "lib" "doc" ]; # a small single header
27 nativeBuildInputs = [ ]
28 ++ optional nasmSupport nasm;
31 #++ optional efenceSupport libefence
32 #++ optional mp3xSupport gtk1
33 ++ optional sndfileFileIOSupport libsndfile;
36 (enableFeature nasmSupport "nasm")
37 (enableFeature cpmlSupport "cpml")
38 #(enableFeature efenceSupport "efence")
39 (if sndfileFileIOSupport then "--with-fileio=sndfile" else "--with-fileio=lame")
40 (enableFeature analyzerHooksSupport "analyzer-hooks")
41 (enableFeature decoderSupport "decoder")
42 (enableFeature frontendSupport "frontend")
43 (enableFeature frontendSupport "dynamic-frontends")
44 #(enableFeature mp3xSupport "mp3x")
45 (enableFeature mp3rtpSupport "mp3rtp")
46 (if debugSupport then "--enable-debug=alot" else "")
50 # Prevent a build failure for 3.100 due to using outdated symbol list
51 # https://hydrogenaud.io/index.php/topic,114777.msg946373.html#msg946373
52 sed -i '/lame_init_old/d' include/libmp3lame.sym
56 description = "A high quality MPEG Audio Layer III (MP3) encoder";
57 homepage = "http://lame.sourceforge.net";
58 license = licenses.lgpl2;
59 maintainers = with maintainers; [ codyopel ];
60 platforms = platforms.all;