73 lines
1.6 KiB
Nix
73 lines
1.6 KiB
Nix
{ lib
|
|
, stdenv
|
|
, fetchFromGitHub
|
|
, pkg-config
|
|
, docutils
|
|
, libuuid
|
|
, libscrypt
|
|
, libsodium
|
|
, keyutils
|
|
, liburcu
|
|
, zlib
|
|
, libaio
|
|
, zstd
|
|
, lz4
|
|
, python3Packages
|
|
, udev
|
|
, valgrind
|
|
, nixosTests
|
|
, fuse3
|
|
, fuseSupport ? false
|
|
}:
|
|
|
|
stdenv.mkDerivation {
|
|
pname = "bcachefs-tools";
|
|
version = "unstable-2022-03-22";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "koverstreet";
|
|
repo = "bcachefs-tools";
|
|
rev = "f3cdace86c8b60a4efaced23b2d31c16dc610da9";
|
|
sha256 = "1hg4cjrs4yr0mx3mmm1jls93w1skpq5wzp2dzx9rq4w5il2xmx19";
|
|
};
|
|
|
|
postPatch = ''
|
|
patchShebangs .
|
|
substituteInPlace Makefile \
|
|
--replace "pytest-3" "pytest --verbose" \
|
|
--replace "INITRAMFS_DIR=/etc/initramfs-tools" \
|
|
"INITRAMFS_DIR=${placeholder "out"}/etc/initramfs-tools"
|
|
'';
|
|
|
|
nativeBuildInputs = [ pkg-config docutils python3Packages.python ];
|
|
|
|
buildInputs = [
|
|
libuuid libscrypt libsodium keyutils liburcu zlib libaio
|
|
zstd lz4 python3Packages.pytest udev valgrind
|
|
] ++ lib.optional fuseSupport fuse3;
|
|
|
|
doCheck = false; # needs bcachefs module loaded on builder
|
|
checkFlags = [ "BCACHEFS_TEST_USE_VALGRIND=no" ];
|
|
checkInputs = [ valgrind ];
|
|
|
|
preCheck = lib.optionalString fuseSupport ''
|
|
rm tests/test_fuse.py
|
|
'';
|
|
|
|
installFlags = [ "PREFIX=${placeholder "out"}" ];
|
|
|
|
passthru.tests = {
|
|
smoke-test = nixosTests.bcachefs;
|
|
};
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
meta = with lib; {
|
|
description = "Tool for managing bcachefs filesystems";
|
|
homepage = "https://bcachefs.org/";
|
|
license = licenses.gpl2;
|
|
maintainers = with maintainers; [ davidak Madouura ];
|
|
platforms = platforms.linux;
|
|
};
|
|
}
|