nixpkgs/pkgs/development/tools/rust/bindgen/default.nix

38 lines
1.1 KiB
Nix
Raw Normal View History

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