mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-02-02 00:00:03 +03:00
1f8fc31ddc
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
41 lines
925 B
Nix
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;
|
|
}) |