From d63977883deadcddb4752526d87132134c0a368c 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 | 18 +++++------------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index e4230093e9c3f..94422518b255b 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 ba56e09c8cfba..d39221a868624 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10160,10 +10160,10 @@ in pythonInterpreters = callPackage ./../development/interpreters/python { # Overrides that apply to all Python interpreters - pkgs = pkgs // { + pkgs = pkgs.extend (pkgs: _: { qt5 = pkgs.qt514; libsForQt5 = pkgs.libsForQt514; - }; + }); }; inherit (pythonInterpreters) python27 python36 python37 python38 python39 python3Minimal pypy27 pypy36; @@ -22836,18 +22836,10 @@ 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; - }; + pythonI = pkgs.pythonInterpreters.override { inherit pkgs; }; + verString = lib.concatStrings (lib.take 2 (lib.splitVersion pkgs.python3.version)); in libsForQt5.callPackage ../applications/networking/browsers/qutebrowser { - python3 = python; + python3 = pythonI."python${verString}"; }; rabbitvcs = callPackage ../applications/version-management/rabbitvcs {};