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