2018-12-31 12:59:20 +00:00
|
|
|
{ pkgs, lib }:
|
|
|
|
|
|
|
|
with pkgs;
|
|
|
|
|
|
|
|
(let
|
|
|
|
|
|
|
|
# Common passthru for all Python interpreters.
|
|
|
|
passthruFun =
|
|
|
|
{ implementation
|
|
|
|
, libPrefix
|
|
|
|
, executable
|
|
|
|
, sourceVersion
|
|
|
|
, pythonVersion
|
|
|
|
, packageOverrides
|
|
|
|
, sitePackages
|
2019-04-18 03:57:20 +01: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";
|
|
|
|
isPy33 = pythonVersion == "3.3"; # TODO: remove
|
|
|
|
isPy34 = pythonVersion == "3.4"; # TODO: remove
|
|
|
|
isPy35 = pythonVersion == "3.5";
|
|
|
|
isPy36 = pythonVersion == "3.6";
|
|
|
|
isPy37 = pythonVersion == "3.7";
|
2019-10-15 05:49:46 +01:00
|
|
|
isPy38 = pythonVersion == "3.8";
|
2019-11-20 08:42:27 +00:00
|
|
|
isPy39 = pythonVersion == "3.9";
|
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 03:57:20 +01: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";
|
2019-10-20 10:14:16 +01:00
|
|
|
patch = "17";
|
2018-12-31 12:59:20 +00:00
|
|
|
suffix = "";
|
|
|
|
};
|
2019-10-20 10:14:16 +01:00
|
|
|
sha256 = "0hds28cg226m8j8sr394nm9yc4gxhvlv109w0avsf2mxrlrz0hsd";
|
2020-01-12 20:29:45 +00:00
|
|
|
inherit (darwin) configd;
|
2018-12-31 12:59:20 +00:00
|
|
|
inherit passthruFun;
|
|
|
|
};
|
|
|
|
|
|
|
|
python35 = callPackage ./cpython {
|
|
|
|
self = python35;
|
|
|
|
sourceVersion = {
|
|
|
|
major = "3";
|
|
|
|
minor = "5";
|
2019-11-03 10:20:09 +00:00
|
|
|
patch = "9";
|
2018-12-31 12:59:20 +00:00
|
|
|
suffix = "";
|
|
|
|
};
|
2019-11-03 10:20:09 +00:00
|
|
|
sha256 = "0jdh9pvx6m6lfz2liwvvhn7vks7qrysqgwn517fkpxb77b33fjn2";
|
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";
|
2019-12-19 16:35:11 +00:00
|
|
|
patch = "10";
|
2018-12-31 12:59:20 +00:00
|
|
|
suffix = "";
|
|
|
|
};
|
2019-12-19 16:35:11 +00:00
|
|
|
sha256 = "1pj0mz1xl27khi250p29c0y99vxg662js8zp71aprkf8i8wkr0qa";
|
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-03-12 08:23:00 +00:00
|
|
|
patch = "7";
|
2018-12-31 12:59:20 +00:00
|
|
|
suffix = "";
|
|
|
|
};
|
2020-03-12 08:23:00 +00:00
|
|
|
sha256 = "0di1y2cna823qgk6sd2lvpjdm3g2qikdd50i2bjd330dpzqsk806";
|
2020-01-12 20:29:45 +00:00
|
|
|
inherit (darwin) configd;
|
2018-12-31 12:59:20 +00:00
|
|
|
inherit passthruFun;
|
|
|
|
};
|
|
|
|
|
2019-07-09 14:19:19 +01:00
|
|
|
python38 = callPackage ./cpython {
|
|
|
|
self = python38;
|
|
|
|
sourceVersion = {
|
|
|
|
major = "3";
|
|
|
|
minor = "8";
|
2020-03-02 21:42:33 +00:00
|
|
|
patch = "2";
|
2019-10-15 10:55:50 +01:00
|
|
|
suffix = "";
|
2019-07-09 14:19:19 +01:00
|
|
|
};
|
2020-03-02 21:42:33 +00:00
|
|
|
sha256 = "1ps5v323cp5czfshqjmbsqw7nvrdpcbk06f62jbzaqik4gfffii6";
|
2020-01-12 20:29:45 +00:00
|
|
|
inherit (darwin) configd;
|
2019-07-09 14:19:19 +01:00
|
|
|
inherit passthruFun;
|
|
|
|
};
|
|
|
|
|
2019-11-20 08:42:27 +00:00
|
|
|
python39 = callPackage ./cpython {
|
|
|
|
self = python39;
|
|
|
|
sourceVersion = {
|
|
|
|
major = "3";
|
|
|
|
minor = "9";
|
|
|
|
patch = "0";
|
2020-03-02 21:44:08 +00:00
|
|
|
suffix = "a4";
|
2019-11-20 08:42:27 +00:00
|
|
|
};
|
2020-03-02 21:44:08 +00:00
|
|
|
sha256 = "0qzy0wlq0izxk8ii28gy70v138g6xnz9sgsxpyayls2j04l6b5vz";
|
2020-01-12 20:29:45 +00:00
|
|
|
inherit (darwin) configd;
|
2019-11-20 08:42:27 +00:00
|
|
|
inherit passthruFun;
|
|
|
|
};
|
|
|
|
|
2019-08-17 16:33:13 +01:00
|
|
|
# Minimal versions of Python (built without optional dependencies)
|
2019-11-20 17:24:17 +00:00
|
|
|
python3Minimal = (python37.override {
|
2019-08-17 16:33:13 +01:00
|
|
|
self = python3Minimal;
|
2019-11-21 21:00:14 +00:00
|
|
|
pythonForBuild = pkgs.buildPackages.python3Minimal;
|
2019-08-17 16:33:13 +01: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 16:33:13 +01:00
|
|
|
stripConfig = true;
|
|
|
|
stripIdlelib = true;
|
|
|
|
stripTests = true;
|
|
|
|
stripTkinter = true;
|
|
|
|
rebuildBytecode = false;
|
|
|
|
stripBytecode = true;
|
2020-03-12 13:15:02 +00:00
|
|
|
includeSiteCustomize = false;
|
2019-08-17 16:33:13 +01: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";
|
2019-08-13 02:52:26 +01:00
|
|
|
minor = "1";
|
|
|
|
patch = "1";
|
2019-01-01 10:34:44 +00:00
|
|
|
};
|
2019-08-13 02:52:26 +01:00
|
|
|
sha256 = "0yq6ln1ic476sasp8zs4mg5i9524l1p96qwanp486rr1yza1grlg";
|
2019-01-01 10:34:44 +00:00
|
|
|
pythonVersion = "2.7";
|
2019-10-26 10:20:00 +01:00
|
|
|
db = db.override { dbmSupport = !stdenv.isDarwin; };
|
2019-01-01 10:34:44 +00:00
|
|
|
python = python27;
|
|
|
|
inherit passthruFun;
|
2019-10-26 10:20:00 +01:00
|
|
|
inherit (darwin) libunwind;
|
|
|
|
inherit (darwin.apple_sdk.frameworks) Security;
|
2019-01-01 10:34:44 +00:00
|
|
|
};
|
|
|
|
|
2019-08-13 02:52:26 +01: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";
|
2019-08-13 02:52:26 +01:00
|
|
|
minor = "1";
|
|
|
|
patch = "1";
|
2019-01-01 10:34:44 +00:00
|
|
|
};
|
2019-08-13 02:52:26 +01:00
|
|
|
sha256 = "1hqvnran7d2dzj5555n7q680dyzhmbklz04pvkxgb5j604v7kkx1";
|
|
|
|
pythonVersion = "3.6";
|
2019-10-26 10:20:00 +01:00
|
|
|
db = db.override { dbmSupport = !stdenv.isDarwin; };
|
2019-01-01 10:34:44 +00:00
|
|
|
python = python27;
|
|
|
|
inherit passthruFun;
|
2019-10-26 10:20:00 +01: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 12:52:14 +01:00
|
|
|
major = "7";
|
|
|
|
minor = "1";
|
|
|
|
patch = "1";
|
2019-01-03 11:00:44 +00:00
|
|
|
};
|
2019-08-12 12:52:14 +01:00
|
|
|
sha256 = "0rlx4x9xy9h989w6sy4h7lknm00956r30c5gjxwsvf8fhvq9xc3k"; # linux64
|
2019-01-03 11:00:44 +00:00
|
|
|
pythonVersion = "2.7";
|
|
|
|
inherit passthruFun;
|
|
|
|
ncurses = ncurses5;
|
|
|
|
};
|
|
|
|
|
2019-08-12 12:52:14 +01: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 12:52:14 +01:00
|
|
|
major = "7";
|
|
|
|
minor = "1";
|
|
|
|
patch = "1";
|
2019-01-03 11:00:44 +00:00
|
|
|
};
|
2019-08-12 12:52:14 +01:00
|
|
|
sha256 = "1c1xx6dm1n4xvh1vd3rcvyyixm5jm9rvzisji1a5bc9l38xzc540"; # linux64
|
|
|
|
pythonVersion = "3.6";
|
2019-01-03 11:00:44 +00:00
|
|
|
inherit passthruFun;
|
|
|
|
ncurses = ncurses5;
|
|
|
|
};
|
|
|
|
|
2019-10-18 13:45:17 +01:00
|
|
|
graalpython37 = callPackage ./graalpython/default.nix {
|
|
|
|
self = pythonInterpreters.graalpython37;
|
|
|
|
inherit passthruFun;
|
|
|
|
};
|
|
|
|
|
2019-03-04 07:56:15 +00:00
|
|
|
})
|