From f3386ca8cce32ed7ced59ea043543336d3249b72 Mon Sep 17 00:00:00 2001 From: Ben Wolsieffer Date: Sat, 8 Jan 2022 00:47:45 -0500 Subject: [PATCH] qt5: apply makeScope overrides to qtModule qtModule was defined outside of addPackages, which caused it to use a self variable that isn't affected by updates using overrideScope. This caused overrides to qtbase to be incompletely applied. I also entirely removed the outer self variable to prevent it from being accidently used again. --- .../libraries/qt-5/5.12/default.nix | 32 +++++++++---------- .../libraries/qt-5/5.14/default.nix | 32 +++++++++---------- .../libraries/qt-5/5.15/default.nix | 32 +++++++++---------- 3 files changed, 45 insertions(+), 51 deletions(-) diff --git a/pkgs/development/libraries/qt-5/5.12/default.nix b/pkgs/development/libraries/qt-5/5.12/default.nix index c40062046658..6b213567ad44 100644 --- a/pkgs/development/libraries/qt-5/5.12/default.nix +++ b/pkgs/development/libraries/qt-5/5.12/default.nix @@ -117,22 +117,22 @@ let qttools = [ ./qttools.patch ]; }; - qtModule = - import ../qtModule.nix - { - inherit perl; - inherit lib; - # Use a variant of mkDerivation that does not include wrapQtApplications - # to avoid cyclic dependencies between Qt modules. - mkDerivation = - import ../mkDerivation.nix - { inherit lib; inherit debug; wrapQtAppsHook = null; } - stdenv.mkDerivation; - } - { inherit self srcs patches; }; - addPackages = self: with self; let + qtModule = + import ../qtModule.nix + { + inherit perl; + inherit lib; + # Use a variant of mkDerivation that does not include wrapQtApplications + # to avoid cyclic dependencies between Qt modules. + mkDerivation = + import ../mkDerivation.nix + { inherit lib; inherit debug; wrapQtAppsHook = null; } + stdenv.mkDerivation; + } + { inherit self srcs patches; }; + callPackage = self.newScope { inherit qtCompatVersion qtModule srcs; }; in { @@ -228,6 +228,4 @@ let } ../hooks/wrap-qt-apps-hook.sh; }; - self = lib.makeScope newScope addPackages; - -in self +in lib.makeScope newScope addPackages diff --git a/pkgs/development/libraries/qt-5/5.14/default.nix b/pkgs/development/libraries/qt-5/5.14/default.nix index ddd9d76df4ea..f12aadea7380 100644 --- a/pkgs/development/libraries/qt-5/5.14/default.nix +++ b/pkgs/development/libraries/qt-5/5.14/default.nix @@ -118,22 +118,22 @@ let qtwayland = [ ./qtwayland-libdrm-build.patch ]; }; - qtModule = - import ../qtModule.nix - { - inherit perl; - inherit lib; - # Use a variant of mkDerivation that does not include wrapQtApplications - # to avoid cyclic dependencies between Qt modules. - mkDerivation = - import ../mkDerivation.nix - { inherit lib; inherit debug; wrapQtAppsHook = null; } - stdenv.mkDerivation; - } - { inherit self srcs patches; }; - addPackages = self: with self; let + qtModule = + import ../qtModule.nix + { + inherit perl; + inherit lib; + # Use a variant of mkDerivation that does not include wrapQtApplications + # to avoid cyclic dependencies between Qt modules. + mkDerivation = + import ../mkDerivation.nix + { inherit lib; inherit debug; wrapQtAppsHook = null; } + stdenv.mkDerivation; + } + { inherit self srcs patches; }; + callPackage = self.newScope { inherit qtCompatVersion qtModule srcs; }; in { @@ -228,6 +228,4 @@ let } ../hooks/wrap-qt-apps-hook.sh; }; - self = lib.makeScope newScope addPackages; - -in self +in lib.makeScope newScope addPackages diff --git a/pkgs/development/libraries/qt-5/5.15/default.nix b/pkgs/development/libraries/qt-5/5.15/default.nix index 7c4845fd84a6..19cca4237f95 100644 --- a/pkgs/development/libraries/qt-5/5.15/default.nix +++ b/pkgs/development/libraries/qt-5/5.15/default.nix @@ -80,22 +80,22 @@ let qttools = [ ./qttools.patch ]; }; - qtModule = - import ../qtModule.nix - { - inherit perl; - inherit lib; - # Use a variant of mkDerivation that does not include wrapQtApplications - # to avoid cyclic dependencies between Qt modules. - mkDerivation = - import ../mkDerivation.nix - { inherit lib; inherit debug; wrapQtAppsHook = null; } - stdenv.mkDerivation; - } - { inherit self srcs patches; }; - addPackages = self: with self; let + qtModule = + import ../qtModule.nix + { + inherit perl; + inherit lib; + # Use a variant of mkDerivation that does not include wrapQtApplications + # to avoid cyclic dependencies between Qt modules. + mkDerivation = + import ../mkDerivation.nix + { inherit lib; inherit debug; wrapQtAppsHook = null; } + stdenv.mkDerivation; + } + { inherit self srcs patches; }; + callPackage = self.newScope { inherit qtCompatVersion qtModule srcs; }; in { @@ -192,6 +192,4 @@ let } ../hooks/wrap-qt-apps-hook.sh; }; - self = lib.makeScope newScope addPackages; - -in self +in lib.makeScope newScope addPackages