diff --git a/pkgs/development/libraries/qt-6/hooks/qtbase-setup-hook.sh b/pkgs/development/libraries/qt-6/hooks/qtbase-setup-hook.sh index 9bc68e6cd3d61..9f1bba4e63d2f 100644 --- a/pkgs/development/libraries/qt-6/hooks/qtbase-setup-hook.sh +++ b/pkgs/development/libraries/qt-6/hooks/qtbase-setup-hook.sh @@ -1,3 +1,13 @@ +if [[ "x$stdenv" != "x@qtbase_stdenv@" ]]; then + echo "skipping qtbase-setup-hook.sh because of mismatch:" + echo " stdenv of current derivation: $stdenv" + echo " stdenv of qtbase.dev dependency: @qtbase_stdenv@" + echo " qtbase = @dev@" + return +fi + +echo "running qtbase-setup-hook.sh with hostOffset=$hostOffset targetOffset=$targetOffset: @out@" + if [[ -n "${__nix_qtbase-}" ]]; then # Throw an error if a different version of Qt was already set up. if [[ "$__nix_qtbase" != "@out@" ]]; then diff --git a/pkgs/development/libraries/qt-6/modules/qtbase.nix b/pkgs/development/libraries/qt-6/modules/qtbase.nix index c0a20503e64c0..912d8ff53116c 100644 --- a/pkgs/development/libraries/qt-6/modules/qtbase.nix +++ b/pkgs/development/libraries/qt-6/modules/qtbase.nix @@ -201,6 +201,12 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; + env = lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) { + QT_HOST_PATH = "${pkgsBuildHost.qt6Packages.qtbase}"; + } // { + qtbase_stdenv = stdenv.outPath; + }; + inherit patches; # https://bugreports.qt.io/browse/QTBUG-97568