Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
59 lines
1.4 KiB
Nix
59 lines
1.4 KiB
Nix
{
|
|
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.72.0";
|
|
|
|
src = fetchCrate {
|
|
pname = "bindgen-cli";
|
|
inherit version;
|
|
hash = "sha256-0hIxXKq7zu/gq0QAs2Ffuq584a9w1RWctPs9SBfc0/I=";
|
|
};
|
|
|
|
cargoHash = "sha256-K/iM79RfNU+3f2ae6wy/FMFAD68vfqzSUebqALPJpJY=";
|
|
|
|
preConfigure = ''
|
|
export LIBCLANG_PATH="${lib.getLib clang.cc}/lib"
|
|
'';
|
|
|
|
# Disable the "runtime" feature, so libclang is linked.
|
|
buildNoDefaultFeatures = true;
|
|
buildFeatures = [ "logging" ];
|
|
checkNoDefaultFeatures = buildNoDefaultFeatures;
|
|
checkFeatures = buildFeatures;
|
|
|
|
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;
|
|
};
|
|
}
|