2021-05-20 02:12:17 +01: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 17:53:12 +01:00
|
|
|
|
2019-08-13 22:52:01 +01:00
|
|
|
stdenv.mkDerivation {
|
2019-01-14 02:24:53 +00:00
|
|
|
pname = "bcachefs-tools";
|
2022-10-01 05:48:26 +01:00
|
|
|
version = "unstable-2022-09-28";
|
2017-05-07 17:53:12 +01:00
|
|
|
|
2020-08-17 10:53:08 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "koverstreet";
|
|
|
|
repo = "bcachefs-tools";
|
2022-10-01 05:48:26 +01:00
|
|
|
rev = "99caca2c70f312c4a2504a7e7a9c92a91426d885";
|
|
|
|
sha256 = "sha256-9bFTBFkQq8SvhYa9K4+MH2zvKZviNaq0sFWoeGgch7g=";
|
2017-05-07 17:53:12 +01:00
|
|
|
};
|
|
|
|
|
2019-10-18 21:47:24 +01:00
|
|
|
postPatch = ''
|
2021-11-06 21:24:16 +00:00
|
|
|
patchShebangs .
|
2019-01-14 02:24:53 +00:00
|
|
|
substituteInPlace Makefile \
|
2019-10-18 21:47:24 +01:00
|
|
|
--replace "pytest-3" "pytest --verbose" \
|
2019-01-14 02:24:53 +00:00
|
|
|
--replace "INITRAMFS_DIR=/etc/initramfs-tools" \
|
2021-10-20 20:09:11 +01:00
|
|
|
"INITRAMFS_DIR=${placeholder "out"}/etc/initramfs-tools"
|
2018-08-06 14:58:12 +01:00
|
|
|
'';
|
2017-05-07 17:53:12 +01:00
|
|
|
|
2021-11-06 21:24:16 +00:00
|
|
|
nativeBuildInputs = [ pkg-config docutils python3Packages.python ];
|
2019-10-18 21:47:24 +01:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libuuid libscrypt libsodium keyutils liburcu zlib libaio
|
2020-08-17 10:53:08 +01:00
|
|
|
zstd lz4 python3Packages.pytest udev valgrind
|
2021-01-15 09:19:50 +00:00
|
|
|
] ++ lib.optional fuseSupport fuse3;
|
2019-10-18 21:47:24 +01:00
|
|
|
|
2020-09-09 19:48:12 +01: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 21:47:24 +01:00
|
|
|
|
2021-01-15 09:19:50 +00:00
|
|
|
preCheck = lib.optionalString fuseSupport ''
|
2019-10-18 21:47:24 +01:00
|
|
|
rm tests/test_fuse.py
|
|
|
|
'';
|
|
|
|
|
2020-11-29 00:02:40 +00:00
|
|
|
installFlags = [ "PREFIX=${placeholder "out"}" ];
|
2019-10-18 21:47:24 +01:00
|
|
|
|
2021-04-03 23:34:28 +01:00
|
|
|
passthru.tests = {
|
|
|
|
smoke-test = nixosTests.bcachefs;
|
2022-05-05 01:57:52 +01:00
|
|
|
inherit (nixosTests.installer) bcachefsSimple bcachefsEncrypted bcachefsMulti;
|
2021-04-03 23:34:28 +01:00
|
|
|
};
|
|
|
|
|
2022-03-06 05:42:17 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2017-05-07 17:53:12 +01:00
|
|
|
description = "Tool for managing bcachefs filesystems";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://bcachefs.org/";
|
2017-05-07 17:53:12 +01:00
|
|
|
license = licenses.gpl2;
|
2022-03-14 08:52:18 +00:00
|
|
|
maintainers = with maintainers; [ davidak Madouura ];
|
2021-11-06 21:24:16 +00:00
|
|
|
platforms = platforms.linux;
|
2017-05-07 17:53:12 +01:00
|
|
|
};
|
|
|
|
}
|