summary refs log tree commit diff
path: root/pkgs/tools/misc/trash-cli/default.nix
blob: 30fc6a92d89e1fa85778e372e9a8e41d4fef5081 (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
{ stdenv, fetchurl, substituteAll, coreutils, python2, python2Packages }:

assert stdenv.isLinux;

python2Packages.buildPythonPackage rec {
  name = "trash-cli-${version}";
  version = "0.12.9.14";
  namePrefix = "";

  src = fetchurl {
    url = "https://github.com/andreafrancia/trash-cli/archive/${version}.tar.gz";
    sha256 = "10idvzrlppj632pw6mpk1zy9arn1x4lly4d8nfy9cz4zqv06lhvh";
  };


  patches = [
    # Fix paths.
    (substituteAll {
      src = ./nix-paths.patch;
      df = "${coreutils}/bin/df";
      python = "${python2}/bin/${python2.executable}";
      libc = "${stdenv.gcc.libc}/lib/libc.so.6";
    })

    # Apply https://github.com/JaviMerino/trash-cli/commit/4f45a37a3
    # to fix failing test case.
    ./fix_should_output_info_for_multiple_files.patch
  ];

  buildInputs = with python2Packages; [ nose mock ];

  checkPhase = "nosetests";

  meta = with stdenv.lib; {
    homepage = https://github.com/andreafrancia/trash-cli;
    description = "Command line tool for the desktop trash can";
    maintainer = [ maintainers.rycee ];
    license = licenses.gpl2;
  };
}