From 6e2e32556e01189e6a2f17ad1fac3049ee94b435 Mon Sep 17 00:00:00 2001 From: Artturin Date: Sat, 11 Nov 2023 21:27:08 +0200 Subject: [PATCH] qt6Packages: use makeScopeWithSplicing 23.11 has a warning for `overrideScope'` in `makeScope` itself --- pkgs/top-level/all-packages.nix | 2 +- pkgs/top-level/qt6-packages.nix | 31 ++++++++++++++++++++++++------- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0031ff1a5ec3..7ba022bb51e7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -24662,7 +24662,7 @@ with pkgs; qt6 = recurseIntoAttrs (callPackage ../development/libraries/qt-6 { }); qt6Packages = recurseIntoAttrs (import ./qt6-packages.nix { - inherit lib pkgs qt6; + inherit lib __splicedPackages makeScopeWithSplicing' generateSplicesForMkScope pkgsBuildHost; stdenv = if stdenv.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv; }); diff --git a/pkgs/top-level/qt6-packages.nix b/pkgs/top-level/qt6-packages.nix index 8490d2a20186..2947083804d3 100644 --- a/pkgs/top-level/qt6-packages.nix +++ b/pkgs/top-level/qt6-packages.nix @@ -5,17 +5,27 @@ # this file. { lib -, pkgs -, qt6 +, __splicedPackages +, makeScopeWithSplicing' +, generateSplicesForMkScope , stdenv +, pkgsBuildHost }: -(lib.makeScope pkgs.newScope ( self: - let - callPackage = self.callPackage; + pkgs = __splicedPackages; + # qt6 set should not be pre-spliced to prevent spliced packages being a part of an unspliced set + # 'pkgsCross.aarch64-multiplatform.pkgsBuildTarget.targetPackages.qt6Packages.qtbase' should not have a `__spliced` but if qt6 is pre-spliced then it will have one. + # pkgsBuildHost == pkgs + qt6 = pkgsBuildHost.qt6; in -(qt6 // { + +makeScopeWithSplicing' { + otherSplices = generateSplicesForMkScope "qt6Packages"; + f = (self: let + inherit (self) callPackage; + noExtraAttrs = set: lib.attrsets.removeAttrs set [ "extend" "override" "overrideScope" "overrideScope'" "overrideDerivation" ]; + in (noExtraAttrs qt6) // { inherit stdenv; # LIBRARIES @@ -45,4 +55,11 @@ in qt6Support = true; suffix = "qt6"; }; -}))) + + } // lib.optionalAttrs pkgs.config.allowAliases { + # Convert to a throw on 01-01-2023. + # Warnings show up in various cli tool outputs, throws do not. + # Remove completely before 24.05 + overrideScope' = lib.warn "qt6Packages now uses makeScopeWithSplicing which does not have \"overrideScope'\", use \"overrideScope\"." self.overrideScope; + }); +}