Adjust for renaming of pythonForBuild to pythonOnBuildForHost

The upstream Nixpkgs renamed `pythonForBuild` to `pythonOnBuildForHost`
and made `pythonForBuild` emit warnings: NixOS/nixpkgs#265764.  Adjust
the poetry2nix code to avoid warnings with the new version, while still
keeping compatibility with the old one.
This commit is contained in:
Sergey Vlasov 2024-02-01 10:03:24 +03:00
parent e0b44e9e2d
commit 8fb6db1d12
2 changed files with 8 additions and 8 deletions

View file

@ -1,11 +1,11 @@
{ python, stdenv, makeSetupHook, pkgs, lib }:
let
inherit (python) pythonForBuild;
inherit (pythonForBuild.pkgs) callPackage;
pythonInterpreter = pythonForBuild.interpreter;
pythonOnBuildForHost = python.pythonOnBuildForHost or python.pythonForBuild;
inherit (pythonOnBuildForHost.pkgs) callPackage;
pythonInterpreter = pythonOnBuildForHost.interpreter;
pythonSitePackages = python.sitePackages;
nonOverlayedPython = pkgs.python3.pythonForBuild.withPackages (ps: [ ps.tomlkit ]);
nonOverlayedPython = (pkgs.python3.pythonOnBuildForHost or pkgs.python3.pythonForBuild).withPackages (ps: [ ps.tomlkit ]);
makeRemoveSpecialDependenciesHook =
{ fields
, kind

View file

@ -25,13 +25,13 @@ let
true;
intendedBuildSystem =
if attr.buildSystem == "cython" then
self.python.pythonForBuild.pkgs.cython
(self.python.pythonOnBuildForHost or self.python.pythonForBuild).pkgs.cython
else
self.${attr.buildSystem};
in
if fromIsValid && untilIsValid then intendedBuildSystem else null
else
if attr == "cython" then self.python.pythonForBuild.pkgs.cython else self.${attr};
if attr == "cython" then (self.python.pythonOnBuildForHost or self.python.pythonForBuild).pkgs.cython else self.${attr};
in
if (attr == "flit-core" || attr == "flit" || attr == "hatchling") && !self.isPy3k then drv
else if drv == null then null
@ -101,7 +101,7 @@ lib.composeManyExtensions [
let
inherit (self.python) stdenv;
inherit (pkgs.buildPackages) pkg-config;
pyBuildPackages = self.python.pythonForBuild.pkgs;
pyBuildPackages = (self.python.pythonOnBuildForHost or self.python.pythonForBuild).pkgs;
selectQt5 = version:
let
@ -129,7 +129,7 @@ lib.composeManyExtensions [
qtxmlpatterns
];
bootstrappingBase = pkgs.${self.python.pythonAttr}.pythonForBuild.pkgs;
bootstrappingBase = (pkgs.${self.python.pythonAttr}.pythonOnBuildForHost or pkgs.${self.python.pythonAttr}.pythonForBuild).pkgs;
in
{