depot/third_party/nixpkgs/pkgs/tools/filesystems/bcachefs-tools/default.nix
Default email c594a97518 Project import generated by Copybara.
GitOrigin-RevId: 301aada7a64812853f2e2634a530ef5d34505048
2022-10-21 20:38:19 +02:00

73 lines
1.7 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-09-28";
src = fetchFromGitHub {
owner = "koverstreet";
repo = "bcachefs-tools";
rev = "99caca2c70f312c4a2504a7e7a9c92a91426d885";
sha256 = "sha256-9bFTBFkQq8SvhYa9K4+MH2zvKZviNaq0sFWoeGgch7g=";
};
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;
inherit (nixosTests.installer) bcachefsSimple bcachefsEncrypted bcachefsMulti;
};
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;
};
}