1 { lib, fetchCrate, rustPlatform, clang, rustfmt
6 # bindgen hardcodes rustfmt outputs that use nightly features
7 rustfmt-nightly = rustfmt.override { asNightly = true; };
8 in rustPlatform.buildRustPackage rec {
9 pname = "rust-bindgen-unwrapped";
13 pname = "bindgen-cli";
15 sha256 = "sha256-5fwJq1WsL3IEcVUjsyqKdQU8VufbbPk6TglwJg3C1Gw=";
18 cargoHash = "sha256-UROy/MyPBKJe+EaiUIDbOYKVbge0C9LsmfnsvOLEONE=";
20 buildInputs = [ clang.cc.lib ];
23 export LIBCLANG_PATH="${clang.cc.lib}/lib"
27 nativeCheckInputs = [ clang ];
29 RUSTFMT = "${rustfmt-nightly}/bin/rustfmt";
32 # for the ci folder, notably
36 passthru = { inherit clang; };
39 description = "Automatically generates Rust FFI bindings to C (and some C++) libraries";
41 Bindgen takes a c or c++ header file and turns them into
42 rust ffi declarations.
44 homepage = "https://github.com/rust-lang/rust-bindgen";
45 license = with licenses; [ bsd3 ];
46 maintainers = with maintainers; [ johntitor ralith ];
47 mainProgram = "bindgen";
48 platforms = platforms.unix;