Python: use pythonPackagesBuildHost instead of pythonForBuild

Follow-up to #104201, related to #105113.
This commit is contained in:
Frederik Rietdijk
2020-11-27 16:24:42 +01:00
parent be36f6f0a0
commit cce2fd547b
4 changed files with 26 additions and 21 deletions

View File

@@ -18,8 +18,8 @@
, ucsEncoding ? 4
# For the Python package set
, packageOverrides ? (self: super: {})
, buildPackages
, pkgsBuildBuild
, pkgsBuildHost
, pkgsBuildTarget
, pkgsHostHost
, pkgsTargetTarget
@@ -28,6 +28,7 @@
, passthruFun
, static ? false
, enableOptimizations ? (!stdenv.isDarwin)
, pythonAttr ? "python${sourceVersion.major}${sourceVersion.minor}"
}:
assert x11Support -> tcl != null
@@ -38,9 +39,8 @@ assert x11Support -> tcl != null
with stdenv.lib;
let
pythonAttr = "python${sourceVersion.major}${sourceVersion.minor}";
pythonForBuild = buildPackages.${pythonAttr};
buildPackages = pkgsBuildHost;
inherit (passthru) pythonForBuild;
passthru = passthruFun rec {
inherit self sourceVersion packageOverrides;
@@ -49,8 +49,9 @@ let
executable = libPrefix;
pythonVersion = with sourceVersion; "${major}.${minor}";
sitePackages = "lib/${libPrefix}/site-packages";
inherit hasDistutilsCxxPatch pythonForBuild;
inherit hasDistutilsCxxPatch;
pythonPackagesBuildBuild = pkgsBuildBuild.${pythonAttr};
pythonPackagesBuildHost = pkgsBuildHost.${pythonAttr};
pythonPackagesBuildTarget = pkgsBuildTarget.${pythonAttr};
pythonPackagesHostHost = pkgsHostHost.${pythonAttr};
pythonPackagesTargetTarget = pkgsTargetTarget.${pythonAttr} or {};

View File

@@ -19,12 +19,11 @@
, nukeReferences
# For the Python package set
, packageOverrides ? (self: super: {})
, buildPackages
, pkgsBuildBuild
, pkgsBuildHost
, pkgsBuildTarget
, pkgsHostHost
, pkgsTargetTarget
, pythonForBuild ? buildPackages.${pythonAttr}
, sourceVersion
, sha256
, passthruFun
@@ -58,7 +57,8 @@ assert bluezSupport -> bluez != null;
with stdenv.lib;
let
buildPackages = pkgsBuildHost;
inherit (passthru) pythonForBuild;
passthru = passthruFun rec {
inherit self sourceVersion packageOverrides;
@@ -67,8 +67,9 @@ let
executable = libPrefix;
pythonVersion = with sourceVersion; "${major}.${minor}";
sitePackages = "lib/${libPrefix}/site-packages";
inherit hasDistutilsCxxPatch pythonForBuild;
inherit hasDistutilsCxxPatch;
pythonPackagesBuildBuild = pkgsBuildBuild.${pythonAttr};
pythonPackagesBuildHost = pkgsBuildHost.${pythonAttr};
pythonPackagesBuildTarget = pkgsBuildTarget.${pythonAttr};
pythonPackagesHostHost = pkgsHostHost.${pythonAttr};
pythonPackagesTargetTarget = pkgsTargetTarget.${pythonAttr} or {};
@@ -95,8 +96,6 @@ let
hasDistutilsCxxPatch = !(stdenv.cc.isGNU or false);
inherit pythonForBuild;
pythonForBuildInterpreter = if stdenv.hostPlatform == stdenv.buildPlatform then
"$out/bin/python"
else pythonForBuild.interpreter;