diff --git a/pkgs/development/interpreters/python/hooks/default.nix b/pkgs/development/interpreters/python/hooks/default.nix index ba51c43822d470f..bb211014b3aba3b 100644 --- a/pkgs/development/interpreters/python/hooks/default.nix +++ b/pkgs/development/interpreters/python/hooks/default.nix @@ -188,7 +188,9 @@ in { name = "setuptools-rust-setup-hook"; propagatedBuildInputs = [ setuptools-rust ]; substitutions = { + pyIncludeDir = "${python}/include/${python.libPrefix}"; pyLibDir = "${python}/lib/${python.libPrefix}"; + pyBin = python.interpreter; cargoBuildTarget = rust.toRustTargetSpec stdenv.hostPlatform; cargoLinkerVar = lib.toUpper ( builtins.replaceStrings ["-"] ["_"] ( diff --git a/pkgs/development/interpreters/python/hooks/setuptools-rust-hook.sh b/pkgs/development/interpreters/python/hooks/setuptools-rust-hook.sh index 917c19ef9b31ba5..c2cda07d9bd1d81 100644 --- a/pkgs/development/interpreters/python/hooks/setuptools-rust-hook.sh +++ b/pkgs/development/interpreters/python/hooks/setuptools-rust-hook.sh @@ -7,7 +7,9 @@ setuptoolsRustSetup() { exit 1 fi - export PYO3_CROSS_LIB_DIR="@pyLibDir@" + export PYO3_CROSS_INCLUDE_DIR="@pyIncludeDir@"; + export PYO3_CROSS_LIB_DIR="@pyLibDir@"; + export PYO3_PYTHON="@pyBin@"; export CARGO_BUILD_TARGET=@cargoBuildTarget@ # TODO theoretically setting linker should not be required because it is # already set in pkgs/build-support/rust/hooks/default.nix but build fails