Skip to content

Commit

Permalink
Revert "Undo python fixes and move them to separate branch."
Browse files Browse the repository at this point in the history
This reverts commit 391d3af.
  • Loading branch information
prinzdezibel committed Dec 9, 2024
1 parent 290667b commit 44e5d71
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions pkgs/build-support/rust/hooks/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,17 @@
, rust
, rustc
, stdenv
, python3

# This confusingly-named parameter indicates the *subdirectory of
# `target/` from which to copy the build artifacts. It is derived
# from a stdenv platform (or a JSON file).
, target ? stdenv.hostPlatform.rust.cargoShortTarget
}:
let
inherit (python3) pythonOnBuildForHost;
pythonInterpreter = pythonOnBuildForHost.interpreter;
in
{
cargoBuildHook = callPackage ({ }:
makeSetupHook {
Expand Down Expand Up @@ -75,6 +80,7 @@
};
} ./cargo-setup-hook.sh) {};


maturinBuildHook = callPackage ({ pkgsHostTarget }:
makeSetupHook {
name = "maturin-build-hook.sh";
Expand All @@ -85,6 +91,7 @@
];
substitutions = {
inherit (rust.envVars) rustTargetPlatformSpec setEnv;
pythonInterpreter = builtins.elemAt (builtins.match "([0-9]+\.[0-9]+)\.*" python3.version) 0;
};
} ./maturin-build-hook.sh) {};

Expand Down
1 change: 1 addition & 0 deletions pkgs/build-support/rust/hooks/maturin-build-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ maturinBuildHook() {

local flagsArray=(
"--jobs=$NIX_BUILD_CORES"
"--interpreter=@pythonInterpreter@"
"--offline"
"--target" "@rustTargetPlatformSpec@"
"--manylinux" "off"
Expand Down
3 changes: 2 additions & 1 deletion pkgs/by-name/ma/maturin/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ rustPlatform.buildRustPackage rec {

cargoHash = "sha256-yLKt/Xml7ig6QG3T5Qn39tW7U5NIN1hSOaLiSRMiy5I=";

buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [

buildInputs = [python3] ++ lib.optionals stdenv.hostPlatform.isDarwin [
darwin.apple_sdk.frameworks.Security
libiconv
];
Expand Down
2 changes: 2 additions & 0 deletions pkgs/development/python-modules/rpds-py/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
rustc,
rustPlatform,
libiconv,
python3
}:

buildPythonPackage rec {
Expand All @@ -35,6 +36,7 @@ buildPythonPackage rec {
rustPlatform.maturinBuildHook
cargo
rustc
python3
];

buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
Expand Down

0 comments on commit 44e5d71

Please sign in to comment.