2018-06-07 19:17:20 +02:00
|
|
|
{ stdenv, fetchFromGitHub, fetchpatch, coreutils
|
2018-07-21 02:44:44 +02:00
|
|
|
, python3Packages, substituteAll }:
|
2018-06-07 19:17:20 +02:00
|
|
|
|
2017-03-03 02:44:17 +01:00
|
|
|
python3Packages.buildPythonApplication rec {
|
2014-12-23 08:35:26 +01:00
|
|
|
name = "trash-cli-${version}";
|
2017-03-03 02:44:17 +01:00
|
|
|
version = "0.17.1.14";
|
2014-12-23 08:35:26 +01:00
|
|
|
namePrefix = "";
|
|
|
|
|
2017-03-03 02:44:17 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "andreafrancia";
|
|
|
|
repo = "trash-cli";
|
2019-09-09 01:38:31 +02:00
|
|
|
rev = version;
|
2017-03-03 02:44:17 +01:00
|
|
|
sha256 = "1bqazna223ibqjwbc1wfvfnspfyrvjy8347qlrgv4cpng72n7gfi";
|
2014-12-23 08:35:26 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
2018-06-07 19:17:20 +02:00
|
|
|
(substituteAll {
|
|
|
|
src = ./nix-paths.patch;
|
|
|
|
df = "${coreutils}/bin/df";
|
2018-06-11 12:26:52 +02:00
|
|
|
libc = let ext = if stdenv.isDarwin then ".dylib" else ".so.6";
|
|
|
|
in "${stdenv.cc.libc}/lib/libc${ext}";
|
2018-06-07 19:17:20 +02:00
|
|
|
})
|
|
|
|
|
2017-06-03 00:37:48 +02:00
|
|
|
# Fix build on Python 3.6.
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/andreafrancia/trash-cli/commit/a21b80d1e69783bb09376c3f60dd2f2a10578805.patch";
|
|
|
|
sha256 = "0w49rjh433sjfc2cl5a9wlbr6kcn9f1qg905qsyv7ay3ar75wvyp";
|
|
|
|
})
|
2014-12-23 08:35:26 +01:00
|
|
|
];
|
|
|
|
|
2019-03-04 14:52:33 +01:00
|
|
|
checkInputs = with python3Packages; [
|
|
|
|
nose
|
|
|
|
mock
|
|
|
|
];
|
2014-12-23 08:35:26 +01:00
|
|
|
checkPhase = "nosetests";
|
|
|
|
|
2018-06-07 19:17:20 +02:00
|
|
|
meta = with stdenv.lib; {
|
2014-12-23 08:35:26 +01:00
|
|
|
homepage = https://github.com/andreafrancia/trash-cli;
|
|
|
|
description = "Command line tool for the desktop trash can";
|
2016-02-10 14:59:36 +01:00
|
|
|
maintainers = [ maintainers.rycee ];
|
2018-06-11 12:26:52 +02:00
|
|
|
platforms = platforms.unix;
|
2014-12-23 08:35:26 +01:00
|
|
|
license = licenses.gpl2;
|
|
|
|
};
|
|
|
|
}
|