2021-01-17 09:17:16 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, pkg-config, attr, libuuid, libscrypt, libsodium, keyutils
|
2020-08-17 10:53:08 +01:00
|
|
|
, liburcu, zlib, libaio, udev, zstd, lz4, valgrind, python3Packages
|
2019-10-18 21:47:24 +01:00
|
|
|
, fuseSupport ? false, fuse3 ? null }:
|
|
|
|
|
|
|
|
assert fuseSupport -> fuse3 != null;
|
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";
|
2020-11-29 00:02:40 +00:00
|
|
|
version = "2020-11-17";
|
2017-05-07 17:53:12 +01:00
|
|
|
|
2020-08-17 10:53:08 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "koverstreet";
|
|
|
|
repo = "bcachefs-tools";
|
2020-11-29 00:02:40 +00:00
|
|
|
rev = "41bec63b265a38dd9fa168b6042ea5bf07135048";
|
|
|
|
sha256 = "1y3187kpw1bmnl97isv28k2sw8cmrnsn31a0dw745adwm0n7z6fj";
|
2017-05-07 17:53:12 +01:00
|
|
|
};
|
|
|
|
|
2019-10-18 21:47:24 +01:00
|
|
|
postPatch = ''
|
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" \
|
|
|
|
"INITRAMFS_DIR=${placeholder "out"}/etc/initramfs-tools"
|
2018-08-06 14:58:12 +01:00
|
|
|
'';
|
2017-05-07 17:53:12 +01:00
|
|
|
|
2021-01-17 09:17:16 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
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-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;
|
2018-08-06 14:58:12 +01:00
|
|
|
maintainers = with maintainers; [ davidak chiiruno ];
|
2017-05-07 17:53:12 +01:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|