From 0c1aa67215a3b165a6036f2a6302e01dd6938752 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sun, 14 Mar 2021 15:43:38 +0100 Subject: [PATCH] python3Minimal and python3: don't override python3 This reduces the amount of packages that are required to use builtins.fetchurl to fetch. Without this change, mime-types would not be able to use fetchzip when mime-types support is added to python3. --- .../interpreters/python/default.nix | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 56496979dc4c..39e27ec9944a 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -108,6 +108,19 @@ with pkgs; python = self; }; }; + + sources = { + "python38" = { + sourceVersion = { + major = "3"; + minor = "8"; + patch = "8"; + suffix = ""; + }; + sha256 = "fGZCSf935EPW6g5M8OWH6ukYyjxI0IHRkV/iofG8xcw="; + }; + }; + in { python27 = callPackage ./cpython/2.7 { @@ -149,18 +162,11 @@ in { inherit passthruFun; }; - python38 = callPackage ./cpython { + python38 = callPackage ./cpython ({ self = python38; - sourceVersion = { - major = "3"; - minor = "8"; - patch = "8"; - suffix = ""; - }; - sha256 = "fGZCSf935EPW6g5M8OWH6ukYyjxI0IHRkV/iofG8xcw="; inherit (darwin) configd; inherit passthruFun; - }; + } // sources.python38); python39 = callPackage ./cpython { self = python39; @@ -189,8 +195,9 @@ in { }; # Minimal versions of Python (built without optional dependencies) - python3Minimal = (python38.override { + python3Minimal = (callPackage ./cpython ({ self = python3Minimal; + inherit passthruFun; pythonAttr = "python3Minimal"; # strip down that python version as much as possible openssl = null; @@ -209,7 +216,7 @@ in { includeSiteCustomize = false; enableOptimizations = false; mimetypesSupport = false; - }).overrideAttrs(old: { + } // sources.python38)).overrideAttrs(old: { pname = "python3-minimal"; meta = old.meta // { maintainers = [];