qt6.qtbase: fix incorrect substitution in setupHook

This commit is contained in:
Stefan Frijters
2026-02-25 11:39:12 +01:00
parent 5a38793218
commit 896e11b507
2 changed files with 11 additions and 4 deletions
@@ -1,13 +1,13 @@
if [[ -n "${__nix_qtbase-}" ]]; then
# Throw an error if a different version of Qt was already set up.
if [[ "$__nix_qtbase" != "@out@" ]]; then
if [[ "$__nix_qtbase" != "@qtbaseOut@" ]]; then
echo >&2 "Error: detected mismatched Qt dependencies:"
echo >&2 " @out@"
echo >&2 " @qtbaseOut@"
echo >&2 " $__nix_qtbase"
exit 1
fi
else # Only set up Qt once.
__nix_qtbase="@out@"
__nix_qtbase="@qtbaseOut@"
qtPluginPrefix=@qtPluginPrefix@
qtQmlPrefix=@qtQmlPrefix@
@@ -16,7 +16,7 @@ else # Only set up Qt once.
. @fix_qt_module_paths@
# Build tools are often confused if QMAKE is unset.
export QMAKE=@out@/bin/qmake
export QMAKE=@qtbaseOut@/bin/qmake
export QMAKEPATH=
@@ -321,6 +321,13 @@ stdenv.mkDerivation {
moveToOutput "mkspecs/modules" "$dev"
fixQtModulePaths "$dev/mkspecs/modules"
fixQtBuiltinPaths "$out" '*.pr?'
# @out@ would be automagically replaced inside makeSetupHook by the output of that derivation,
# but we need it to be the output of this derivation.
# Use a different placeholder and explicitly substitute this
# to keep compatibility with __structuredAttrs and avoid substituteAll.
substituteInPlace "''${!outputDev}/nix-support/setup-hook" \
--replace-fail "@qtbaseOut@" $out
''
+ lib.optionalString stdenv.hostPlatform.isLinux ''
# FIXME: not sure why this isn't added automatically?