python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / tools / misc / btdu / default.nix
blob7651e36d53749d80ad10438bf161e46b92fe9f3b
1 {stdenv, lib, fetchurl, dub, ncurses, ldc, zlib, removeReferencesTo }:
3 let
4     _d_ae_ver              = "0.0.3184";
5     _d_btrfs_ver           = "0.0.12";
6     _d_ncurses_ver         = "0.0.149";
7     _d_emsi_containers_ver = "0.9.0";
8 in
9 stdenv.mkDerivation rec {
10     pname = "btdu";
11     version = "0.4.1";
13     srcs = [
14       (fetchurl {
15         url = "https://github.com/CyberShadow/${pname}/archive/v${version}.tar.gz";
16         sha256 = "265c63ee82067f6b5dc44b47c9ec58be5e13c654f31035c60a7e375ffa4082c9";
17       })
18       (fetchurl {
19         url = "https://github.com/CyberShadow/ae/archive/v${_d_ae_ver}.tar.gz";
20         sha256 = "74c17146ecde7ec4ba159eae4f88c74a5ef40cc200eabf97a0648f5abb5fde5e";
21       })
22       (fetchurl {
23         url = "https://github.com/CyberShadow/d-btrfs/archive/v${_d_btrfs_ver}.tar.gz";
24         sha256 = "cf2b1fa3e94a0aa239d465adbac239514838835283521d632f571948aa517f92";
25       })
26       (fetchurl {
27         url = "https://github.com/D-Programming-Deimos/ncurses/archive/v${_d_ncurses_ver}.tar.gz";
28         sha256 = "2c8497f5dd93f9d3a05ca7ed57c4fcaee1e988fd25a24de106917ddf72f34646";
29       })
30       (fetchurl {
31         url = "https://github.com/dlang-community/containers/archive/v${_d_emsi_containers_ver}.tar.gz";
32         sha256 = "5e256b84bbdbd2bd625cba0472ea27a1fde6d673d37a85fe971a20d52874acaa";
33       })
34     ];
36     sourceRoot = ".";
38     postUnpack = ''
39       mv ae-${_d_ae_ver} "ae"
40     '';
43     nativeBuildInputs = [ dub ldc ];
44     buildInputs = [ ncurses zlib ];
46     configurePhase = ''
47       runHook preConfigure
48       mkdir home
49       HOME="home" dub add-local ae ${_d_ae_ver}
50       HOME="home" dub add-local d-btrfs-${_d_btrfs_ver} ${_d_btrfs_ver}
51       HOME="home" dub add-local ncurses-${_d_ncurses_ver} ${_d_ncurses_ver}
52       HOME="home" dub add-local containers-${_d_emsi_containers_ver} ${_d_emsi_containers_ver}
53       runHook postConfigure
54     '';
56     buildPhase = ''
57       runHook preBuild
58       cd ${pname}-${version}
59       HOME="../home" dub --skip-registry=all build -b release
60       runHook postBuild
61     '';
63     installPhase = ''
64       runHook preInstall
65       mkdir -p $out/bin
66       cp btdu $out/bin/
67       runHook postInstall
68     '';
70     postInstall = ''
71       ${removeReferencesTo}/bin/remove-references-to -t ${ldc} $out/bin/btdu
72     '';
74     passthru.updateScript = ./update.py;
76     meta = with lib; {
77       description = "Sampling disk usage profiler for btrfs";
78       homepage = "https://github.com/CyberShadow/btdu";
79       license = licenses.gpl2Only;
80       platforms = platforms.linux;
81       maintainers = with maintainers; [ atila ];
82     };