python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / tools / filesystems / dduper / default.nix
blobe7eecbf766ee13442ecc22a4cf5ca5738bc90200
1 { lib, stdenv, fetchpatch, fetchFromGitHub, btrfs-progs, python3 }:
3 let
4   btrfsProgsPatched = btrfs-progs.overrideAttrs (oldAttrs: {
5     patches = [
6       (fetchpatch {
7         name = "0001-Print-csum-for-a-given-file-on-stdout.patch";
8         url = "https://raw.githubusercontent.com/Lakshmipathi/dduper/f45d04854a40cb52ae0e6736916d5955cb68b8ee/patch/btrfs-progs-v5.12.1/0001-Print-csum-for-a-given-file-on-stdout.patch";
9         sha256 = "0c7dd44q2ww6k9nk5dh6m0f0wbd8x84vb2m61fk6a44nsv2fwz1x";
10       })
11     ];
12   });
13   py3 = python3.withPackages (ps: with ps; [
14     prettytable
15     numpy
16   ]);
18 stdenv.mkDerivation rec {
19   pname = "dduper";
20   version = "0.04";
22   src = fetchFromGitHub {
23     owner = "lakshmipathi";
24     repo = "dduper";
25     rev = "v${version}";
26     sha256 = "09ncdawxkffldadqhfblqlkdl05q2qmywxyg6p61fv3dr2f2v5wm";
27   };
29   buildInputs = [
30     btrfsProgsPatched
31     py3
32   ];
34   patchPhase = ''
35     substituteInPlace ./dduper --replace "/usr/sbin/btrfs.static" "${btrfsProgsPatched}/bin/btrfs"
36   '';
38   installPhase = ''
39     mkdir -p $out/bin
40     install -m755 ./dduper $out/bin
41   '';
43   meta = with lib; {
44     description = "Fast block-level out-of-band BTRFS deduplication tool.";
45     homepage = "https://github.com/Lakshmipathi/dduper";
46     license = licenses.gpl2Plus;
47     maintainers = with maintainers; [ thesola10 ];
48     platforms = platforms.linux;
49   };