nixpkgs-suyu/pkgs/tools/misc/trash-cli/default.nix

52 lines
1.3 KiB
Nix
Raw Normal View History

{ lib, fetchFromGitHub, python3Packages }:
2017-03-03 02:44:17 +01:00
python3Packages.buildPythonApplication rec {
2020-03-29 12:34:50 +02:00
pname = "trash-cli";
2021-07-28 22:12:14 +02:00
version = "0.21.7.24";
2014-12-23 08:35:26 +01:00
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;
2021-07-28 22:12:14 +02:00
sha256 = "082mfl4mza4xkm3fdn5aka9rsbd8c149qj3cqqk62idrnszmgzg5";
2014-12-23 08:35:26 +01:00
};
2020-11-23 22:03:13 +01:00
propagatedBuildInputs = [ python3Packages.psutil ];
2014-12-23 08:35:26 +01:00
checkInputs = with python3Packages; [
mock
pytestCheckHook
];
2021-04-29 21:58:42 +02: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 08:35:26 +01:00
meta = with lib; {
homepage = "https://github.com/andreafrancia/trash-cli";
2014-12-23 08:35:26 +01:00
description = "Command line tool for the desktop trash can";
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;
2021-04-27 19:46:48 +02:00
mainProgram = "trash";
2014-12-23 08:35:26 +01:00
};
}