Unverified Commit ead94a72 authored by K900's avatar K900 Committed by GitHub
Browse files

qt{5,6}: update for the new Darwin SDK (#347216)

parents a45a3330 0725c33a
Loading
Loading
Loading
Loading
+7 −30
Original line number Diff line number Diff line
@@ -250,23 +250,15 @@ let
        inherit bison cups harfbuzz libGL;
        withGtk3 = !stdenv.hostPlatform.isDarwin; inherit dconf gtk3;
        inherit developerBuild decryptSslTraffic;
        inherit (darwin.apple_sdk_11_0.frameworks) AGL AppKit ApplicationServices AVFoundation Carbon Cocoa CoreAudio CoreBluetooth
          CoreLocation CoreServices DiskArbitration Foundation OpenGL MetalKit IOKit;
        libobjc = darwin.apple_sdk_11_0.objc4;
        xcbuild = darwin.apple_sdk_11_0.xcodebuild;
      };

      qt3d = callPackage ../modules/qt3d.nix {};
      qtcharts = callPackage ../modules/qtcharts.nix {};
      qtconnectivity = callPackage ../modules/qtconnectivity.nix {
        inherit (darwin.apple_sdk_11_0.frameworks) IOBluetooth;
      };
      qtconnectivity = callPackage ../modules/qtconnectivity.nix { };
      qtdatavis3d = callPackage ../modules/qtdatavis3d.nix {};
      qtdeclarative = callPackage ../modules/qtdeclarative.nix {};
      qtdoc = callPackage ../modules/qtdoc.nix {};
      qtgamepad = callPackage ../modules/qtgamepad.nix {
        inherit (darwin.apple_sdk_11_0.frameworks) GameController;
      };
      qtgamepad = callPackage ../modules/qtgamepad.nix { };
      qtgraphicaleffects = callPackage ../modules/qtgraphicaleffects.nix {};
      qtimageformats = callPackage ../modules/qtimageformats.nix {};
      qtlocation = callPackage ../modules/qtlocation.nix {};
@@ -278,9 +270,7 @@ let
      qtnetworkauth = callPackage ../modules/qtnetworkauth.nix {};
      qtpim = callPackage ../modules/qtpim.nix {};
      qtpositioning = callPackage ../modules/qtpositioning.nix {};
      qtpurchasing = callPackage ../modules/qtpurchasing.nix {
        inherit (darwin.apple_sdk_11_0.frameworks) Foundation StoreKit;
      };
      qtpurchasing = callPackage ../modules/qtpurchasing.nix { };
      qtquick1 = null;
      qtquick3d = callPackage ../modules/qtquick3d.nix { };
      qtquickcontrols = callPackage ../modules/qtquickcontrols.nix {};
@@ -309,28 +299,15 @@ let
        #   starting with clang 16. Patches are available upstream that can be backported.
        # Because the first error is non-trivial to fix and suppressing it risks future breakage,
        # clang is pinned to clang 15. That also makes fixing the second set of errors unnecessary.
        stdenv =
          let stdenv' = if stdenv.cc.isClang then overrideLibcxx llvmPackages_15.stdenv else stdenv;
          in if stdenv'.hostPlatform.isDarwin then overrideSDK stdenv' "11.0" else stdenv';
        stdenv = if stdenv.cc.isClang then overrideLibcxx llvmPackages_15.stdenv else stdenv;
        inherit (srcs.qtwebengine) version;
        inherit (darwin) bootstrap_cmds;
        python = python3;
        inherit (darwin) xnu;
        inherit (darwin.apple_sdk_11_0) libpm libunwind;
        inherit (darwin.apple_sdk_11_0.libs) sandbox;
        inherit (darwin.apple_sdk_11_0.frameworks) ApplicationServices AVFoundation Foundation ForceFeedback GameController AppKit
          ImageCaptureCore CoreBluetooth IOBluetooth CoreWLAN Quartz Cocoa LocalAuthentication
          MediaPlayer MediaAccessibility SecurityInterface Vision CoreML OpenDirectory Accelerate;
        libobjc = darwin.apple_sdk_11_0.objc4;
      };
      qtwebglplugin = callPackage ../modules/qtwebglplugin.nix {};
      qtwebkit = callPackage ../modules/qtwebkit.nix {
        inherit (darwin) ICU;
        inherit (darwin.apple_sdk_11_0.frameworks) OpenGL;
      };
      qtwebkit = callPackage ../modules/qtwebkit.nix { };
      qtwebsockets = callPackage ../modules/qtwebsockets.nix {};
      qtwebview = callPackage ../modules/qtwebview.nix {
        inherit (darwin.apple_sdk_11_0.frameworks) CoreFoundation WebKit;
      };
      qtwebview = callPackage ../modules/qtwebview.nix { };
      qtx11extras = callPackage ../modules/qtx11extras.nix {};
      qtxmlpatterns = callPackage ../modules/qtxmlpatterns.nix {};

+18 −15
Original line number Diff line number Diff line
@@ -4,8 +4,7 @@
, coreutils, bison, flex, gdb, gperf, lndir, perl, pkg-config, python3
, which
  # darwin support
, libiconv, libobjc, xcbuild, AGL, AppKit, ApplicationServices, AVFoundation, Carbon, Cocoa, CoreAudio, CoreBluetooth
, CoreLocation, CoreServices, DiskArbitration, Foundation, OpenGL, MetalKit, IOKit
, darwinMinVersionHook, apple-sdk, apple-sdk_10_14, apple-sdk_14, xcbuild

, dbus, fontconfig, freetype, glib, harfbuzz, icu, libdrm, libX11, libXcomposite
, libXcursor, libXext, libXi, libXrender, libinput, libjpeg, libpng , libxcb
@@ -38,6 +37,13 @@ let
    if isLinux
    then "linux-generic-g++"
    else throw "Please add a qtPlatformCross entry for ${plat.config}";

  # Per https://doc.qt.io/qt-5/macos.html#supported-versions: deployment target = 10.13, build SDK = 14.x.
  # 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;
  propagatedMinVersionHook = darwinMinVersionHook "10.13";
  buildAppleSDK = apple-sdk_14;
in

stdenv.mkDerivation (finalAttrs: ({
@@ -56,10 +62,8 @@ stdenv.mkDerivation (finalAttrs: ({
    pcre2
  ] ++ (
    if stdenv.hostPlatform.isDarwin then [
      # TODO: move to buildInputs, this should not be propagated.
      AGL AppKit ApplicationServices AVFoundation Carbon Cocoa CoreAudio CoreBluetooth
      CoreLocation CoreServices DiskArbitration Foundation OpenGL
      libobjc libiconv MetalKit IOKit
      propagatedAppleSDK
      propagatedMinVersionHook
    ] else [
      dbus glib udev

@@ -80,6 +84,7 @@ stdenv.mkDerivation (finalAttrs: ({
      [ libinput ]
      ++ lib.optional withGtk3 gtk3
    )
    ++ lib.optional stdenv.isDarwin buildAppleSDK
    ++ lib.optional developerBuild gdb
    ++ lib.optional (cups != null) cups
    ++ lib.optional (mysqlSupport) libmysqlclient
@@ -141,15 +146,13 @@ stdenv.mkDerivation (finalAttrs: ({
    patchShebangs ./bin
  '' + (
    if stdenv.hostPlatform.isDarwin then ''
        sed -i \
            -e 's|/usr/bin/xcode-select|xcode-select|' \
            -e 's|/usr/bin/xcrun|xcrun|' \
            -e 's|/usr/bin/xcodebuild|xcodebuild|' \
            -e 's|QMAKE_CONF_COMPILER=`getXQMakeConf QMAKE_CXX`|QMAKE_CXX="clang++"\nQMAKE_CONF_COMPILER="clang++"|' \
            ./configure
      substituteInPlace configure \
        --replace-fail '/usr/bin/xcode-select' '${lib.getBin xcbuild}/bin/xcode-select' \
        --replace-fail '/usr/bin/xcrun' '${lib.getBin xcbuild}/bin/xcrun' \
        --replace-fail '/System/Library/Frameworks/Cocoa.framework' "$SDKROOT/System/Library/Frameworks/Cocoa.framework"
      substituteInPlace ./mkspecs/common/mac.conf \
                --replace "/System/Library/Frameworks/OpenGL.framework/" "${OpenGL}/Library/Frameworks/OpenGL.framework/" \
                --replace "/System/Library/Frameworks/AGL.framework/" "${AGL}/Library/Frameworks/AGL.framework/"
        --replace-fail "/System/Library/Frameworks/OpenGL.framework/" "$SDKROOT/System/Library/Frameworks/OpenGL.framework/" \
        --replace-fail "/System/Library/Frameworks/AGL.framework/" "$SDKROOT/System/Library/Frameworks/AGL.framework/"
    '' else lib.optionalString libGLSupported ''
      sed -i mkspecs/common/linux.conf \
          -e "/^QMAKE_INCDIR_OPENGL/ s|$|${lib.getDev libGL}/include|" \
+1 −3
Original line number Diff line number Diff line
{ qtModule, lib, stdenv, qtbase, qtdeclarative, bluez, IOBluetooth }:
{ qtModule, lib, stdenv, qtbase, qtdeclarative, bluez }:

qtModule {
  pname = "qtconnectivity";
@@ -6,8 +6,6 @@ qtModule {
  propagatedBuildInputs = [
    qtbase
    qtdeclarative
  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
    IOBluetooth
  ];
  outputs = [ "out" "dev" "bin" ];
}
+2 −3
Original line number Diff line number Diff line
{ lib, stdenv, qtModule, qtbase, qtdeclarative, GameController, pkg-config }:
{ qtModule, qtbase, qtdeclarative, pkg-config }:

qtModule {
  pname = "qtgamepad";
  propagatedBuildInputs = [ qtbase qtdeclarative ]
    ++ lib.optional stdenv.hostPlatform.isDarwin GameController;
  propagatedBuildInputs = [ qtbase qtdeclarative ];
  nativeBuildInputs = [ pkg-config ];
  outputs = [ "out" "dev" "bin" ];
}
+1 −9
Original line number Diff line number Diff line
{ stdenv
, lib
, qtModule
, qtbase
, qtdeclarative
, StoreKit
, Foundation
}:
{ qtModule, qtbase, qtdeclarative }:

qtModule {
  pname = "qtpurchasing";
  propagatedBuildInputs = [ qtbase qtdeclarative ];
  buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ Foundation StoreKit ];
}
Loading