summary refs log tree commit diff
path: root/pkgs/development/libraries/lame
diff options
context:
space:
mode:
authorWilliam A. Kennington III <william@wkennington.com>2015-05-22 13:33:08 -0700
committerWilliam A. Kennington III <william@wkennington.com>2015-05-22 13:54:52 -0700
commit3117e0c897522ec8431572de12449f676cc8c8be (patch)
treec3b55ca870549d87bb52e9b0e173ff1bd3b902df /pkgs/development/libraries/lame
parent25a148fa196b944b3f134527da87e43d88c066f9 (diff)
downloadnixlib-3117e0c897522ec8431572de12449f676cc8c8be.tar
nixlib-3117e0c897522ec8431572de12449f676cc8c8be.tar.gz
nixlib-3117e0c897522ec8431572de12449f676cc8c8be.tar.bz2
nixlib-3117e0c897522ec8431572de12449f676cc8c8be.tar.lz
nixlib-3117e0c897522ec8431572de12449f676cc8c8be.tar.xz
nixlib-3117e0c897522ec8431572de12449f676cc8c8be.tar.zst
nixlib-3117e0c897522ec8431572de12449f676cc8c8be.zip
Refactor mkFlag out of old packages
Diffstat (limited to 'pkgs/development/libraries/lame')
-rw-r--r--pkgs/development/libraries/lame/default.nix25
1 files changed, 13 insertions, 12 deletions
diff --git a/pkgs/development/libraries/lame/default.nix b/pkgs/development/libraries/lame/default.nix
index 562e292791ab..4a61d188ef69 100644
--- a/pkgs/development/libraries/lame/default.nix
+++ b/pkgs/development/libraries/lame/default.nix
@@ -17,7 +17,7 @@ assert sndfileFileIOSupport -> (libsndfile != null);
 #assert mp3xSupport -> (analyzerHooksSupport && (gtk1 != null));
 
 let
-  mkFlag = optSet: flag: if optSet then "--enable-${flag}" else "--disable-${flag}";
+  sndfileFileIO = if sndfileFileIOSupport then "sndfile" else "lame";
 in
 
 with stdenv.lib;
@@ -39,17 +39,18 @@ stdenv.mkDerivation rec {
     ++ optional sndfileFileIOSupport libsndfile;
 
   configureFlags = [
-    (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 "")
+    (mkEnable nasmSupport          "nasm"              null)
+    (mkEnable cpmlSupport          "cpml"              null)
+    #(mkEnable efenceSupport        "efence"            null)
+    (mkWith   true                 "fileio"            sndfileFileIO)
+    (mkEnable analyzerHooksSupport "analyzer-hooks"    null)
+    (mkEnable decoderSupport       "decoder"           null)
+    (mkEnable frontendSupport      "frontend"          null)
+    (mkEnable frontendSupport      "dynamic-frontends" null)
+    #(mkEnable mp3xSupport          "mp3x"              null)
+    (mkEnable mp3rtpSupport        "mp3rtp"            null)
+  ] ++ optional debugSupport [
+    (mkEnable true                 "debug"             "alot")
   ];
 
   meta = {