Merge branch 'master' into staging-next
There ver very many conflicts, basically all due to name -> pname+version. Fortunately, almost everything was auto-resolved by kdiff3, and for now I just fixed up a couple evaluation problems, as verified by the tarball job. There might be some fallback to these conflicts, but I believe it should be minimal. Hydra nixpkgs: ?compare=1538299
This commit is contained in:
@@ -21,6 +21,12 @@
|
||||
, sha256
|
||||
, passthruFun
|
||||
, bash
|
||||
, stripConfig ? false
|
||||
, stripIdlelib ? false
|
||||
, stripTests ? false
|
||||
, stripTkinter ? false
|
||||
, rebuildBytecode ? true
|
||||
, stripBytecode ? false
|
||||
}:
|
||||
|
||||
assert x11Support -> tcl != null
|
||||
@@ -134,6 +140,7 @@ in with passthru; stdenv.mkDerivation {
|
||||
"--without-ensurepip"
|
||||
"--with-system-expat"
|
||||
"--with-system-ffi"
|
||||
] ++ optionals (openssl != null) [
|
||||
"--with-openssl=${openssl.dev}"
|
||||
] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
||||
"ac_cv_buggy_getaddrinfo=no"
|
||||
@@ -221,8 +228,20 @@ in with passthru; stdenv.mkDerivation {
|
||||
find $out/lib/python*/config-* -type f -print -exec nuke-refs -e $out '{}' +
|
||||
find $out/lib -name '_sysconfigdata*.py*' -print -exec nuke-refs -e $out '{}' +
|
||||
|
||||
'' + optionalString stripConfig ''
|
||||
rm -R $out/bin/python*-config $out/lib/python*/config-*
|
||||
'' + optionalString stripIdlelib ''
|
||||
# Strip IDLE (and turtledemo, which uses it)
|
||||
rm -R $out/bin/idle* $out/lib/python*/{idlelib,turtledemo}
|
||||
'' + optionalString stripTkinter ''
|
||||
rm -R $out/lib/python*/tkinter
|
||||
'' + optionalString stripTests ''
|
||||
# Strip tests
|
||||
rm -R $out/lib/python*/test $out/lib/python*/**/test{,s}
|
||||
'' + ''
|
||||
# Include a sitecustomize.py file
|
||||
cp ${../sitecustomize.py} $out/${sitePackages}/sitecustomize.py
|
||||
'' + optionalString rebuildBytecode ''
|
||||
|
||||
# Determinism: rebuild all bytecode
|
||||
# We exclude lib2to3 because that's Python 2 code which fails
|
||||
@@ -232,6 +251,8 @@ in with passthru; stdenv.mkDerivation {
|
||||
find $out -name "*.py" | ${pythonForBuildInterpreter} -m compileall -q -f -x "lib2to3" -i -
|
||||
find $out -name "*.py" | ${pythonForBuildInterpreter} -O -m compileall -q -f -x "lib2to3" -i -
|
||||
find $out -name "*.py" | ${pythonForBuildInterpreter} -OO -m compileall -q -f -x "lib2to3" -i -
|
||||
'' + optionalString stripBytecode ''
|
||||
find $out -type d -name __pycache__ -print0 | xargs -0 -I {} rm -rf "{}"
|
||||
'';
|
||||
|
||||
preFixup = stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
|
||||
@@ -241,9 +262,9 @@ in with passthru; stdenv.mkDerivation {
|
||||
|
||||
# Enforce that we don't have references to the OpenSSL -dev package, which we
|
||||
# explicitly specify in our configure flags above.
|
||||
disallowedReferences = [
|
||||
openssl.dev
|
||||
] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
||||
disallowedReferences =
|
||||
stdenv.lib.optionals (openssl != null) [ openssl.dev ]
|
||||
++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
||||
# Ensure we don't have references to build-time packages.
|
||||
# These typically end up in shebangs.
|
||||
pythonForBuild buildPackages.bash
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ stdenv, substituteAll, fetchurl
|
||||
, zlib ? null, zlibSupport ? true, bzip2, pkgconfig, libffi
|
||||
, sqlite, openssl, ncurses, python, expat, tcl, tk, tix, xlibsWrapper, libX11
|
||||
, sqlite, openssl_1_0_2, ncurses, python, expat, tcl, tk, tix, xlibsWrapper, libX11
|
||||
, self, gdbm, db, lzma
|
||||
, python-setup-hook
|
||||
# For the Python package set
|
||||
@@ -40,7 +40,7 @@ in with passthru; stdenv.mkDerivation rec {
|
||||
|
||||
nativeBuildInputs = [ pkgconfig ];
|
||||
buildInputs = [
|
||||
bzip2 openssl pythonForPypy libffi ncurses expat sqlite tk tcl xlibsWrapper libX11 gdbm db
|
||||
bzip2 openssl_1_0_2 pythonForPypy libffi ncurses expat sqlite tk tcl xlibsWrapper libX11 gdbm db
|
||||
] ++ optionals isPy3k [
|
||||
lzma
|
||||
] ++ optionals (stdenv ? cc && stdenv.cc.libc != null) [
|
||||
|
||||
Reference in New Issue
Block a user