2020-09-25 04:45:31 +00:00
|
|
|
{ pkgs }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
with pkgs;
|
|
|
|
|
|
|
|
(let
|
|
|
|
|
|
|
|
# Common passthru for all Python interpreters.
|
|
|
|
passthruFun =
|
|
|
|
{ implementation
|
|
|
|
, libPrefix
|
|
|
|
, executable
|
|
|
|
, sourceVersion
|
|
|
|
, pythonVersion
|
|
|
|
, packageOverrides
|
|
|
|
, sitePackages
|
|
|
|
, hasDistutilsCxxPatch
|
|
|
|
, pythonForBuild
|
|
|
|
, self
|
|
|
|
}: let
|
|
|
|
pythonPackages = callPackage ../../../top-level/python-packages.nix {
|
|
|
|
python = self;
|
|
|
|
overrides = packageOverrides;
|
|
|
|
};
|
|
|
|
in rec {
|
|
|
|
isPy27 = pythonVersion == "2.7";
|
|
|
|
isPy35 = pythonVersion == "3.5";
|
|
|
|
isPy36 = pythonVersion == "3.6";
|
|
|
|
isPy37 = pythonVersion == "3.7";
|
|
|
|
isPy38 = pythonVersion == "3.8";
|
|
|
|
isPy39 = pythonVersion == "3.9";
|
|
|
|
isPy2 = lib.strings.substring 0 1 pythonVersion == "2";
|
|
|
|
isPy3 = lib.strings.substring 0 1 pythonVersion == "3";
|
|
|
|
isPy3k = isPy3;
|
|
|
|
isPyPy = lib.hasInfix "pypy" interpreter;
|
|
|
|
|
|
|
|
buildEnv = callPackage ./wrapper.nix { python = self; inherit (pythonPackages) requiredPythonModules; };
|
|
|
|
withPackages = import ./with-packages.nix { inherit buildEnv pythonPackages;};
|
|
|
|
pkgs = pythonPackages;
|
|
|
|
interpreter = "${self}/bin/${executable}";
|
|
|
|
inherit executable implementation libPrefix pythonVersion sitePackages;
|
|
|
|
inherit sourceVersion;
|
|
|
|
pythonAtLeast = lib.versionAtLeast pythonVersion;
|
|
|
|
pythonOlder = lib.versionOlder pythonVersion;
|
|
|
|
inherit hasDistutilsCxxPatch pythonForBuild;
|
|
|
|
|
|
|
|
tests = callPackage ./tests.nix {
|
|
|
|
python = self;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
in {
|
|
|
|
|
|
|
|
python27 = callPackage ./cpython/2.7 {
|
|
|
|
self = python27;
|
|
|
|
sourceVersion = {
|
|
|
|
major = "2";
|
|
|
|
minor = "7";
|
|
|
|
patch = "18";
|
|
|
|
suffix = "";
|
|
|
|
};
|
|
|
|
sha256 = "0hzgxl94hnflis0d6m4szjx0b52gah7wpmcg5g00q7am6xwhwb5n";
|
|
|
|
inherit (darwin) configd;
|
|
|
|
inherit passthruFun;
|
|
|
|
};
|
|
|
|
|
|
|
|
python36 = callPackage ./cpython {
|
|
|
|
self = python36;
|
|
|
|
sourceVersion = {
|
|
|
|
major = "3";
|
|
|
|
minor = "6";
|
2020-09-25 04:45:31 +00:00
|
|
|
patch = "12";
|
2020-04-24 23:36:52 +00:00
|
|
|
suffix = "";
|
|
|
|
};
|
2020-09-25 04:45:31 +00:00
|
|
|
sha256 = "cJU6m11okdkuZdGEw1EhJqFYFL7hXh7/LdzOBDNOmpk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit (darwin) configd;
|
|
|
|
inherit passthruFun;
|
|
|
|
};
|
|
|
|
|
|
|
|
python37 = callPackage ./cpython {
|
|
|
|
self = python37;
|
|
|
|
sourceVersion = {
|
|
|
|
major = "3";
|
|
|
|
minor = "7";
|
2020-09-25 04:45:31 +00:00
|
|
|
patch = "9";
|
2020-04-24 23:36:52 +00:00
|
|
|
suffix = "";
|
|
|
|
};
|
2020-09-25 04:45:31 +00:00
|
|
|
sha256 = "008v6g1jkrjrdmiqlgjlq6msbbj848bvkws6ppwva1ahn03k14li";
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit (darwin) configd;
|
|
|
|
inherit passthruFun;
|
|
|
|
};
|
|
|
|
|
|
|
|
python38 = callPackage ./cpython {
|
|
|
|
self = python38;
|
|
|
|
sourceVersion = {
|
|
|
|
major = "3";
|
|
|
|
minor = "8";
|
2020-08-20 17:08:02 +00:00
|
|
|
patch = "5";
|
2020-04-24 23:36:52 +00:00
|
|
|
suffix = "";
|
|
|
|
};
|
2020-08-20 17:08:02 +00:00
|
|
|
sha256 = "1c43dbv9lvlp3ynqmgdi4rh8q94swanhqarqrdx62zmigpakw073";
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit (darwin) configd;
|
|
|
|
inherit passthruFun;
|
|
|
|
};
|
|
|
|
|
|
|
|
python39 = callPackage ./cpython {
|
|
|
|
self = python39;
|
|
|
|
sourceVersion = {
|
|
|
|
major = "3";
|
|
|
|
minor = "9";
|
|
|
|
patch = "0";
|
2020-10-07 09:15:18 +00:00
|
|
|
suffix = "";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2020-10-07 09:15:18 +00:00
|
|
|
sha256 = "0m18z05nlmqm1zjw9s0ifgrn1jvjn3jwjg0bpswhjmw5k4yfcwww";
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit (darwin) configd;
|
|
|
|
inherit passthruFun;
|
|
|
|
};
|
|
|
|
|
|
|
|
# Minimal versions of Python (built without optional dependencies)
|
2020-06-18 07:06:33 +00:00
|
|
|
python3Minimal = (python38.override {
|
2020-04-24 23:36:52 +00:00
|
|
|
self = python3Minimal;
|
|
|
|
pythonForBuild = pkgs.buildPackages.python3Minimal;
|
|
|
|
# strip down that python version as much as possible
|
|
|
|
openssl = null;
|
|
|
|
readline = null;
|
|
|
|
ncurses = null;
|
|
|
|
gdbm = null;
|
|
|
|
sqlite = null;
|
|
|
|
configd = null;
|
|
|
|
stripConfig = true;
|
|
|
|
stripIdlelib = true;
|
|
|
|
stripTests = true;
|
|
|
|
stripTkinter = true;
|
|
|
|
rebuildBytecode = false;
|
|
|
|
stripBytecode = true;
|
|
|
|
includeSiteCustomize = false;
|
2020-06-18 07:06:33 +00:00
|
|
|
enableOptimizations = false;
|
2020-04-24 23:36:52 +00:00
|
|
|
}).overrideAttrs(old: {
|
|
|
|
pname = "python3-minimal";
|
|
|
|
meta = old.meta // {
|
|
|
|
maintainers = [];
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
pypy27 = callPackage ./pypy {
|
|
|
|
self = pypy27;
|
|
|
|
sourceVersion = {
|
|
|
|
major = "7";
|
2020-08-20 17:08:02 +00:00
|
|
|
minor = "3";
|
2020-04-24 23:36:52 +00:00
|
|
|
patch = "1";
|
|
|
|
};
|
2020-08-20 17:08:02 +00:00
|
|
|
sha256 = "08ckkhd0ix6j9873a7gr507c72d4cmnv5lwvprlljdca9i8p2dzs";
|
2020-04-24 23:36:52 +00:00
|
|
|
pythonVersion = "2.7";
|
|
|
|
db = db.override { dbmSupport = !stdenv.isDarwin; };
|
|
|
|
python = python27;
|
|
|
|
inherit passthruFun;
|
|
|
|
inherit (darwin) libunwind;
|
|
|
|
inherit (darwin.apple_sdk.frameworks) Security;
|
|
|
|
};
|
|
|
|
|
|
|
|
pypy36 = callPackage ./pypy {
|
|
|
|
self = pypy36;
|
|
|
|
sourceVersion = {
|
|
|
|
major = "7";
|
2020-08-20 17:08:02 +00:00
|
|
|
minor = "3";
|
2020-04-24 23:36:52 +00:00
|
|
|
patch = "1";
|
|
|
|
};
|
2020-08-20 17:08:02 +00:00
|
|
|
sha256 = "10zsk8jby8j6visk5mzikpb1cidvz27qq4pfpa26jv53klic6b0c";
|
2020-04-24 23:36:52 +00:00
|
|
|
pythonVersion = "3.6";
|
|
|
|
db = db.override { dbmSupport = !stdenv.isDarwin; };
|
|
|
|
python = python27;
|
|
|
|
inherit passthruFun;
|
|
|
|
inherit (darwin) libunwind;
|
|
|
|
inherit (darwin.apple_sdk.frameworks) Security;
|
|
|
|
};
|
|
|
|
|
|
|
|
pypy27_prebuilt = callPackage ./pypy/prebuilt.nix {
|
|
|
|
# Not included at top-level
|
|
|
|
self = pythonInterpreters.pypy27_prebuilt;
|
|
|
|
sourceVersion = {
|
|
|
|
major = "7";
|
2020-08-20 17:08:02 +00:00
|
|
|
minor = "3";
|
2020-04-24 23:36:52 +00:00
|
|
|
patch = "1";
|
|
|
|
};
|
2020-08-20 17:08:02 +00:00
|
|
|
sha256 = "18xc5kwidj5hjwbr0w8v1nfpg5l4lk01z8cn804zfyyz8xjqhx5y"; # linux64
|
2020-04-24 23:36:52 +00:00
|
|
|
pythonVersion = "2.7";
|
|
|
|
inherit passthruFun;
|
|
|
|
};
|
|
|
|
|
|
|
|
pypy36_prebuilt = callPackage ./pypy/prebuilt.nix {
|
|
|
|
# Not included at top-level
|
|
|
|
self = pythonInterpreters.pypy36_prebuilt;
|
|
|
|
sourceVersion = {
|
|
|
|
major = "7";
|
2020-08-20 17:08:02 +00:00
|
|
|
minor = "3";
|
2020-04-24 23:36:52 +00:00
|
|
|
patch = "1";
|
|
|
|
};
|
2020-08-20 17:08:02 +00:00
|
|
|
sha256 = "04nv0mkalaliphbjw7y0pmb372bxwjzwmcsqkf9kwsik99kg2z7n"; # linux64
|
2020-04-24 23:36:52 +00:00
|
|
|
pythonVersion = "3.6";
|
|
|
|
inherit passthruFun;
|
|
|
|
};
|
|
|
|
|
|
|
|
graalpython37 = callPackage ./graalpython/default.nix {
|
|
|
|
self = pythonInterpreters.graalpython37;
|
|
|
|
inherit passthruFun;
|
|
|
|
};
|
|
|
|
|
|
|
|
})
|