wip: add structured attrs support (broken gcc)
This commit is contained in:
parent
f4f1f0aea7
commit
9e7e3da08e
1 changed files with 21 additions and 3 deletions
|
|
@ -52,7 +52,14 @@ in
|
|||
|
||||
sorted = lib.dag.sort.topological phases;
|
||||
|
||||
script = lib.strings.concatMapSep "\n" (entry: entry.value) sorted.result;
|
||||
script = lib.strings.concatMapSep "\n"
|
||||
(entry:
|
||||
''
|
||||
# Phase: ${entry.name}
|
||||
${entry.value}
|
||||
''
|
||||
)
|
||||
sorted.result;
|
||||
|
||||
executable =
|
||||
if system == "i686-linux" then
|
||||
|
|
@ -74,7 +81,7 @@ in
|
|||
inherit (package) name;
|
||||
inherit script system;
|
||||
|
||||
passAsFile = [ "script" ];
|
||||
__structuredAttrs = true;
|
||||
|
||||
SHELL = executable;
|
||||
|
||||
|
|
@ -112,6 +119,8 @@ in
|
|||
args = [
|
||||
"-e"
|
||||
(builtins.toFile "bash-builder.sh" ''
|
||||
source $NIX_ATTRS_SH_FILE
|
||||
|
||||
export CONFIG_SHELL=$SHELL
|
||||
|
||||
# Normalize the NIX_BUILD_CORES variable. The value might be 0, which
|
||||
|
|
@ -124,7 +133,16 @@ in
|
|||
fi
|
||||
export NIX_BUILD_CORES
|
||||
|
||||
bash -eux $scriptPath
|
||||
# Outputs is an associative array of output names to paths
|
||||
for name in "''${!outputs[@]}"; do
|
||||
eval "export ''${name//-/_}=\"''${outputs[$name]}\""
|
||||
done
|
||||
|
||||
# We have the raw script text in an environment variable named "script". Now
|
||||
# we need to run those commands.
|
||||
echo "$script" > .build.sh
|
||||
|
||||
bash .build.sh
|
||||
'')
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue