2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv, fetchurl
|
2022-05-09 21:09:05 +00:00
|
|
|
, nasmSupport ? true, nasm # Assembly optimizations
|
2015-02-14 21:41:15 +00:00
|
|
|
, cpmlSupport ? true # Compaq's fast math library
|
2022-05-09 21:09:05 +00:00
|
|
|
#, efenceSupport ? false, libefence # Use ElectricFence for malloc debugging
|
|
|
|
, sndfileFileIOSupport ? false, libsndfile # Use libsndfile, instead of lame's internal routines
|
2015-02-14 21:41:15 +00:00
|
|
|
, analyzerHooksSupport ? true # Use analyzer hooks
|
|
|
|
, decoderSupport ? true # mpg123 decoder
|
|
|
|
, frontendSupport ? true # Build the lame executable
|
2022-05-09 21:09:05 +00:00
|
|
|
#, mp3xSupport ? false, gtk1 # Build GTK frame analyzer
|
2015-02-14 21:41:15 +00:00
|
|
|
, mp3rtpSupport ? false # Build mp3rtp
|
|
|
|
, debugSupport ? false # Debugging (disables optimizations)
|
|
|
|
}:
|
2005-01-19 22:12:34 +00:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
with lib;
|
2010-05-27 20:49:04 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "lame";
|
2017-10-24 09:05:14 +00:00
|
|
|
version = "3.100";
|
2015-02-14 21:41:15 +00:00
|
|
|
|
2005-01-19 22:12:34 +00:00
|
|
|
src = fetchurl {
|
2019-08-15 12:41:18 +00:00
|
|
|
url = "mirror://sourceforge/lame/${pname}-${version}.tar.gz";
|
2017-10-24 09:05:14 +00:00
|
|
|
sha256 = "07nsn5sy3a8xbmw1bidxnsj5fj6kg9ai04icmqw40ybkp353dznx";
|
2005-01-19 22:12:34 +00:00
|
|
|
};
|
2009-10-19 22:05:34 +00:00
|
|
|
|
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 = [
|
2022-06-29 19:32:20 +00:00
|
|
|
(enableFeature nasmSupport "nasm")
|
|
|
|
(enableFeature cpmlSupport "cpml")
|
|
|
|
#(enableFeature efenceSupport "efence")
|
2015-06-01 19:29:47 +00:00
|
|
|
(if sndfileFileIOSupport then "--with-fileio=sndfile" else "--with-fileio=lame")
|
2022-06-29 19:32:20 +00:00
|
|
|
(enableFeature analyzerHooksSupport "analyzer-hooks")
|
|
|
|
(enableFeature decoderSupport "decoder")
|
|
|
|
(enableFeature frontendSupport "frontend")
|
|
|
|
(enableFeature frontendSupport "dynamic-frontends")
|
|
|
|
#(enableFeature mp3xSupport "mp3x")
|
|
|
|
(enableFeature mp3rtpSupport "mp3rtp")
|
2015-06-01 19:29:47 +00:00
|
|
|
(if debugSupport then "--enable-debug=alot" else "")
|
2015-02-14 21:41:15 +00:00
|
|
|
];
|
|
|
|
|
2017-11-03 05:32:41 +00: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 21:41:15 +00:00
|
|
|
meta = {
|
2015-04-30 15:05:14 +00:00
|
|
|
description = "A high quality MPEG Audio Layer III (MP3) encoder";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://lame.sourceforge.net";
|
2015-02-15 00:06:38 +00:00
|
|
|
license = licenses.lgpl2;
|
2022-08-03 12:13:56 +00:00
|
|
|
maintainers = with maintainers; [ codyopel ];
|
2015-02-14 21:41:15 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
2005-01-19 22:12:34 +00:00
|
|
|
}
|