summary refs log tree commit diff
path: root/pkgs/lib/strings.nix
diff options
context:
space:
mode:
authorPeter Simons <simons@cryp.to>2013-02-24 19:28:24 +0100
committerPeter Simons <simons@cryp.to>2013-02-24 19:28:24 +0100
commit7181888c23a5ccf6f5b4721fa3bc305477af8179 (patch)
treeade3c14e1fa45107c75d9ce946d1b779127c13b2 /pkgs/lib/strings.nix
parent5f32207dfc9a146f426ba168bfcf887292f2d265 (diff)
downloadnixpkgs-7181888c23a5ccf6f5b4721fa3bc305477af8179.tar
nixpkgs-7181888c23a5ccf6f5b4721fa3bc305477af8179.tar.gz
nixpkgs-7181888c23a5ccf6f5b4721fa3bc305477af8179.tar.bz2
nixpkgs-7181888c23a5ccf6f5b4721fa3bc305477af8179.tar.lz
nixpkgs-7181888c23a5ccf6f5b4721fa3bc305477af8179.tar.xz
nixpkgs-7181888c23a5ccf6f5b4721fa3bc305477af8179.tar.zst
nixpkgs-7181888c23a5ccf6f5b4721fa3bc305477af8179.zip
pkgs/lib/strings.nix: add 'enableFeature' function to simplify generation of GNU Autoconf "--{enable,disable}-feature" strings
Diffstat (limited to 'pkgs/lib/strings.nix')
-rw-r--r--pkgs/lib/strings.nix5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkgs/lib/strings.nix b/pkgs/lib/strings.nix
index 19d1738182f..8ea4106709a 100644
--- a/pkgs/lib/strings.nix
+++ b/pkgs/lib/strings.nix
@@ -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}";
+
 }