git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #6344 from codyopel/lamebr

lame: refactor & add optionals

commitc4dd28902f8944edd002ad2c58ad9ea69b687c4d authorWilliam A. Kennington III <william@wkennington.com> dateSat 14 Feb 2015, 13:55 (12 years ago) parent795681dd62d675
1 file changed+52−7
pkgs/applications/audio/lame/default.nix+52−7
pkgs/applications/audio/lame/default.nix+52−7
@@ -1,17 +1,62 @@
1−{stdenv, fetchurl, nasm}:
1+{ stdenv, fetchurl
2+, nasmSupport ? true, nasm ? null # Assembly optimizations
3+, cpmlSupport ? true # Compaq's fast math library
4+#, efenceSupport ? false, libefence ? null # Use ElectricFence for malloc debugging
5+, sndfileFileIOSupport ? false, libsndfile ? null # 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 ? null # Build GTK frame analyzer
10+, mp3rtpSupport ? false # Build mp3rtp
11+, debugSupport ? false # Debugging (disables optimizations)
12+}:
213
14+assert nasmSupport -> (nasm != null);
15+#assert efenceSupport -> (libefence != null);
16+assert sndfileFileIOSupport -> (libsndfile != null);
17+#assert mp3xSupport -> (analyzerHooksSupport && (gtk1 != null));
18+
19+let
20+ mkFlag = optSet: flag: if optSet then "--enable-${flag}" else "--disable-${flag}";
21+in
22+
23+with stdenv.lib;
324stdenv.mkDerivation rec {
4− name = "lame-3.99.5";
25+ name = "lame-${version}";
26+ version = "3.99.5";
27+
528 src = fetchurl {
629 url = "mirror://sourceforge/lame/${name}.tar.gz";
730 sha256 = "1zr3kadv35ii6liia0bpfgxpag27xcivp571ybckpbz4b10nnd14";
831 };
932
10− buildInputs = [ nasm ];
33+ nativeBuildInputs = [ ]
34+ ++ optional nasmSupport nasm;
1135
12− configureFlags = [ "--enable-nasm" ];
36+ buildInputs = [ ]
37+ #++ optional efenceSupport libefence
38+ #++ optional mp3xSupport gtk1
39+ ++ optional sndfileFileIOSupport libsndfile;
1340
14− # Either disable static, or fix the rpath of 'lame' for it to point
15− # properly to the libmp3lame shared object.
16− dontDisableStatic = true;
41+ configureFlags = [
42+ (mkFlag nasmSupport "nasm")
43+ (mkFlag cpmlSupport "cpml")
44+ #(mkFlag efenceSupport "efence")
45+ (if sndfileFileIOSupport then "--with-fileio=sndfile" else "--with-fileio=lame")
46+ (mkFlag analyzerHooksSupport "analyzer-hooks")
47+ (mkFlag decoderSupport "decoder")
48+ (mkFlag frontendSupport "frontend")
49+ (mkFlag frontendSupport "dynamic-frontends")
50+ #(mkFlag mp3xSupport "mp3x")
51+ (mkFlag mp3rtpSupport "mp3rtp")
52+ (if debugSupport then "--enable-debug=alot" else "")
53+ ];
54+
55+ meta = {
56+ description = "LAME is a high quality MPEG Audio Layer III (MP3) encoder";
57+ homepage = http://lame.sourceforge.net;
58+ license = licenses.lgpl;
59+ maintainers = with maintainers; [ codyopel ];
60+ platforms = platforms.all;
61+ };
1762}