python3Minimal: Add top-level for a minimal Python 3 build

This builds Python without optional dependencies.

We can't just use python3.override, as things like
python3Minimal.withPackages would pass the wrong python derivation into
these modules.
This commit is contained in:
adisbladis 2019-08-17 16:33:13 +01:00 committed by Florian Klink
parent 100eae3b77
commit 99e6ca2bdc
2 changed files with 33 additions and 1 deletions

View File

@ -111,6 +111,38 @@ in {
inherit passthruFun;
};
# Minimal versions of Python (built without optional dependencies)
python3Minimal = (callPackage ./cpython {
self = python3Minimal;
sourceVersion = {
major = "3";
minor = "7";
patch = "4";
suffix = "";
};
sha256 = "0gxiv5617zd7dnqm5k9r4q2188lk327nf9jznwq9j6b8p0s92ygv";
inherit (darwin) CF configd;
inherit passthruFun;
# strip down that python version as much as possible
openssl = null;
readline = null;
ncurses = null;
gdbm = null;
sqlite = null;
stripConfig = true;
stripIdlelib = true;
stripTests = true;
stripTkinter = true;
rebuildBytecode = false;
stripBytecode = true;
}).overrideAttrs(old: {
pname = "python3-minimal";
meta = old.meta // {
maintainers = [];
};
});
pypy27 = callPackage ./pypy {
self = pypy27;
sourceVersion = {

View File

@ -8754,7 +8754,7 @@ in
python3Packages = python3.pkgs;
pythonInterpreters = callPackage ./../development/interpreters/python {};
inherit (pythonInterpreters) python27 python35 python36 python37 python38 pypy27 pypy36;
inherit (pythonInterpreters) python27 python35 python36 python37 python38 python3Minimal pypy27 pypy36;
# Python package sets.
python27Packages = lib.hiPrioSet (recurseIntoAttrs python27.pkgs);