bcachefs-tools: cleanup, reorganise

add github repo as downloadPage

(cherry picked from commit 4c6e1894f5)
This commit is contained in:
John Titor
2025-10-16 21:30:43 +05:30
parent 82b3fdffde
commit afa580e471

View File

@@ -37,6 +37,16 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-CnRB/iS1NZ0Ebsi12wXFvVb0qdv0V9q1oC3nLj13mqs=";
};
cargoDeps = rustPlatform.fetchCargoVendor {
inherit (finalAttrs) src;
hash = "sha256-50xy1nqDctgz/lXd5JsfaU6yxDoRCQRtiYBwuEuiKFA=";
};
postPatch = ''
substituteInPlace Makefile \
--replace-fail "target/release/bcachefs" "target/${stdenv.hostPlatform.rust.rustcTargetSpec}/release/bcachefs"
'';
nativeBuildInputs = [
pkg-config
cargo
@@ -51,7 +61,6 @@ stdenv.mkDerivation (finalAttrs: {
libaio
keyutils
lz4
libsodium
liburcu
libuuid
@@ -62,16 +71,6 @@ stdenv.mkDerivation (finalAttrs: {
]
++ lib.optional fuseSupport fuse3;
cargoDeps = rustPlatform.fetchCargoVendor {
src = finalAttrs.src;
hash = "sha256-50xy1nqDctgz/lXd5JsfaU6yxDoRCQRtiYBwuEuiKFA=";
};
outputs = [
"out"
"dkms"
];
makeFlags = [
"PREFIX=${placeholder "out"}"
"VERSION=${finalAttrs.version}"
@@ -83,6 +82,9 @@ stdenv.mkDerivation (finalAttrs: {
"PKGCONFIG_UDEVDIR=$(out)/lib/udev"
]
++ lib.optional fuseSupport "BCACHEFS_FUSE=1";
enableParallelBuilding = true;
installFlags = [
"install"
"install_dkms"
@@ -96,6 +98,11 @@ stdenv.mkDerivation (finalAttrs: {
# FIXME: Try enabling this once the default linux kernel is at least 6.7
doCheck = false; # needs bcachefs module loaded on builder
preCheck = lib.optionalString (!fuseSupport) ''
rm tests/test_fuse.py
'';
checkFlags = [ "BCACHEFS_TEST_USE_VALGRIND=no" ];
doInstallCheck = true;
nativeInstallCheckInputs = [
udevCheckHook
@@ -103,16 +110,6 @@ stdenv.mkDerivation (finalAttrs: {
];
versionCheckProgramArg = "version";
postPatch = ''
substituteInPlace Makefile \
--replace-fail "target/release/bcachefs" "target/${stdenv.hostPlatform.rust.rustcTargetSpec}/release/bcachefs"
'';
preCheck = lib.optionalString (!fuseSupport) ''
rm tests/test_fuse.py
'';
checkFlags = [ "BCACHEFS_TEST_USE_VALGRIND=no" ];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd bcachefs \
--bash <($out/sbin/bcachefs completions bash) \
@@ -120,6 +117,11 @@ stdenv.mkDerivation (finalAttrs: {
--fish <($out/sbin/bcachefs completions fish)
'';
outputs = [
"out"
"dkms"
];
passthru = {
# See NOTE in linux-kernels.nix
kernelModule = import ./kernel-module.nix finalAttrs.finalPackage;
@@ -132,11 +134,10 @@ stdenv.mkDerivation (finalAttrs: {
updateScript = nix-update-script { };
};
enableParallelBuilding = true;
meta = {
description = "Tool for managing bcachefs filesystems";
homepage = "https://bcachefs.org/";
downloadPage = "https://github.com/koverstreet/bcachefs-tools";
license = lib.licenses.gpl2Only;
maintainers = with lib.maintainers; [
davidak