stdenv: fix prefixKey for structuredAttrs

This commit is contained in:
Stefan Frijters
2025-12-13 10:30:09 +01:00
parent 307cf2503b
commit d7b24b856e
+10 -1
View File
@@ -1455,7 +1455,16 @@ configurePhase() {
fi
if [[ -z "${dontAddPrefix:-}" && -n "$prefix" ]]; then
prependToVar configureFlags "${prefixKey:---prefix=}$prefix"
# For __structuredAttrs: if prefixKey ends in a space,
# we need to add the prefixKey and the prefix as separate entries,
# and since we prepend, we do it in reverse order.
local -r prefixKeyOrDefault="${prefixKey:---prefix=}"
if [ "${prefixKeyOrDefault: -1}" = " " ]; then
prependToVar configureFlags "$prefix"
prependToVar configureFlags "${prefixKeyOrDefault::-1}"
else
prependToVar configureFlags "$prefixKeyOrDefault$prefix"
fi
fi
if [[ -f "$configureScript" ]]; then