2015-02-14 22:41:15 +01: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 23:12:34 +01:00
|
|
|
|
2015-02-14 22:41:15 +01:00
|
|
|
assert nasmSupport -> (nasm != null);
|
|
|
|
#assert efenceSupport -> (libefence != null);
|
|
|
|
assert sndfileFileIOSupport -> (libsndfile != null);
|
|
|
|
#assert mp3xSupport -> (analyzerHooksSupport && (gtk1 != null));
|
|
|
|
|
|
|
|
let
|
2015-06-01 21:29:47 +02:00
|
|
|
mkFlag = optSet: flag: if optSet then "--enable-${flag}" else "--disable-${flag}";
|
2015-02-14 22:41:15 +01:00
|
|
|
in
|
|
|
|
|
|
|
|
with stdenv.lib;
|
2010-05-27 22:49:04 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "lame";
|
2017-10-24 11:05:14 +02:00
|
|
|
version = "3.100";
|
2015-02-14 22:41:15 +01:00
|
|
|
|
2005-01-19 23:12:34 +01:00
|
|
|
src = fetchurl {
|
2019-08-15 14:41:18 +02:00
|
|
|
url = "mirror://sourceforge/lame/${pname}-${version}.tar.gz";
|
2017-10-24 11:05:14 +02:00
|
|
|
sha256 = "07nsn5sy3a8xbmw1bidxnsj5fj6kg9ai04icmqw40ybkp353dznx";
|
2005-01-19 23:12:34 +01:00
|
|
|
};
|
2009-10-20 00:05:34 +02:00
|
|
|
|
2015-10-07 23:20:28 +02:00
|
|
|
outputs = [ "out" "lib" "doc" ]; # a small single header
|
|
|
|
outputMan = "out";
|
|
|
|
|
2015-02-14 22:41:15 +01:00
|
|
|
nativeBuildInputs = [ ]
|
|
|
|
++ optional nasmSupport nasm;
|
2010-05-05 22:38:13 +02:00
|
|
|
|
2015-02-14 22:41:15 +01:00
|
|
|
buildInputs = [ ]
|
|
|
|
#++ optional efenceSupport libefence
|
|
|
|
#++ optional mp3xSupport gtk1
|
|
|
|
++ optional sndfileFileIOSupport libsndfile;
|
2010-05-05 22:38:13 +02:00
|
|
|
|
2015-02-14 22:41:15 +01:00
|
|
|
configureFlags = [
|
2015-06-01 21:29:47 +02: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 22:41:15 +01:00
|
|
|
];
|
|
|
|
|
2017-11-03 06:32:41 +01:00
|
|
|
preConfigure = ''
|
|
|
|
# Prevent a build failure for 3.100 due to using outdated symbol list
|
|
|
|
# https://hydrogenaud.io/index.php/topic,114777.msg946373.html#msg946373
|
|
|
|
sed -i '/lame_init_old/d' include/libmp3lame.sym
|
|
|
|
'';
|
|
|
|
|
2015-02-14 22:41:15 +01:00
|
|
|
meta = {
|
2015-04-30 17:05:14 +02:00
|
|
|
description = "A high quality MPEG Audio Layer III (MP3) encoder";
|
2015-02-14 22:41:15 +01:00
|
|
|
homepage = http://lame.sourceforge.net;
|
2015-02-15 01:06:38 +01:00
|
|
|
license = licenses.lgpl2;
|
2017-10-24 11:05:14 +02:00
|
|
|
maintainers = with maintainers; [ codyopel fpletz ];
|
2015-02-14 22:41:15 +01:00
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
2005-01-19 23:12:34 +01:00
|
|
|
}
|