diff --git a/pkgs/development/libraries/qt-5/modules/qtbase.nix b/pkgs/development/libraries/qt-5/modules/qtbase.nix index 748d4d1e0386..eb3fc8af96d7 100644 --- a/pkgs/development/libraries/qt-5/modules/qtbase.nix +++ b/pkgs/development/libraries/qt-5/modules/qtbase.nix @@ -4,7 +4,7 @@ , coreutils, bison, flex, gdb, gperf, lndir, perl, pkg-config, python3 , which # darwin support -, darwinMinVersionHook, apple-sdk, apple-sdk_10_14, apple-sdk_13, xcbuild +, apple-sdk_13, darwinMinVersionHook, xcbuild , dbus, fontconfig, freetype, glib, harfbuzz, icu, libdrm, libX11, libXcomposite , libXcursor, libXext, libXi, libXrender, libinput, libjpeg, libpng , libxcb @@ -41,12 +41,11 @@ let # Per https://doc.qt.io/qt-5/macos.html#supported-versions: deployment target = 10.13, build SDK = 13.x or 14.x. # Despite advertising support for the macOS 14 SDK, the build system sets the maximum to 13 and complains # about 14, so we just use that. - # Note that Qt propagates the 10.14 SDK instead of the 10.13 SDK to make sure that applications linked to Qt - # support automatic dark mode on x86_64-darwin (see: https://developer.apple.com/documentation/appkit/nsappearancecustomization/choosing_a_specific_appearance_for_your_macos_app). - propagatedAppleSDK = if lib.versionOlder (lib.getVersion apple-sdk) "10.14" then apple-sdk_10_14 else apple-sdk; deploymentTarget = "10.13"; - propagatedMinVersionHook = darwinMinVersionHook deploymentTarget; - buildAppleSDK = apple-sdk_13; + darwinVersionInputs = [ + apple-sdk_13 + (darwinMinVersionHook deploymentTarget) + ]; in stdenv.mkDerivation (finalAttrs: ({ @@ -63,11 +62,8 @@ stdenv.mkDerivation (finalAttrs: ({ # Image formats libjpeg libpng pcre2 - ] ++ ( - if stdenv.hostPlatform.isDarwin then [ - propagatedAppleSDK - propagatedMinVersionHook - ] else [ + ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) ( + [ dbus glib udev # Text rendering @@ -87,7 +83,7 @@ stdenv.mkDerivation (finalAttrs: ({ [ libinput ] ++ lib.optional withGtk3 gtk3 ) - ++ lib.optional stdenv.isDarwin buildAppleSDK + ++ lib.optional stdenv.isDarwin darwinVersionInputs ++ lib.optional developerBuild gdb ++ lib.optional (cups != null) cups ++ lib.optional (mysqlSupport) libmysqlclient diff --git a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix index 18d9d7459feb..38ad37fc0364 100644 --- a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix +++ b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix @@ -20,7 +20,7 @@ , systemd , enableProprietaryCodecs ? true , gn -, apple-sdk_13, cctools, cups, bootstrap_cmds, xcbuild, writeScriptBin +, cctools, cups, bootstrap_cmds, xcbuild, writeScriptBin , ffmpeg ? null , lib, stdenv , version ? null @@ -51,8 +51,7 @@ let in -# Override the SDK because Qt WebEngine doesn’t seem to build using the 14.4 SDK. -(qtModule.override { apple-sdk_for_qt = apple-sdk_13; }) ({ +qtModule ({ pname = "qtwebengine"; nativeBuildInputs = [ bison flex git gperf ninja pkg-config (python.withPackages(ps: [ ps.html5lib ])) which gn nodejs diff --git a/pkgs/development/libraries/qt-5/qtModule.nix b/pkgs/development/libraries/qt-5/qtModule.nix index ee59ee76d9e9..d3d810cbbf68 100644 --- a/pkgs/development/libraries/qt-5/qtModule.nix +++ b/pkgs/development/libraries/qt-5/qtModule.nix @@ -2,8 +2,8 @@ , stdenv , buildPackages , mkDerivation -, apple-sdk_14 -, apple-sdk_for_qt ? apple-sdk_14 +, apple-sdk_13 +, darwinMinVersionHook , perl , qmake , patches @@ -28,7 +28,10 @@ mkDerivation (args // { buildInputs = args.buildInputs or [ ] # Per https://doc.qt.io/qt-5/macos.html#supported-versions - ++ lib.optionals stdenv.isDarwin [ apple-sdk_for_qt ]; + ++ lib.optionals stdenv.isDarwin [ + apple-sdk_13 + (darwinMinVersionHook "10.13") + ]; nativeBuildInputs = (args.nativeBuildInputs or []) ++ [ diff --git a/pkgs/development/libraries/qt-6/default.nix b/pkgs/development/libraries/qt-6/default.nix index 7159bc6ae055..d306c3e430da 100644 --- a/pkgs/development/libraries/qt-6/default.nix +++ b/pkgs/development/libraries/qt-6/default.nix @@ -11,7 +11,6 @@ , libglvnd , darwin , apple-sdk_15 -, apple-sdk_12 , darwinMinVersionHook , buildPackages , python3 @@ -32,11 +31,10 @@ let }); # Per . - # This should reflect the lowest “Target Platform” and the - # highest “Build Environment”. - apple-sdk_qt = apple-sdk_15; - darwinDeploymentTargetDeps = [ - apple-sdk_12 + # This should reflect the highest “Build Environment” and the + # lowest “Target Platform”. + darwinVersionInputs = [ + apple-sdk_15 (darwinMinVersionHook "12.0") ]; in @@ -45,12 +43,12 @@ let inherit callPackage srcs; qtModule = callPackage ./qtModule.nix { - inherit apple-sdk_qt; + inherit darwinVersionInputs; }; qtbase = callPackage ./modules/qtbase.nix { withGtk3 = !stdenv.hostPlatform.isMinGW; - inherit apple-sdk_qt darwinDeploymentTargetDeps; + inherit darwinVersionInputs; 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 fd164b5e76f8..9df79ccc89be 100644 --- a/pkgs/development/libraries/qt-6/modules/qtbase.nix +++ b/pkgs/development/libraries/qt-6/modules/qtbase.nix @@ -67,8 +67,7 @@ , unixODBCDrivers # darwin , moveBuildTree -, apple-sdk_qt -, darwinDeploymentTargetDeps +, darwinVersionInputs , xcbuild # mingw , pkgsBuildBuild @@ -155,8 +154,7 @@ stdenv.mkDerivation rec { xorg.libXtst xorg.xcbutilcursor libepoxy - ] ++ lib.optionals stdenv.hostPlatform.isDarwin darwinDeploymentTargetDeps - ++ lib.optionals libGLSupported [ + ] ++ lib.optionals libGLSupported [ libGL ] ++ lib.optionals stdenv.hostPlatform.isMinGW [ vulkan-headers @@ -167,9 +165,7 @@ stdenv.mkDerivation rec { at-spi2-core ] ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform libinput) [ libinput - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ - apple-sdk_qt - ] + ] ++ lib.optionals stdenv.hostPlatform.isDarwin darwinVersionInputs ++ lib.optional withGtk3 gtk3 ++ lib.optional (libmysqlclient != null && !stdenv.hostPlatform.isMinGW) libmysqlclient ++ lib.optional (postgresql != null && lib.meta.availableOn stdenv.hostPlatform postgresql) postgresql; diff --git a/pkgs/development/libraries/qt-6/qtModule.nix b/pkgs/development/libraries/qt-6/qtModule.nix index 610649497ba8..8b09c8cb19b8 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_qt +, darwinVersionInputs , cmake , ninja , perl @@ -22,7 +22,7 @@ stdenv.mkDerivation (args // { buildInputs = args.buildInputs or [ ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ apple-sdk_qt ]; + ++ lib.optionals stdenv.hostPlatform.isDarwin darwinVersionInputs; nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ cmake ninja perl ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ moveBuildTree ]; propagatedBuildInputs =