2015-02-14 21:41:15 +00:00
|
|
|
{ stdenv, fetchurl
|
|
|
|
, nasmSupport ? true, nasm ? null # Assembly optimizations
|
|
|
|
, cpmlSupport ? true # Compaq's fast math library
|
|
|
|
#, efenceSupport ? false, libefence ? null # Use ElectricFence for malloc debugging
|
|
|
|
, sndfileFileIOSupport ? false, libsndfile ? null # Use libsndfile, instead of lame's internal routines
|
|
|
|
, analyzerHooksSupport ? true # Use analyzer hooks
|
|
|
|
, decoderSupport ? true # mpg123 decoder
|
|
|
|
, frontendSupport ? true # Build the lame executable
|
|
|
|
#, mp3xSupport ? false, gtk1 ? null # Build GTK frame analyzer
|
|
|
|
, mp3rtpSupport ? false # Build mp3rtp
|
|
|
|
, debugSupport ? false # Debugging (disables optimizations)
|
|
|
|
}:
|
2005-01-19 22:12:34 +00:00
|
|
|
|
2015-02-14 21:41:15 +00:00
|
|
|
assert nasmSupport -> (nasm != null);
|
|
|
|
#assert efenceSupport -> (libefence != null);
|
|
|
|
assert sndfileFileIOSupport -> (libsndfile != null);
|
|
|
|
#assert mp3xSupport -> (analyzerHooksSupport && (gtk1 != null));
|
|
|
|
|
|
|
|
let
|
2015-06-01 19:29:47 +00:00
|
|
|
mkFlag = optSet: flag: if optSet then "--enable-${flag}" else "--disable-${flag}";
|
2015-02-14 21:41:15 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
with stdenv.lib;
|
2010-05-27 20:49:04 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2015-02-14 21:41:15 +00:00
|
|
|
name = "lame-${version}";
|
|
|
|
version = "3.99.5";
|
|
|
|
|
2005-01-19 22:12:34 +00:00
|
|
|
src = fetchurl {
|
2010-05-27 20:49:04 +00:00
|
|
|
url = "mirror://sourceforge/lame/${name}.tar.gz";
|
2013-03-30 17:10:15 +00:00
|
|
|
sha256 = "1zr3kadv35ii6liia0bpfgxpag27xcivp571ybckpbz4b10nnd14";
|
2005-01-19 22:12:34 +00:00
|
|
|
};
|
2009-10-19 22:05:34 +00:00
|
|
|
|
2015-06-04 13:32:19 +00:00
|
|
|
patches = [ ./gcc-4.9.patch ];
|
|
|
|
|
2015-10-07 21:20:28 +00:00
|
|
|
outputs = [ "out" "lib" "doc" ]; # a small single header
|
|
|
|
outputMan = "out";
|
|
|
|
|
2015-02-14 21:41:15 +00:00
|
|
|
nativeBuildInputs = [ ]
|
|
|
|
++ optional nasmSupport nasm;
|
2010-05-05 20:38:13 +00:00
|
|
|
|
2015-02-14 21:41:15 +00:00
|
|
|
buildInputs = [ ]
|
|
|
|
#++ optional efenceSupport libefence
|
|
|
|
#++ optional mp3xSupport gtk1
|
|
|
|
++ optional sndfileFileIOSupport libsndfile;
|
2010-05-05 20:38:13 +00:00
|
|
|
|
2015-02-14 21:41:15 +00:00
|
|
|
configureFlags = [
|
2015-06-01 19:29:47 +00:00
|
|
|
(mkFlag nasmSupport "nasm")
|
|
|
|
(mkFlag cpmlSupport "cpml")
|
|
|
|
#(mkFlag efenceSupport "efence")
|
|
|
|
(if sndfileFileIOSupport then "--with-fileio=sndfile" else "--with-fileio=lame")
|
|
|
|
(mkFlag analyzerHooksSupport "analyzer-hooks")
|
|
|
|
(mkFlag decoderSupport "decoder")
|
|
|
|
(mkFlag frontendSupport "frontend")
|
|
|
|
(mkFlag frontendSupport "dynamic-frontends")
|
|
|
|
#(mkFlag mp3xSupport "mp3x")
|
|
|
|
(mkFlag mp3rtpSupport "mp3rtp")
|
|
|
|
(if debugSupport then "--enable-debug=alot" else "")
|
2015-02-14 21:41:15 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = {
|
2015-04-30 15:05:14 +00:00
|
|
|
description = "A high quality MPEG Audio Layer III (MP3) encoder";
|
2015-02-14 21:41:15 +00:00
|
|
|
homepage = http://lame.sourceforge.net;
|
2015-02-15 00:06:38 +00:00
|
|
|
license = licenses.lgpl2;
|
2015-02-14 21:41:15 +00:00
|
|
|
maintainers = with maintainers; [ codyopel ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
2005-01-19 22:12:34 +00:00
|
|
|
}
|