summary refs log tree commit diff
path: root/pkgs/lib
diff options
context:
space:
mode:
authorMarc Weber <marco-oweber@gmx.de>2007-12-12 07:20:41 +0000
committerMarc Weber <marco-oweber@gmx.de>2007-12-12 07:20:41 +0000
commit9a4e9e7a3b4014bb3c9f678ec22d254b85c4c98a (patch)
tree427fc2b450c3a5955440d4e08998feffce9450c7 /pkgs/lib
parent054d0e30761b2a74cefe65e061b124a186e0c91c (diff)
vim_configurable example added. broken see comment.
svn path=/nixpkgs/trunk/; revision=9923
Diffstat (limited to 'pkgs/lib')
-rw-r--r--pkgs/lib/default-unstable.nix10
1 files changed, 8 insertions, 2 deletions
diff --git a/pkgs/lib/default-unstable.nix b/pkgs/lib/default-unstable.nix
index b609c65a04b94..5653508dca9a6 100644
--- a/pkgs/lib/default-unstable.nix
+++ b/pkgs/lib/default-unstable.nix
@@ -309,6 +309,9 @@ rec {
         collectAttrs = attr : catAttrs attr flatOptions;
         optsConcatStrs = delimiter : attrs : concatStrings 
                 ( intersperse delimiter (flatten ( collectAttrs attrs ) ) );
+
+        ifStringGetArg = x : if (__isAttrs x) then x # ( TODO implement __isString ?)
+                             else avs x (__getAttr x args);
           
     in assert ( all id ( mapRecordFlatten ( attr : r : if ( all id ( flatten (getAttr ["assertion"] [] r ) ) ) 
                                               then true else throw "assertion failed flag ${attr}" )
@@ -322,13 +325,15 @@ rec {
 
           buildInputs = map ( attr: if (! hasAttr attr args) then throw "argument ${attr} is missing!" else (builtins.getAttr attr args) )
                         (flatten  (catAttrs "buildInputs" flatOptions));
+          propagatedBuildInputs = map ( attr: if (! hasAttr attr args) then throw "argument ${attr} is missing!" else (builtins.getAttr attr args) )
+                        (flatten  (catAttrs "propagatedBuildInputs" flatOptions));
 
           configureFlags = optsConcatStrs " " "cfgOption";
 
           #flags = listToAttrs (map ( flag: av flag (hasAttr flag options) ) (attrNames flagConfig) );
           flags_prefixed = listToAttrs (map ( flag: av ("flag_set_"+flag) (hasAttr flag options) ) (attrNames flagConfig) );
 
-          pass = mergeAttrs (flatten (collectAttrs "pass") );
+          pass = mergeAttrs ( map ifStringGetArg ( flatten (collectAttrs "pass") ) );
       } #  now add additional phase actions (see examples)
       // listToAttrs ( map ( x : av x (optsConcatStrs "\n" x) ) collectExtraPhaseActions ) );
 }
@@ -362,7 +367,8 @@ rec {
   # features:
   # * configure options are passed automatically
   # * buildInputs are collected (they are special, see the setup script)
-  # * they can be passed by additional name as well using pass =
+  # * they can be passed by additional name as well using pass = { inherit (args) python } 
+  #                                       ( or short (value not attrs) : pass = "python" )
   # * an attribute named the same way as the flag is added indicating 
   #   true/ false (flag has been set/ not set)
   # * extra phase dependend commands can be added