2020-09-17 22:45:31 +00:00
|
|
|
{ pkgs }:
|
2018-12-31 12:59:20 +00:00
|
|
|
|
|
|
|
with pkgs;
|
|
|
|
|
|
|
|
(let
|
|
|
|
|
|
|
|
# Common passthru for all Python interpreters.
|
|
|
|
passthruFun =
|
|
|
|
{ implementation
|
|
|
|
, libPrefix
|
|
|
|
, executable
|
|
|
|
, sourceVersion
|
|
|
|
, pythonVersion
|
|
|
|
, packageOverrides
|
|
|
|
, sitePackages
|
2019-04-18 02:57:20 +00:00
|
|
|
, hasDistutilsCxxPatch
|
2018-12-31 12:59:20 +00:00
|
|
|
, 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";
|
2019-10-15 04:49:46 +00:00
|
|
|
isPy38 = pythonVersion == "3.8";
|
2019-11-20 08:42:27 +00:00
|
|
|
isPy39 = pythonVersion == "3.9";
|
2020-10-13 06:28:25 +00:00
|
|
|
isPy310 = pythonVersion == "3.10";
|
2019-01-04 11:31:42 +00:00
|
|
|
isPy2 = lib.strings.substring 0 1 pythonVersion == "2";
|
|
|
|
isPy3 = lib.strings.substring 0 1 pythonVersion == "3";
|
|
|
|
isPy3k = isPy3;
|
2019-02-04 08:09:38 +00:00
|
|
|
isPyPy = lib.hasInfix "pypy" interpreter;
|
2018-12-31 12:59:20 +00:00
|
|
|
|
|
|
|
buildEnv = callPackage ./wrapper.nix { python = self; inherit (pythonPackages) requiredPythonModules; };
|
|
|
|
withPackages = import ./with-packages.nix { inherit buildEnv pythonPackages;};
|
|
|
|
pkgs = pythonPackages;
|
|
|
|
interpreter = "${self}/bin/${executable}";
|
2019-01-02 19:09:44 +00:00
|
|
|
inherit executable implementation libPrefix pythonVersion sitePackages;
|
2018-12-31 12:59:20 +00:00
|
|
|
inherit sourceVersion;
|
|
|
|
pythonAtLeast = lib.versionAtLeast pythonVersion;
|
|
|
|
pythonOlder = lib.versionOlder pythonVersion;
|
2019-04-18 02:57:20 +00:00
|
|
|
inherit hasDistutilsCxxPatch pythonForBuild;
|
2020-03-14 08:48:06 +00:00
|
|
|
|
|
|
|
tests = callPackage ./tests.nix {
|
|
|
|
python = self;
|
|
|
|
};
|
2018-12-31 12:59:20 +00:00
|
|
|
};
|
|
|
|
|
2019-12-02 19:10:51 +00:00
|
|
|
in {
|
2018-12-31 12:59:20 +00:00
|
|
|
|
|
|
|
python27 = callPackage ./cpython/2.7 {
|
|
|
|
self = python27;
|
|
|
|
sourceVersion = {
|
|
|
|
major = "2";
|
|
|
|
minor = "7";
|
2020-04-21 06:30:23 +00:00
|
|
|
patch = "18";
|
2018-12-31 12:59:20 +00:00
|
|
|
suffix = "";
|
|
|
|
};
|
2020-04-21 06:30:23 +00:00
|
|
|
sha256 = "0hzgxl94hnflis0d6m4szjx0b52gah7wpmcg5g00q7am6xwhwb5n";
|
2020-01-12 20:29:45 +00:00
|
|
|
inherit (darwin) configd;
|
2018-12-31 12:59:20 +00:00
|
|
|
inherit passthruFun;
|
|
|
|
};
|
|
|
|
|
|
|
|
python36 = callPackage ./cpython {
|
|
|
|
self = python36;
|
|
|
|
sourceVersion = {
|
|
|
|
major = "3";
|
|
|
|
minor = "6";
|
2020-08-30 06:59:42 +00:00
|
|
|
patch = "12";
|
2018-12-31 12:59:20 +00:00
|
|
|
suffix = "";
|
|
|
|
};
|
2020-08-30 06:59:42 +00:00
|
|
|
sha256 = "cJU6m11okdkuZdGEw1EhJqFYFL7hXh7/LdzOBDNOmpk=";
|
2020-01-12 20:29:45 +00:00
|
|
|
inherit (darwin) configd;
|
2018-12-31 12:59:20 +00:00
|
|
|
inherit passthruFun;
|
|
|
|
};
|
|
|
|
|
|
|
|
python37 = callPackage ./cpython {
|
|
|
|
self = python37;
|
|
|
|
sourceVersion = {
|
|
|
|
major = "3";
|
|
|
|
minor = "7";
|
2020-08-29 20:44:17 +00:00
|
|
|
patch = "9";
|
2018-12-31 12:59:20 +00:00
|
|
|
suffix = "";
|
|
|
|
};
|
2020-08-29 20:44:17 +00:00
|
|
|
sha256 = "008v6g1jkrjrdmiqlgjlq6msbbj848bvkws6ppwva1ahn03k14li";
|
2020-01-12 20:29:45 +00:00
|
|
|
inherit (darwin) configd;
|
2018-12-31 12:59:20 +00:00
|
|
|
inherit passthruFun;
|
|
|
|
};
|
|
|
|
|
2019-07-09 13:19:19 +00:00
|
|
|
python38 = callPackage ./cpython {
|
|
|
|
self = python38;
|
|
|
|
sourceVersion = {
|
|
|
|
major = "3";
|
|
|
|
minor = "8";
|
2020-09-27 09:41:23 +00:00
|
|
|
patch = "6";
|
2019-10-15 09:55:50 +00:00
|
|
|
suffix = "";
|
2019-07-09 13:19:19 +00:00
|
|
|
};
|
2020-09-27 09:41:23 +00:00
|
|
|
sha256 = "qeC3nSeqBW65zOjWOkJ7X5urFGXe4/lC3P2yWoL0q4o=";
|
2020-01-12 20:29:45 +00:00
|
|
|
inherit (darwin) configd;
|
2019-07-09 13:19:19 +00:00
|
|
|
inherit passthruFun;
|
|
|
|
};
|
|
|
|
|
2019-11-20 08:42:27 +00:00
|
|
|
python39 = callPackage ./cpython {
|
|
|
|
self = python39;
|
|
|
|
sourceVersion = {
|
|
|
|
major = "3";
|
|
|
|
minor = "9";
|
|
|
|
patch = "0";
|
2020-10-05 22:15:32 +00:00
|
|
|
suffix = "";
|
2019-11-20 08:42:27 +00:00
|
|
|
};
|
2020-10-05 22:15:32 +00:00
|
|
|
sha256 = "0m18z05nlmqm1zjw9s0ifgrn1jvjn3jwjg0bpswhjmw5k4yfcwww";
|
2020-01-12 20:29:45 +00:00
|
|
|
inherit (darwin) configd;
|
2019-11-20 08:42:27 +00:00
|
|
|
inherit passthruFun;
|
|
|
|
};
|
|
|
|
|
2020-10-13 06:28:25 +00:00
|
|
|
python310 = callPackage ./cpython {
|
|
|
|
self = python310;
|
|
|
|
sourceVersion = {
|
|
|
|
major = "3";
|
|
|
|
minor = "10";
|
|
|
|
patch = "0";
|
|
|
|
suffix = "a1";
|
|
|
|
};
|
|
|
|
sha256 = "0q59a99w1yad808mx4w6l0j7bk7dbd2kakngbk0w1h9z4dhr8wyv";
|
|
|
|
inherit (darwin) configd;
|
|
|
|
inherit passthruFun;
|
|
|
|
};
|
|
|
|
|
2019-08-17 15:33:13 +00:00
|
|
|
# Minimal versions of Python (built without optional dependencies)
|
2020-06-05 14:46:40 +00:00
|
|
|
python3Minimal = (python38.override {
|
2019-08-17 15:33:13 +00:00
|
|
|
self = python3Minimal;
|
2019-11-21 21:00:14 +00:00
|
|
|
pythonForBuild = pkgs.buildPackages.python3Minimal;
|
2019-08-17 15:33:13 +00:00
|
|
|
# strip down that python version as much as possible
|
|
|
|
openssl = null;
|
|
|
|
readline = null;
|
|
|
|
ncurses = null;
|
|
|
|
gdbm = null;
|
|
|
|
sqlite = null;
|
2020-01-12 20:29:45 +00:00
|
|
|
configd = null;
|
2019-08-17 15:33:13 +00:00
|
|
|
stripConfig = true;
|
|
|
|
stripIdlelib = true;
|
|
|
|
stripTests = true;
|
|
|
|
stripTkinter = true;
|
|
|
|
rebuildBytecode = false;
|
|
|
|
stripBytecode = true;
|
2020-03-12 13:15:02 +00:00
|
|
|
includeSiteCustomize = false;
|
2020-06-04 16:37:59 +00:00
|
|
|
enableOptimizations = false;
|
2019-08-17 15:33:13 +00:00
|
|
|
}).overrideAttrs(old: {
|
|
|
|
pname = "python3-minimal";
|
|
|
|
meta = old.meta // {
|
|
|
|
maintainers = [];
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
2019-01-01 10:34:44 +00:00
|
|
|
pypy27 = callPackage ./pypy {
|
|
|
|
self = pypy27;
|
|
|
|
sourceVersion = {
|
2019-02-12 01:52:26 +00:00
|
|
|
major = "7";
|
2020-08-10 20:34:00 +00:00
|
|
|
minor = "3";
|
2019-08-13 01:52:26 +00:00
|
|
|
patch = "1";
|
2019-01-01 10:34:44 +00:00
|
|
|
};
|
2020-08-10 20:34:00 +00:00
|
|
|
sha256 = "08ckkhd0ix6j9873a7gr507c72d4cmnv5lwvprlljdca9i8p2dzs";
|
2019-01-01 10:34:44 +00:00
|
|
|
pythonVersion = "2.7";
|
2019-10-26 09:20:00 +00:00
|
|
|
db = db.override { dbmSupport = !stdenv.isDarwin; };
|
2019-01-01 10:34:44 +00:00
|
|
|
python = python27;
|
|
|
|
inherit passthruFun;
|
2019-10-26 09:20:00 +00:00
|
|
|
inherit (darwin) libunwind;
|
|
|
|
inherit (darwin.apple_sdk.frameworks) Security;
|
2019-01-01 10:34:44 +00:00
|
|
|
};
|
|
|
|
|
2019-08-13 01:52:26 +00:00
|
|
|
pypy36 = callPackage ./pypy {
|
|
|
|
self = pypy36;
|
2019-01-01 10:34:44 +00:00
|
|
|
sourceVersion = {
|
2019-02-12 01:52:26 +00:00
|
|
|
major = "7";
|
2020-08-10 20:34:00 +00:00
|
|
|
minor = "3";
|
2019-08-13 01:52:26 +00:00
|
|
|
patch = "1";
|
2019-01-01 10:34:44 +00:00
|
|
|
};
|
2020-08-10 20:34:00 +00:00
|
|
|
sha256 = "10zsk8jby8j6visk5mzikpb1cidvz27qq4pfpa26jv53klic6b0c";
|
2019-08-13 01:52:26 +00:00
|
|
|
pythonVersion = "3.6";
|
2019-10-26 09:20:00 +00:00
|
|
|
db = db.override { dbmSupport = !stdenv.isDarwin; };
|
2019-01-01 10:34:44 +00:00
|
|
|
python = python27;
|
|
|
|
inherit passthruFun;
|
2019-10-26 09:20:00 +00:00
|
|
|
inherit (darwin) libunwind;
|
|
|
|
inherit (darwin.apple_sdk.frameworks) Security;
|
2019-01-01 10:34:44 +00:00
|
|
|
};
|
2018-12-31 12:59:20 +00:00
|
|
|
|
2019-01-03 11:00:44 +00:00
|
|
|
pypy27_prebuilt = callPackage ./pypy/prebuilt.nix {
|
|
|
|
# Not included at top-level
|
|
|
|
self = pythonInterpreters.pypy27_prebuilt;
|
|
|
|
sourceVersion = {
|
2019-08-12 11:52:14 +00:00
|
|
|
major = "7";
|
2020-08-10 08:23:15 +00:00
|
|
|
minor = "3";
|
2019-08-12 11:52:14 +00:00
|
|
|
patch = "1";
|
2019-01-03 11:00:44 +00:00
|
|
|
};
|
2020-08-10 08:23:15 +00:00
|
|
|
sha256 = "18xc5kwidj5hjwbr0w8v1nfpg5l4lk01z8cn804zfyyz8xjqhx5y"; # linux64
|
2019-01-03 11:00:44 +00:00
|
|
|
pythonVersion = "2.7";
|
|
|
|
inherit passthruFun;
|
|
|
|
};
|
|
|
|
|
2019-08-12 11:52:14 +00:00
|
|
|
pypy36_prebuilt = callPackage ./pypy/prebuilt.nix {
|
|
|
|
# Not included at top-level
|
|
|
|
self = pythonInterpreters.pypy36_prebuilt;
|
2019-01-03 11:00:44 +00:00
|
|
|
sourceVersion = {
|
2019-08-12 11:52:14 +00:00
|
|
|
major = "7";
|
2020-08-10 08:23:15 +00:00
|
|
|
minor = "3";
|
2019-08-12 11:52:14 +00:00
|
|
|
patch = "1";
|
2019-01-03 11:00:44 +00:00
|
|
|
};
|
2020-08-10 08:23:15 +00:00
|
|
|
sha256 = "04nv0mkalaliphbjw7y0pmb372bxwjzwmcsqkf9kwsik99kg2z7n"; # linux64
|
2019-08-12 11:52:14 +00:00
|
|
|
pythonVersion = "3.6";
|
2019-01-03 11:00:44 +00:00
|
|
|
inherit passthruFun;
|
|
|
|
};
|
|
|
|
|
2019-10-18 12:45:17 +00:00
|
|
|
graalpython37 = callPackage ./graalpython/default.nix {
|
|
|
|
self = pythonInterpreters.graalpython37;
|
|
|
|
inherit passthruFun;
|
|
|
|
};
|
|
|
|
|
2019-03-04 07:56:15 +00:00
|
|
|
})
|