stdenv: fix prefixKey for structuredAttrs (#470397)

This commit is contained in:
Philip Taron
2026-01-05 15:15:15 +00:00
committed by GitHub
2 changed files with 12 additions and 1 deletions
+2
View File
@@ -84,6 +84,8 @@ stdenv.mkDerivation rec {
installTargets = lib.singleton "install" ++ lib.optional stdenv.hostPlatform.is64bit "install64";
__structuredAttrs = true;
meta = {
description = "ERESI Reverse Engineering Software Interface";
license = lib.licenses.gpl2Only;
+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