diff options
| author | Julian Stecklina <julian.stecklina@cyberus-technology.de> | 2024-03-25 15:36:43 +0100 |
|---|---|---|
| committer | Julian Stecklina <julian.stecklina@cyberus-technology.de> | 2024-03-25 15:36:43 +0100 |
| commit | 6cc20b7e3c8d50bb03eb2706af21c4ae9a1d3a79 (patch) | |
| tree | 01f33fc0012cf9c6c9669a3b87bfe9fcc1e7ec55 /bindgen/0.65.1.nix | |
Initial import
Diffstat (limited to 'bindgen/0.65.1.nix')
| -rw-r--r-- | bindgen/0.65.1.nix | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/bindgen/0.65.1.nix b/bindgen/0.65.1.nix new file mode 100644 index 0000000..fcc5edc --- /dev/null +++ b/bindgen/0.65.1.nix @@ -0,0 +1,47 @@ +{ 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.65.1"; + + src = fetchCrate { + pname = "bindgen-cli"; + inherit version; + sha256 = "sha256-9JJXQQSbCxTh3fIbVSrc6WAYGivwomkoB8ZIquUNr9o="; + }; + + cargoHash = "sha256-Kz6Y+4F9Yu5oKYI9LgZKLh0AkQTwerPS4A758TZrkoc="; + + buildInputs = [ clang.cc.lib ]; + + preConfigure = '' + export LIBCLANG_PATH="${clang.cc.lib}/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 ralith ]; + mainProgram = "bindgen"; + platforms = platforms.unix; + }; +} |
