commit 1d453b6089ee56bb6f9bf7798a006fbc59639ca7 parent e91a16617b77efbebffdd3d21e93b7af65b14286 Author: William Casarin <jb55@jb55.com> Date: Thu, 7 Jul 2022 08:53:55 -0700 shell.nix: update for rust build Signed-off-by: William Casarin <jb55@jb55.com> Diffstat:
M | shell.nix | | | 35 | ++++++++++++++++++++++++++++++++++- |
1 file changed, 34 insertions(+), 1 deletion(-)
diff --git a/shell.nix b/shell.nix @@ -1,5 +1,38 @@ { pkgs ? import <nixpkgs> {} }: pkgs.mkShell { buildInputs = [ ]; - nativeBuildInputs = with pkgs; [ gdb autoreconfHook emscripten wabt go pkgconfig ]; + nativeBuildInputs = with pkgs; [ + gdb + autoreconfHook + emscripten + go + pkgconfig + rustup + llvmPackages_latest.llvm + llvmPackages_latest.bintools + zlib.out + llvmPackages_latest.lld + python3 + ]; + + RUSTC_VERSION = "nightly-2021-09-19"; + LIBCLANG_PATH= pkgs.lib.makeLibraryPath [ pkgs.llvmPackages_latest.libclang.lib ]; + HISTFILE=toString ./.history; + + shellHook = '' + export PATH=$PATH:~/.cargo/bin + export PATH=$PATH:~/.rustup/toolchains/$RUSTC_VERSION-x86_64-unknown-linux-gnu/bin/ + ''; + + BINDGEN_EXTRA_CLANG_ARGS = + # Includes with normal include path + (builtins.map (a: ''-I"${a}/include"'') [ + pkgs.glibc.dev + ]) + # Includes with special directory paths + ++ [ + ''-I"${pkgs.llvmPackages_latest.libclang.lib}/lib/clang/${pkgs.llvmPackages_latest.libclang.version}/include"'' + ''-I"${pkgs.glib.dev}/include/glib-2.0"'' + ''-I${pkgs.glib.out}/lib/glib-2.0/include/'' + ]; }