From 7abb57c7b5eaa9aa34ea289fc1e23ed259547bdb Mon Sep 17 00:00:00 2001 From: Johannes Rosenberger Date: Fri, 18 Sep 2020 00:45:31 +0200 Subject: [PATCH] fix passing qt5 version to pythonInterpreters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes c88f3adb1793cd3b007baff0292cf1fa8d0ab1e6, which resulted in qt 5.15 being used in pythonPackages, despite 5.14 being declared, and adapts qutebrowser accordingly. 'callPackage { pkgs = pkgs // { … }; }' does not work, because it does not take into account the recursive evaluation of nixpkgs: `pkgs/development/interpreters/python/default.nix` calls `pkgs/top-level/python-packages.nix` with `callPackage`. Thus, even if the former gets passed the updated `pkgs`, the latter always gets passed `pkgs.pkgs`. For the change in the qt5 version to apply consistently, 'pkgs.extend' must be used. qutebrowser only used the right qt5 version (5.15) because all pythonPackages used it anyway. --- .../interpreters/python/default.nix | 2 +- pkgs/top-level/all-packages.nix | 29 ++++++++----------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index e4230093e9c..94422518b25 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -1,4 +1,4 @@ -{ pkgs, lib }: +{ pkgs }: with pkgs; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c111685ca01..570e27b45ea 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10217,10 +10217,10 @@ in pythonInterpreters = callPackage ./../development/interpreters/python { # Overrides that apply to all Python interpreters - pkgs = pkgs // { - qt5 = pkgs.qt514; - libsForQt5 = pkgs.libsForQt514; - }; + pkgs = pkgs.extend (final: _: { + qt5 = final.qt514; + libsForQt5 = final.libsForQt514; + }); }; inherit (pythonInterpreters) python27 python36 python37 python38 python39 python3Minimal pypy27 pypy36; @@ -22956,19 +22956,14 @@ in quodlibet-xine-full = quodlibet-full.override { xineBackend = true; tag = "-xine-full"; }; qutebrowser = let - libsForQt5 = libsForQt515; - qt5 = qt515; - python = python3.override { - packageOverrides = self: super: { - pkgs = pkgs // { - inherit libsForQt5 qt5; - }; - }; - self = python3; - }; - in libsForQt5.callPackage ../applications/networking/browsers/qutebrowser { - python3 = python; - }; + pkgs_ = pkgs.extend(_: prev: { + pythonInterpreters = prev.pythonInterpreters.override(oldAttrs: { + pkgs = oldAttrs.pkgs.extend(_: _: { + inherit (pkgs) qt5 libsForQt5; + }); + }); + }); + in pkgs_.libsForQt5.callPackage ../applications/networking/browsers/qutebrowser { }; rabbitvcs = callPackage ../applications/version-management/rabbitvcs {};