buildRustCrate: add libiconv to nativeBuildInputs on darwin
Fixes linker errors while building build.rs where it tries to link libiconv but cannot find it. Rust executable build for Darwin need libiconv, and indeed buildInputs already has this case handled. So why is another change needed? Suppose we are cross compiling from Darwin (the build platform) to something else, and the package has a build.rs build script. The build script is built for the build platform (Darwin) and is also a regular Rust executable, needing libiconv, but due to cross compilation (and strict deps) we need an extra nativeBuildInput.
This commit is contained in:
parent
3d57138bd9
commit
856936abc8
|
@ -276,7 +276,9 @@ crate_: lib.makeOverridable
|
|||
name = "rust_${crate.crateName}-${crate.version}${lib.optionalString buildTests_ "-test"}";
|
||||
version = crate.version;
|
||||
depsBuildBuild = [ pkgsBuildBuild.stdenv.cc ];
|
||||
nativeBuildInputs = [ rust stdenv.cc cargo jq ] ++ (crate.nativeBuildInputs or [ ]) ++ nativeBuildInputs_;
|
||||
nativeBuildInputs = [ rust stdenv.cc cargo jq ]
|
||||
++ lib.optionals stdenv.buildPlatform.isDarwin [ libiconv ]
|
||||
++ (crate.nativeBuildInputs or [ ]) ++ nativeBuildInputs_;
|
||||
buildInputs = lib.optionals stdenv.isDarwin [ libiconv ] ++ (crate.buildInputs or [ ]) ++ buildInputs_;
|
||||
dependencies = map lib.getLib dependencies_;
|
||||
buildDependencies = map lib.getLib buildDependencies_;
|
||||
|
|
Loading…
Reference in a new issue