Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1# populates LIBCLANG_PATH and BINDGEN_EXTRA_CLANG_ARGS for rust projects that
2# depend on the bindgen crate
3
4# if you modify this, you probably also need to modify the wrapper for the cli
5# of bindgen in pkgs/development/tools/rust/bindgen/wrapper.sh
6
7populateBindgenEnv () {
8 export LIBCLANG_PATH=@libclang@/lib
9 BINDGEN_EXTRA_CLANG_ARGS="$(< @clang@/nix-support/cc-cflags) $(< @clang@/nix-support/libc-cflags) $(< @clang@/nix-support/libcxx-cxxflags) $NIX_CFLAGS_COMPILE"
10 export BINDGEN_EXTRA_CLANG_ARGS
11}
12
13postHook="${postHook:-}"$'\n'"populateBindgenEnv"$'\n'