2021-01-25 08:26:54 +00:00
|
|
|
{ lib, fetchFromGitHub, python3Packages }:
|
2018-06-07 18:17:20 +01:00
|
|
|
|
2017-03-03 01:44:17 +00:00
|
|
|
python3Packages.buildPythonApplication rec {
|
2020-03-29 11:34:50 +01:00
|
|
|
pname = "trash-cli";
|
2022-04-20 08:57:07 +01:00
|
|
|
version = "0.22.4.16";
|
2014-12-23 07:35:26 +00:00
|
|
|
|
2017-03-03 01:44:17 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "andreafrancia";
|
|
|
|
repo = "trash-cli";
|
2019-09-09 00:38:31 +01:00
|
|
|
rev = version;
|
2022-04-20 08:57:07 +01:00
|
|
|
sha256 = "0j8iwr6cdc24gp5raxrq5483d7sfsyi8sy947w4hr2sc4j738dg5";
|
2014-12-23 07:35:26 +00:00
|
|
|
};
|
|
|
|
|
2020-11-23 21:03:13 +00:00
|
|
|
propagatedBuildInputs = [ python3Packages.psutil ];
|
2014-12-23 07:35:26 +00:00
|
|
|
|
2019-03-04 13:52:33 +00:00
|
|
|
checkInputs = with python3Packages; [
|
|
|
|
mock
|
2021-05-15 18:23:02 +01:00
|
|
|
pytestCheckHook
|
2019-03-04 13:52:33 +00:00
|
|
|
];
|
2021-04-29 20:58:42 +01:00
|
|
|
|
2021-07-23 21:32:14 +01:00
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
runHook preInstallCheck
|
|
|
|
|
|
|
|
# Create a home directory with a test file.
|
|
|
|
HOME="$(mktemp -d)"
|
|
|
|
touch "$HOME/deleteme"
|
|
|
|
|
|
|
|
# Verify that trash list is initially empty.
|
|
|
|
[[ $($out/bin/trash-list) == "" ]]
|
|
|
|
|
|
|
|
# Trash a test file and verify that it shows up in the list.
|
|
|
|
$out/bin/trash "$HOME/deleteme"
|
|
|
|
[[ $($out/bin/trash-list) == *" $HOME/deleteme" ]]
|
|
|
|
|
|
|
|
# Empty the trash and verify that it is empty.
|
|
|
|
$out/bin/trash-empty
|
|
|
|
[[ $($out/bin/trash-list) == "" ]]
|
|
|
|
|
|
|
|
runHook postInstallCheck
|
|
|
|
'';
|
2014-12-23 07:35:26 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/andreafrancia/trash-cli";
|
2014-12-23 07:35:26 +00:00
|
|
|
description = "Command line tool for the desktop trash can";
|
2016-02-10 13:59:36 +00:00
|
|
|
maintainers = [ maintainers.rycee ];
|
2018-06-11 11:26:52 +01:00
|
|
|
platforms = platforms.unix;
|
2014-12-23 07:35:26 +00:00
|
|
|
license = licenses.gpl2;
|
2021-04-27 18:46:48 +01:00
|
|
|
mainProgram = "trash";
|
2014-12-23 07:35:26 +00:00
|
|
|
};
|
|
|
|
}
|