summary refs log tree commit diff
path: root/pkgs/tools/filesystems/btrfsprogs/default.nix
blob: a42c6aa7a7ec06c2f50510041b6de4395f1d0962 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{ stdenv, fetchgit, zlib, libuuid, acl, attr, e2fsprogs }:

let version = "0.20pre20121005"; in

stdenv.mkDerivation {
  name = "btrfs-progs-${version}";

  src = fetchgit {
    url = "git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git";
    rev = "91d9eec1ff044394f2b98ee7fcb76713dd33b994";
    sha256 = "72d4cd4fb23d876a17146d6231ad40a2151fa47c648485c54cf7478239b43764";
  };

  patches = [
    ./subvol-listing.patch
    ./btrfs-receive-help-text.patch
    ./btrfs-progs-Fix-the-receive-code-pathing.patch
    ./btrfs-receive-lchown.patch
  ];

  buildInputs = [ zlib libuuid acl attr e2fsprogs ];

  postPatch = ''
    cp ${./btrfs-set-received-uuid.c} btrfs-set-received-uuid.c
  '';

  postBuild = ''
    gcc -O2 -luuid -o btrfs-set-received-uuid send-utils.o rbtree.o btrfs-list.o btrfs-set-received-uuid.c
  '';

  postInstall = ''
    cp btrfs-set-received-uuid $out/bin
  '';

  makeFlags = "prefix=$(out)";

  meta = {
    description = "Utilities for the btrfs filesystem";
    homepage = https://btrfs.wiki.kernel.org/;
    maintainers = [ stdenv.lib.maintainers.raskin ];
    platforms = stdenv.lib.platforms.linux;
  };
}