about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/misc/trash-cli/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/misc/trash-cli/default.nix')
-rw-r--r--nixpkgs/pkgs/tools/misc/trash-cli/default.nix30
1 files changed, 23 insertions, 7 deletions
diff --git a/nixpkgs/pkgs/tools/misc/trash-cli/default.nix b/nixpkgs/pkgs/tools/misc/trash-cli/default.nix
index 6535590e8649..48bb79467cd8 100644
--- a/nixpkgs/pkgs/tools/misc/trash-cli/default.nix
+++ b/nixpkgs/pkgs/tools/misc/trash-cli/default.nix
@@ -1,23 +1,32 @@
-{ lib, fetchFromGitHub, python3Packages }:
+{ lib, fetchFromGitHub, installShellFiles, python3Packages }:
 
 python3Packages.buildPythonApplication rec {
   pname = "trash-cli";
-  version = "0.22.4.16";
+  version = "0.23.2.13.2";
 
   src = fetchFromGitHub {
     owner = "andreafrancia";
     repo = "trash-cli";
     rev = version;
-    sha256 = "0j8iwr6cdc24gp5raxrq5483d7sfsyi8sy947w4hr2sc4j738dg5";
+    hash = "sha256-TJEi7HKIrfOdb+LLRt2DN5gWdFzUeo6isb59lFLK4bQ=";
   };
 
-  propagatedBuildInputs = [ python3Packages.psutil ];
+  propagatedBuildInputs = with python3Packages; [ psutil six ];
 
-  checkInputs = with python3Packages; [
+  nativeBuildInputs = with python3Packages; [
+    installShellFiles
+    shtab
+  ];
+
+  nativeCheckInputs = with python3Packages; [
     mock
     pytestCheckHook
   ];
 
+  postPatch = ''
+    sed -i '/typing/d' setup.cfg
+  '';
+
   doInstallCheck = true;
   installCheckPhase = ''
     runHook preInstallCheck
@@ -39,13 +48,20 @@ python3Packages.buildPythonApplication rec {
 
     runHook postInstallCheck
   '';
+  postInstall = ''
+    for bin in trash-empty trash-list trash-restore trash-put trash; do
+      installShellCompletion --cmd "$bin" \
+        --bash <("$out/bin/$bin" --print-completion bash) \
+        --zsh  <("$out/bin/$bin" --print-completion zsh)
+    done
+  '';
 
   meta = with lib; {
     homepage = "https://github.com/andreafrancia/trash-cli";
-    description = "Command line tool for the desktop trash can";
+    description = "Command line interface to the freedesktop.org trashcan";
     maintainers = [ maintainers.rycee ];
     platforms = platforms.unix;
-    license = licenses.gpl2;
+    license = licenses.gpl2Plus;
     mainProgram = "trash";
   };
 }