···464464 be disabled by setting `dontUseCargoParallelTests`.465465* `cargoInstallHook`: install binaries and static/shared libraries466466 that were built using `cargoBuildHook`.467467+* `bindgenHook`: for crates which use `bindgen` as a build dependency, lets468468+ `bindgen` find `libclang` and `libclang` find the libraries in `buildInputs`.467469468470### Examples {#examples}469471
···11+# populates LIBCLANG_PATH and BINDGEN_EXTRA_CLANG_ARGS for rust projects that22+# depend on the bindgen crate33+44+# if you modify this, you probably also need to modify the wrapper for the cli55+# of bindgen in pkgs/development/tools/rust/bindgen/wrapper.sh66+77+populateBindgenEnv () {88+ export LIBCLANG_PATH=@libclang@/lib99+ BINDGEN_EXTRA_CLANG_ARGS="$(< @clang@/nix-support/cc-cflags) $(< @clang@/nix-support/libc-cflags) $(< @clang@/nix-support/libcxx-cxxflags) $NIX_CFLAGS_COMPILE"1010+ export BINDGEN_EXTRA_CLANG_ARGS1111+}1212+1313+postHook="${postHook:-}"$'\n'"populateBindgenEnv"$'\n'
···3434 touch $out3535 '';3636 };3737- } ''3737+ }3838+ # if you modify the logic to find the right clang flags, also modify rustPlatform.bindgenHook3939+ ''3840 mkdir -p $out/bin3941 export cincludes="$(< ${clang}/nix-support/cc-cflags) $(< ${clang}/nix-support/libc-cflags)"4042 export cxxincludes="$(< ${clang}/nix-support/libcxx-cxxflags)"