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 /pkgs/lib/strings.nix | |
parent | 5f32207dfc9a146f426ba168bfcf887292f2d265 (diff) | |
download | nixpkgs-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.nix | 5 |
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}"; + } |