bcachefs-tools/rust-src/mount/default.nix
Kayla Firestack 1f8fc31ddc split mount into a library crate for rust reuse
update makefile to output shared library and rust build
fix default.nix to properly get the binary name for `ln`ing - move binary to main.rs
add rustfmt and gitignore files
move build.rs file into bch_bindgen for reuse between projects
add outputs to nix flake and checks
add mount.toml to makefile
2021-10-18 16:30:52 -04:00

41 lines
925 B
Nix

{ lib
, stdenv
, glibc
, llvmPackages
, rustPlatform
, bcachefs
, ...
}: rustPlatform.buildRustPackage ( let
cargo = lib.trivial.importTOML ./Cargo.toml;
in {
pname = "mount.bcachefs";
version = cargo.package.version;
src = builtins.path { path = ../.; name = "rust-src"; };
sourceRoot = "rust-src/mount";
cargoLock = { lockFile = ./Cargo.lock; };
nativeBuildInputs = bcachefs.bch_bindgen.nativeBuildInputs;
buildInputs = bcachefs.bch_bindgen.buildInputs;
inherit (bcachefs.bch_bindgen)
LIBBCACHEFS_INCLUDE
LIBBCACHEFS_LIB
LIBCLANG_PATH
BINDGEN_EXTRA_CLANG_ARGS;
postInstall = ''
ln $out/bin/${cargo.package.name} $out/bin/mount.bcachefs
ln -s $out/bin $out/sbin
'';
# -isystem ${llvmPackages.libclang.lib}/lib/clang/${lib.getVersion llvmPackages.libclang}/include";
# CFLAGS = "-I${llvmPackages.libclang.lib}/include";
# LDFLAGS = "-L${libcdev}";
doCheck = false;
# NIX_DEBUG = 4;
})