1 { lib, stdenv, fetchurl
2 , pkg-config, python3, sphinx
4 , acl, attr, e2fsprogs, libuuid, lzo, udev, zlib
5 , runCommand, btrfs-progs
11 stdenv.mkDerivation rec {
12 pname = "btrfs-progs";
16 url = "mirror://kernel/linux/kernel/people/kdave/btrfs-progs/btrfs-progs-v${version}.tar.xz";
17 sha256 = "sha256-tTFv/x2BHirToGeXMQnrkSuw2SgFc1Yl/YuC5wAgHEg=";
22 ] ++ lib.optionals enablePython [
23 python3 python3.pkgs.setuptools
28 buildInputs = [ acl attr e2fsprogs libuuid lzo python3 udev zlib zstd ];
30 # gcc bug with -O1 on ARM with gcc 4.8
31 # This should be fine on all platforms so apply universally
32 postPatch = "sed -i s/-O1/-O2/ configure";
35 install -v -m 444 -D btrfs-completion $out/share/bash-completion/completions/btrfs
38 configureFlags = lib.optionals stdenv.hostPlatform.isMusl [
40 ] ++ lib.optionals (!enablePython) [
42 ] ++ lib.optionals (!udevSupport) [
46 makeFlags = [ "udevruledir=$(out)/lib/udev/rules.d" ];
48 installFlags = lib.optionals enablePython [ "install_python" ];
50 enableParallelBuilding = true;
53 simple-filesystem = runCommand "btrfs-progs-create-fs" {} ''
55 truncate -s110M $out/disc
56 ${btrfs-progs}/bin/mkfs.btrfs $out/disc | tee $out/success
57 ${btrfs-progs}/bin/btrfs check $out/disc | tee $out/success
62 passthru.updateScript = gitUpdater {
63 # No nicer place to find latest release.
64 url = "https://github.com/kdave/btrfs-progs.git";
69 description = "Utilities for the btrfs filesystem";
70 homepage = "https://btrfs.wiki.kernel.org/";
71 license = licenses.gpl2Only;
72 maintainers = with maintainers; [ raskin ];
73 platforms = platforms.linux;