Unverified Commit 528dd7fa authored by Nick Cao's avatar Nick Cao Committed by GitHub
Browse files

Merge pull request #225555 from NickCao/qt6-cleanup

qt6: general cleanup to ease future reworking of packaging
parents f5d4f9cc c14e333e
Loading
Loading
Loading
Loading
+29 −37
Original line number Diff line number Diff line
@@ -2,26 +2,11 @@
, lib
, stdenv
, fetchurl
, fetchgit
, fetchpatch
, fetchFromGitHub
, makeSetupHook
, makeWrapper
, bison
, cups
, harfbuzz
, libGL
, perl
, cmake
, ninja
, writeText
, gstreamer
, gst-plugins-base
, gst-plugins-good
, gst-libav
, gst-vaapi
, gtk3
, dconf
, gst_all_1
, libglvnd
, darwin
, buildPackages
@@ -37,23 +22,28 @@ let
    mirror = "mirror://qt";
  };

  qtModule =
    import ./qtModule.nix
      { inherit stdenv lib perl cmake ninja writeText; }
      { inherit self srcs; };

  addPackages = self: with self;
    let
      callPackage = self.newScope ({ inherit qtModule stdenv srcs; });
      callPackage = self.newScope ({
        inherit qtModule srcs;
        stdenv = if stdenv.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv;
        cmake = cmake.overrideAttrs (attrs: {
          patches = attrs.patches ++ [
            ./patches/cmake.patch
          ];
        });
      });
    in
    {

      inherit callPackage qtModule srcs;
      inherit callPackage srcs;

      qtModule = callPackage ./qtModule.nix { };

      qtbase = callPackage ./modules/qtbase.nix {
        withGtk3 = true;
        inherit (srcs.qtbase) src version;
        inherit bison cups harfbuzz libGL dconf gtk3 developerBuild cmake;
        inherit developerBuild;
        inherit (darwin.apple_sdk_11_0.frameworks) AGL AVFoundation AppKit GSS MetalKit;
        patches = [
          ./patches/qtbase-qmake-mkspecs-mac.patch
@@ -111,7 +101,7 @@ let
      qtlanguageserver = callPackage ./modules/qtlanguageserver.nix { };
      qtlottie = callPackage ./modules/qtlottie.nix { };
      qtmultimedia = callPackage ./modules/qtmultimedia.nix {
        inherit gstreamer gst-plugins-base gst-plugins-good gst-libav gst-vaapi;
        inherit (gst_all_1) gstreamer gst-plugins-base gst-plugins-good gst-libav gst-vaapi;
        inherit (darwin.apple_sdk_11_0.frameworks) VideoToolbox;
      };
      qtnetworkauth = callPackage ./modules/qtnetworkauth.nix { };
@@ -140,12 +130,14 @@ let
        inherit (darwin.apple_sdk_11_0.frameworks) WebKit;
      };

      wrapQtAppsHook = makeSetupHook {
      wrapQtAppsHook = makeSetupHook
        {
          name = "wrap-qt6-apps-hook";
          propagatedBuildInputs = [ buildPackages.makeWrapper ];
        } ./hooks/wrap-qt-apps-hook.sh;

      qmake = makeSetupHook {
      qmake = makeSetupHook
        {
          name = "qmake6-hook";
          propagatedBuildInputs = [ self.qtbase.dev ];
          substitutions = {
+3 −5
Original line number Diff line number Diff line
{ stdenv, lib, perl, cmake, ninja, writeText }:

{ self, srcs, patches ? [ ] }:
{ stdenv, lib, perl, cmake, ninja, writeText, qtbase, qmake, srcs, patches ? [ ] }:

args:

@@ -18,7 +16,7 @@ stdenv.mkDerivation (args // {
    perl
    cmake
    ninja
    self.qmake
    qmake
  ];
  propagatedBuildInputs = args.qtInputs ++ (args.propagatedBuildInputs or [ ]);

@@ -61,7 +59,7 @@ stdenv.mkDerivation (args // {
      if [[ -z "$dontSyncQt" && -f sync.profile ]]; then
        # FIXME: this probably breaks crosscompiling as it's not from nativeBuildInputs
        # I don't know how to get /libexec from nativeBuildInputs to work, it's not under /bin
        ${lib.getDev self.qtbase}/libexec/syncqt.pl -version "''${version%%-*}"
        ${lib.getDev qtbase}/libexec/syncqt.pl -version "''${version%%-*}"
      fi
    '';

+1 −14
Original line number Diff line number Diff line
@@ -23227,20 +23227,7 @@ with pkgs;
  qtEnv = qt5.env;
  qt5Full = qt5.full;
  qt6 = recurseIntoAttrs (makeOverridable
    (import ../development/libraries/qt-6) {
      inherit newScope;
      inherit lib fetchurl fetchpatch fetchgit fetchFromGitHub makeSetupHook makeWrapper writeText;
      inherit bison cups dconf harfbuzz libGL perl gtk3 ninja;
      inherit (gst_all_1) gstreamer gst-plugins-base gst-plugins-good gst-libav gst-vaapi;
      inherit darwin buildPackages libglvnd;
      stdenv = if stdenv.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv;
      cmake = cmake.overrideAttrs (attrs: {
        patches = attrs.patches ++ [
          ../development/libraries/qt-6/patches/cmake.patch
        ];
      });
    });
  qt6 = recurseIntoAttrs (callPackage ../development/libraries/qt-6 { });
  qt6Packages = recurseIntoAttrs (import ./qt6-packages.nix {
    inherit lib pkgs qt6;