From e34775b6a1519b0c488ad2613822a900c6cce1e2 Mon Sep 17 00:00:00 2001 From: Niklas Korz Date: Tue, 1 Jul 2025 08:49:11 +0200 Subject: [PATCH] qt6: prevent Xcode version sniffing Qt tries to detect the running Xcode version through `xcrun xcodebuild -version`. This fails when xcbuild is not included in the dependencies, and is also unnecessary as the value is only used for the Xcode min version check that we explicitly disable already. --- .../development/libraries/qt-6/modules/qtbase/default.nix | 4 ++++ pkgs/development/libraries/qt-6/qtModule.nix | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/qt-6/modules/qtbase/default.nix b/pkgs/development/libraries/qt-6/modules/qtbase/default.nix index 436d147f9bbf..4ba12af1d102 100644 --- a/pkgs/development/libraries/qt-6/modules/qtbase/default.nix +++ b/pkgs/development/libraries/qt-6/modules/qtbase/default.nix @@ -269,6 +269,10 @@ stdenv.mkDerivation rec { ++ lib.optionals stdenv.hostPlatform.isDarwin [ "-DQT_FEATURE_rpath=OFF" "-DQT_NO_XCODE_MIN_VERSION_CHECK=ON" + # This is only used for the min version check, which we disabled above. + # When this variable is not set, cmake tries to execute xcodebuild + # to query the version. + "-DQT_INTERNAL_XCODE_VERSION=0.1" ] ++ lib.optionals isCrossBuild [ "-DQT_HOST_PATH=${pkgsBuildBuild.qt6.qtbase}" diff --git a/pkgs/development/libraries/qt-6/qtModule.nix b/pkgs/development/libraries/qt-6/qtModule.nix index e5089813c39a..a7f8144212b2 100644 --- a/pkgs/development/libraries/qt-6/qtModule.nix +++ b/pkgs/development/libraries/qt-6/qtModule.nix @@ -42,7 +42,13 @@ stdenv.mkDerivation ( # don't leak OS version into the final output # https://bugreports.qt.io/browse/QTBUG-136060 [ "-DCMAKE_SYSTEM_VERSION=" ] - ++ lib.optional stdenv.hostPlatform.isDarwin "-DQT_NO_XCODE_MIN_VERSION_CHECK=ON" + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-DQT_NO_XCODE_MIN_VERSION_CHECK=ON" + # This is only used for the min version check, which we disabled above. + # When this variable is not set, cmake tries to execute xcodebuild + # to query the version. + "-DQT_INTERNAL_XCODE_VERSION=0.1" + ] ++ args.cmakeFlags or [ ]; moveToDev = false;