nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at 17.09 37 lines 1.2 kB view raw
1{ stdenv, fetchFromGitHub, rustPlatform, makeWrapper, llvmPackages }: 2 3# Future work: Automatically communicate NIX_CFLAGS_COMPILE to bindgen's tests and the bindgen executable itself. 4 5rustPlatform.buildRustPackage rec { 6 name = "rust-bindgen-${version}"; 7 version = "0.30.0"; 8 9 src = fetchFromGitHub { 10 owner = "rust-lang-nursery"; 11 repo = "rust-bindgen"; 12 rev = "v${version}"; 13 sha256 = "02ic48qng76rvwa54i8zkvqgr8kfsyj3axc08naylzcvwzp84bsf"; 14 }; 15 16 nativeBuildInputs = [ makeWrapper ]; 17 buildInputs = [ llvmPackages.clang-unwrapped ]; 18 19 configurePhase = '' 20 export LIBCLANG_PATH="${llvmPackages.clang-unwrapped}/lib" 21 ''; 22 23 postInstall = '' 24 wrapProgram $out/bin/bindgen --set LIBCLANG_PATH "${llvmPackages.clang-unwrapped}/lib" 25 ''; 26 27 depsSha256 = "06b5zyw9p7h73h30c1nlnwjb0zmkfx52wqsl9b14y9hx51g9bw0r"; 28 29 doCheck = false; # A test fails because it can't find standard headers in NixOS 30 31 meta = with stdenv.lib; { 32 description = "C and C++ binding generator"; 33 homepage = https://github.com/rust-lang-nursery/rust-bindgen; 34 license = with licenses; [ bsd3 ]; 35 maintainers = [ maintainers.ralith ]; 36 }; 37}