2021-07-14 22:03:04 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pkg-config
|
|
|
|
, docutils
|
|
|
|
, libuuid
|
|
|
|
, libscrypt
|
|
|
|
, libsodium
|
|
|
|
, keyutils
|
|
|
|
, liburcu
|
|
|
|
, zlib
|
|
|
|
, libaio
|
|
|
|
, zstd
|
|
|
|
, lz4
|
|
|
|
, python3Packages
|
|
|
|
, udev
|
|
|
|
, valgrind
|
|
|
|
, nixosTests
|
|
|
|
, fuse3
|
|
|
|
, fuseSupport ? false
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "bcachefs-tools";
|
2022-02-10 20:34:41 +00:00
|
|
|
version = "unstable-2022-01-12";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "koverstreet";
|
|
|
|
repo = "bcachefs-tools";
|
2022-02-10 20:34:41 +00:00
|
|
|
rev = "7b15324de1095f3e2e423e9c53da076d208b52d5";
|
|
|
|
sha256 = "0glpq0n1xv7ck28v0gahl1fak9dhyp04id8d1l8yxvnriyw19zxa";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
2021-12-06 16:07:01 +00:00
|
|
|
patchShebangs .
|
2020-04-24 23:36:52 +00:00
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace "pytest-3" "pytest --verbose" \
|
|
|
|
--replace "INITRAMFS_DIR=/etc/initramfs-tools" \
|
2021-10-28 06:52:43 +00:00
|
|
|
"INITRAMFS_DIR=${placeholder "out"}/etc/initramfs-tools"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
nativeBuildInputs = [ pkg-config docutils python3Packages.python ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libuuid libscrypt libsodium keyutils liburcu zlib libaio
|
2020-09-25 04:45:31 +00:00
|
|
|
zstd lz4 python3Packages.pytest udev valgrind
|
2021-01-15 22:18:51 +00:00
|
|
|
] ++ lib.optional fuseSupport fuse3;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
doCheck = false; # needs bcachefs module loaded on builder
|
2020-12-25 13:55:36 +00:00
|
|
|
checkFlags = [ "BCACHEFS_TEST_USE_VALGRIND=no" ];
|
|
|
|
checkInputs = [ valgrind ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
preCheck = lib.optionalString fuseSupport ''
|
2020-04-24 23:36:52 +00:00
|
|
|
rm tests/test_fuse.py
|
|
|
|
'';
|
|
|
|
|
2020-12-25 13:55:36 +00:00
|
|
|
installFlags = [ "PREFIX=${placeholder "out"}" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
passthru.tests = {
|
|
|
|
smoke-test = nixosTests.bcachefs;
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Tool for managing bcachefs filesystems";
|
|
|
|
homepage = "https://bcachefs.org/";
|
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = with maintainers; [ davidak chiiruno ];
|
2021-12-06 16:07:01 +00:00
|
|
|
platforms = platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|