From 19d35002e4c9615e213d37479c47884716d281fc Mon Sep 17 00:00:00 2001 From: Emily Date: Sat, 12 Oct 2024 03:29:07 +0100 Subject: [PATCH] qt6.qtbase: build with `apple-sdk_15`, propagate `apple-sdk_12` As of Qt 6.8, the macOS 15 SDK is supported for building, and support for targeting macOS 11 has been dropped. (Another good reason for supporting only 3 to 4 macOS releases.) Previously the build and target SDKs were swapped, probably because the dependency lists are in a confusing order. Move them into a central place to reduce duplication and keep macOS platform support in one prominent location. Fixes: 830b9fe572fa374c4b7c31aac506003f1d8dfd5c --- pkgs/development/libraries/qt-6/default.nix | 18 ++++++++++++++++-- .../libraries/qt-6/modules/qtbase.nix | 14 +++++--------- pkgs/development/libraries/qt-6/qtModule.nix | 5 ++--- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/pkgs/development/libraries/qt-6/default.nix b/pkgs/development/libraries/qt-6/default.nix index f7bdfc98a313..b92d89618cfd 100644 --- a/pkgs/development/libraries/qt-6/default.nix +++ b/pkgs/development/libraries/qt-6/default.nix @@ -10,7 +10,9 @@ , gst_all_1 , libglvnd , darwin -, overrideSDK +, apple-sdk_15 +, apple-sdk_12 +, darwinMinVersionHook , buildPackages , python3 , config @@ -28,15 +30,27 @@ let inherit (self) qtModule; inherit srcs python3 stdenv; }); + + # Per . + # This should reflect the lowest “Target Platform” and the + # highest “Build Environment”. + apple-sdk_qt = apple-sdk_15; + darwinDeploymentTargetDeps = [ + apple-sdk_12 + (darwinMinVersionHook "12.0") + ]; in { inherit callPackage srcs; - qtModule = callPackage ./qtModule.nix { }; + qtModule = callPackage ./qtModule.nix { + inherit apple-sdk_qt; + }; qtbase = callPackage ./modules/qtbase.nix { withGtk3 = !stdenv.hostPlatform.isMinGW; + inherit apple-sdk_qt darwinDeploymentTargetDeps; inherit (srcs.qtbase) src version; patches = [ ./patches/0001-qtbase-qmake-always-use-libname-instead-of-absolute-.patch diff --git a/pkgs/development/libraries/qt-6/modules/qtbase.nix b/pkgs/development/libraries/qt-6/modules/qtbase.nix index c6ba346565b3..6dc903f8af9e 100644 --- a/pkgs/development/libraries/qt-6/modules/qtbase.nix +++ b/pkgs/development/libraries/qt-6/modules/qtbase.nix @@ -67,9 +67,8 @@ , unixODBCDrivers # darwin , moveBuildTree -, apple-sdk_11 -, apple-sdk_14 -, darwinMinVersionHook +, apple-sdk_qt +, darwinDeploymentTargetDeps , xcbuild # mingw , pkgsBuildBuild @@ -156,10 +155,8 @@ stdenv.mkDerivation rec { xorg.libXtst xorg.xcbutilcursor libepoxy - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ - apple-sdk_14 - (darwinMinVersionHook "11.0") - ] ++ lib.optionals libGLSupported [ + ] ++ lib.optionals stdenv.hostPlatform.isDarwin darwinDeploymentTargetDeps + ++ lib.optionals libGLSupported [ libGL ] ++ lib.optionals stdenv.hostPlatform.isMinGW [ vulkan-headers @@ -171,8 +168,7 @@ stdenv.mkDerivation rec { ] ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform libinput) [ libinput ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ - apple-sdk_11 - (darwinMinVersionHook "11.0") + apple-sdk_qt ] ++ lib.optional withGtk3 gtk3 ++ lib.optional (libmysqlclient != null && !stdenv.hostPlatform.isMinGW) libmysqlclient diff --git a/pkgs/development/libraries/qt-6/qtModule.nix b/pkgs/development/libraries/qt-6/qtModule.nix index bb2243318a10..b720f150c653 100644 --- a/pkgs/development/libraries/qt-6/qtModule.nix +++ b/pkgs/development/libraries/qt-6/qtModule.nix @@ -1,6 +1,6 @@ { lib , stdenv -, apple-sdk_14 +, apple-sdk_qt , cmake , ninja , perl @@ -22,8 +22,7 @@ stdenv.mkDerivation (args // { buildInputs = args.buildInputs or [ ] - # Per https://doc.qt.io/qt-6/macos.html#supported-versions - ++ lib.optionals stdenv.isDarwin [ apple-sdk_14 ]; + ++ lib.optionals stdenv.hostPlatform.isDarwin [ apple-sdk_qt ]; nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ cmake ninja perl ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ moveBuildTree ]; propagatedBuildInputs =