diff options
author | Peter Simons <simons@cryp.to> | 2013-02-24 19:28:24 +0100 |
---|---|---|
committer | Peter Simons <simons@cryp.to> | 2013-02-24 19:28:24 +0100 |
commit | 7181888c23a5ccf6f5b4721fa3bc305477af8179 (patch) | |
tree | ade3c14e1fa45107c75d9ce946d1b779127c13b2 | |
parent | 5f32207dfc9a146f426ba168bfcf887292f2d265 (diff) | |
download | nixlib-7181888c23a5ccf6f5b4721fa3bc305477af8179.tar nixlib-7181888c23a5ccf6f5b4721fa3bc305477af8179.tar.gz nixlib-7181888c23a5ccf6f5b4721fa3bc305477af8179.tar.bz2 nixlib-7181888c23a5ccf6f5b4721fa3bc305477af8179.tar.lz nixlib-7181888c23a5ccf6f5b4721fa3bc305477af8179.tar.xz nixlib-7181888c23a5ccf6f5b4721fa3bc305477af8179.tar.zst nixlib-7181888c23a5ccf6f5b4721fa3bc305477af8179.zip |
pkgs/lib/strings.nix: add 'enableFeature' function to simplify generation of GNU Autoconf "--{enable,disable}-feature" strings
-rw-r--r-- | pkgs/lib/strings.nix | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkgs/lib/strings.nix b/pkgs/lib/strings.nix index 19d1738182f4..8ea4106709ab 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}"; + } |