mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-02-09 00:00:04 +03:00
Heavily simplified to just call make with the required rust dependencies. Signed-off-by: Daniel Hill <daniel@gluo.nz>
65 lines
1003 B
Nix
65 lines
1003 B
Nix
{ lib
|
|
, stdenv
|
|
, pkg-config
|
|
, attr
|
|
, libuuid
|
|
, libsodium
|
|
, keyutils
|
|
, liburcu
|
|
, zlib
|
|
, libaio
|
|
, udev
|
|
, zstd
|
|
, lz4
|
|
, nix-gitignore
|
|
, rustPlatform
|
|
}:
|
|
|
|
let
|
|
src = nix-gitignore.gitignoreSource [] ./. ;
|
|
|
|
commit = lib.strings.substring 0 7 (builtins.readFile ./.bcachefs_revision);
|
|
version = "git-${commit}";
|
|
|
|
in stdenv.mkDerivation {
|
|
inherit src version;
|
|
|
|
pname = "bcachefs-tools";
|
|
|
|
nativeBuildInputs = [
|
|
pkg-config
|
|
rustPlatform.cargoSetupHook
|
|
rustPlatform.rust.cargo
|
|
rustPlatform.rust.rustc
|
|
rustPlatform.bindgenHook
|
|
];
|
|
|
|
buildInputs = [
|
|
libaio
|
|
keyutils # libkeyutils
|
|
lz4 # liblz4
|
|
|
|
libsodium
|
|
liburcu
|
|
libuuid
|
|
zstd # libzstd
|
|
zlib # zlib1g
|
|
attr
|
|
udev
|
|
];
|
|
|
|
cargoRoot = "rust-src";
|
|
cargoDeps = rustPlatform.importCargoLock {
|
|
lockFile = "${src}/rust-src/Cargo.lock";
|
|
};
|
|
|
|
makeFlags = [
|
|
"PREFIX=${placeholder "out"}"
|
|
"VERSION=${commit}"
|
|
];
|
|
|
|
dontStrip = true;
|
|
checkPhase = "./bcachefs version";
|
|
doCheck = true;
|
|
}
|