summary refs log tree commit diff
path: root/pkgs/lib/strings.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/lib/strings.nix')
-rw-r--r--pkgs/lib/strings.nix7
1 files changed, 6 insertions, 1 deletions
diff --git a/pkgs/lib/strings.nix b/pkgs/lib/strings.nix
index 19d1738182f4..6c4adfaa1a71 100644
--- a/pkgs/lib/strings.nix
+++ b/pkgs/lib/strings.nix
@@ -161,7 +161,7 @@ rec {
   getVersion = drv: (builtins.parseDrvName drv.name).version;
 
 
-  # Extract name with version from URL. Ask for separator which is 
+  # Extract name with version from URL. Ask for separator which is
   # supposed to start extension
   nameFromURL = url: sep: let
     components = splitString "/" url;
@@ -171,4 +171,9 @@ rec {
   assert ! eqStrings name filename;
   name;
 
+
+  # Create an --{enable,disable}-<feat> string that can be passed to
+  # standard GNU Autoconf scripts.
+  enableFeature = enable: feat: "--${if enable then "enable" else "disable"}-${feat}";
+
 }