forked from mirrors/nixpkgs
38 lines
1.1 KiB
Nix
38 lines
1.1 KiB
Nix
{ stdenv, fetchFromGitHub, rustPlatform, makeWrapper, llvmPackages }:
|
|
|
|
# Future work: Automatically communicate NIX_CFLAGS_COMPILE to bindgen's tests and the bindgen executable itself.
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
name = "rust-bindgen-${version}";
|
|
version = "0.29.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "rust-lang-nursery";
|
|
repo = "rust-bindgen";
|
|
rev = "v${version}";
|
|
sha256 = "190nilbqch8w2hcdmzgkk2npgsn49a4y9c5r0mxa9d7nz7h0imxk";
|
|
};
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
buildInputs = [ llvmPackages.clang-unwrapped ];
|
|
|
|
configurePhase = ''
|
|
export LIBCLANG_PATH="${llvmPackages.clang-unwrapped}/lib"
|
|
'';
|
|
|
|
postInstall = ''
|
|
wrapProgram $out/bin/bindgen --set LIBCLANG_PATH "${llvmPackages.clang-unwrapped}/lib"
|
|
'';
|
|
|
|
depsSha256 = "1y55xdqsk200hj5dhbigsgsx11w5cfxms84hhyl9y7w6jszbzxzw";
|
|
|
|
doCheck = false; # A test fails because it can't find standard headers in NixOS
|
|
|
|
meta = with stdenv.lib; {
|
|
description = "C and C++ binding generator";
|
|
homepage = https://github.com/rust-lang-nursery/rust-bindgen;
|
|
license = with licenses; [ bsd3 ];
|
|
maintainers = [ maintainers.ralith ];
|
|
};
|
|
}
|