2017-05-05 07:17:56 +02:00
|
|
|
{ stdenv, fetchFromGitHub, rustPlatform, makeWrapper, llvmPackages }:
|
2016-11-23 18:09:29 +01:00
|
|
|
|
|
|
|
# Future work: Automatically communicate NIX_CFLAGS_COMPILE to bindgen's tests and the bindgen executable itself.
|
|
|
|
|
2017-03-22 03:00:11 +01:00
|
|
|
rustPlatform.buildRustPackage rec {
|
2016-11-23 18:09:29 +01:00
|
|
|
name = "rust-bindgen-${version}";
|
2017-12-19 21:06:05 +01:00
|
|
|
version = "0.32.1";
|
2016-11-23 18:09:29 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2017-07-28 12:33:03 +02:00
|
|
|
owner = "rust-lang-nursery";
|
2016-11-23 18:09:29 +01:00
|
|
|
repo = "rust-bindgen";
|
2017-12-19 21:06:05 +01:00
|
|
|
rev = version;
|
|
|
|
sha256 = "15m1y468c7ixzxwx29wazag0i19a3bmzjp53np6b62sf9wfzbsfa";
|
2016-11-23 18:09:29 +01:00
|
|
|
};
|
|
|
|
|
2017-05-05 07:17:56 +02:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2016-11-23 18:09:29 +01:00
|
|
|
buildInputs = [ llvmPackages.clang-unwrapped ];
|
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
export LIBCLANG_PATH="${llvmPackages.clang-unwrapped}/lib"
|
|
|
|
'';
|
|
|
|
|
2017-05-05 07:17:56 +02:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/bindgen --set LIBCLANG_PATH "${llvmPackages.clang-unwrapped}/lib"
|
|
|
|
'';
|
|
|
|
|
2017-12-19 21:06:05 +01:00
|
|
|
cargoSha256 = "01h0y5phdv3ab8mk2yxw8lgg9783pjjnjl4087iddqhqanlv600d";
|
2016-11-23 18:09:29 +01:00
|
|
|
|
|
|
|
doCheck = false; # A test fails because it can't find standard headers in NixOS
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2017-07-28 12:33:03 +02:00
|
|
|
description = "C and C++ binding generator";
|
|
|
|
homepage = https://github.com/rust-lang-nursery/rust-bindgen;
|
2016-11-23 18:09:29 +01:00
|
|
|
license = with licenses; [ bsd3 ];
|
|
|
|
maintainers = [ maintainers.ralith ];
|
|
|
|
};
|
|
|
|
}
|