-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
/
Copy pathunwrapped.nix
49 lines (40 loc) · 1.28 KB
/
unwrapped.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{ lib, fetchCrate, rustPlatform, clang, rustfmt
}:
let
# bindgen hardcodes rustfmt outputs that use nightly features
rustfmt-nightly = rustfmt.override { asNightly = true; };
in rustPlatform.buildRustPackage rec {
pname = "rust-bindgen-unwrapped";
version = "0.71.1";
src = fetchCrate {
pname = "bindgen-cli";
inherit version;
hash = "sha256-RL9P0dPYWLlEGgGWZuIvyULJfH+c/B+3sySVadJQS3w=";
};
useFetchCargoVendor = true;
cargoHash = "sha256-4EyDjHreFFFSGf7UoftCh6eI/8nfIP1ANlYWq0K8a3I=";
buildInputs = [ (lib.getLib clang.cc) ];
preConfigure = ''
export LIBCLANG_PATH="${lib.getLib clang.cc}/lib"
'';
doCheck = true;
nativeCheckInputs = [ clang ];
RUSTFMT = "${rustfmt-nightly}/bin/rustfmt";
preCheck = ''
# for the ci folder, notably
patchShebangs .
'';
passthru = { inherit clang; };
meta = with lib; {
description = "Automatically generates Rust FFI bindings to C (and some C++) libraries";
longDescription = ''
Bindgen takes a c or c++ header file and turns them into
rust ffi declarations.
'';
homepage = "https://github.com/rust-lang/rust-bindgen";
license = with licenses; [ bsd3 ];
maintainers = with maintainers; [ johntitor ];
mainProgram = "bindgen";
platforms = platforms.unix;
};
}