diff options
author | Adam Joseph <adam@westernsemico.com> | 2023-04-22 12:53:23 -0700 |
---|---|---|
committer | Adam Joseph <adam@westernsemico.com> | 2023-04-22 14:41:58 -0700 |
commit | 0ac955ad63e2f94c64de584551493ceb33b00b45 (patch) | |
tree | 3bfd240e53c8975f81e00a9cce81a37fefaa0947 /pkgs/development/compilers/rust | |
parent | ad3a53265807daf53c1e64482ad710a93fe8f1ce (diff) | |
download | nixpkgs-0ac955ad63e2f94c64de584551493ceb33b00b45.tar nixpkgs-0ac955ad63e2f94c64de584551493ceb33b00b45.tar.gz nixpkgs-0ac955ad63e2f94c64de584551493ceb33b00b45.tar.bz2 nixpkgs-0ac955ad63e2f94c64de584551493ceb33b00b45.tar.lz nixpkgs-0ac955ad63e2f94c64de584551493ceb33b00b45.tar.xz nixpkgs-0ac955ad63e2f94c64de584551493ceb33b00b45.tar.zst nixpkgs-0ac955ad63e2f94c64de584551493ceb33b00b45.zip |
rust/cargo.nix: set HOST_PKG_CONFIG_PATH for cross builds
Prior to this commit, builds of `pkgsCross.aarch64-multiplatform.cargo` would fail due to being unable to find `-lz` when compiling cargo's own `build.rs` for the `buildPlatform`. This environment variable uses the (very confusing) LLVM convention of calling the buildPlatform "HOST". Co-authored-by: figsoda <figsoda@pm.me>
Diffstat (limited to 'pkgs/development/compilers/rust')
-rw-r--r-- | pkgs/development/compilers/rust/cargo-auditable.nix | 4 | ||||
-rw-r--r-- | pkgs/development/compilers/rust/cargo.nix | 10 |
2 files changed, 8 insertions, 6 deletions
diff --git a/pkgs/development/compilers/rust/cargo-auditable.nix b/pkgs/development/compilers/rust/cargo-auditable.nix index 49968cc899b..dbbfff4dc6b 100644 --- a/pkgs/development/compilers/rust/cargo-auditable.nix +++ b/pkgs/development/compilers/rust/cargo-auditable.nix @@ -1,6 +1,4 @@ -{ lib -, stdenv -, fetchFromGitHub, makeRustPlatform, rustc, cargo, installShellFiles }: +{ lib, fetchFromGitHub, makeRustPlatform, rustc, cargo, installShellFiles, stdenv }: let args = rec { diff --git a/pkgs/development/compilers/rust/cargo.nix b/pkgs/development/compilers/rust/cargo.nix index 705d172e4fc..beb1912658c 100644 --- a/pkgs/development/compilers/rust/cargo.nix +++ b/pkgs/development/compilers/rust/cargo.nix @@ -1,14 +1,15 @@ { lib, stdenv, pkgsBuildHost, pkgsHostHost , file, curl, pkg-config, python3, openssl, cmake, zlib -, installShellFiles, makeWrapper, rustPlatform, rustc +, installShellFiles, makeWrapper, rustPlatform, rust, rustc , CoreFoundation, Security , auditable ? !cargo-auditable.meta.broken , cargo-auditable +, pkgsBuildBuild }: -rustPlatform.buildRustPackage.override (lib.optionalAttrs (!cargo-auditable.meta.broken) { +rustPlatform.buildRustPackage.override { cargo-auditable = cargo-auditable.bootstrap; -}) { +} ({ pname = "cargo"; inherit (rustc) version src; @@ -113,3 +114,6 @@ rustPlatform.buildRustPackage.override (lib.optionalAttrs (!cargo-auditable.meta platforms = platforms.unix; }; } +// lib.optionalAttrs (rust.toRustTarget stdenv.buildPlatform != rust.toRustTarget stdenv.hostPlatform) { + HOST_PKG_CONFIG_PATH="${pkgsBuildBuild.pkg-config}/bin/pkg-config"; +}) |