From ab71980f5ce9dfae2004cd1b320fcb0166febfd5 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Sat, 28 May 2022 04:20:00 +0000 Subject: [PATCH] ocrmypdf: install completions --- pkgs/development/python-modules/ocrmypdf/default.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/ocrmypdf/default.nix b/pkgs/development/python-modules/ocrmypdf/default.nix index 1a427dc379fd..3e75bb7fb8e2 100644 --- a/pkgs/development/python-modules/ocrmypdf/default.nix +++ b/pkgs/development/python-modules/ocrmypdf/default.nix @@ -18,11 +18,11 @@ , reportlab , setuptools-scm , setuptools-scm-git-archive -, stdenv , substituteAll , tesseract4 , tqdm , unpaper +, installShellFiles }: buildPythonPackage rec { @@ -35,7 +35,7 @@ buildPythonPackage rec { rev = "v${version}"; # The content of .git_archival.txt is substituted upon tarball creation, # which creates indeterminism if master no longer points to the tag. - # See https://github.com/jbarlow83/OCRmyPDF/issues/841 + # See https://github.com/ocrmypdf/OCRmyPDF/issues/841 postFetch = '' rm "$out/.git_archival.txt" ''; @@ -58,6 +58,7 @@ buildPythonPackage rec { nativeBuildInputs = [ setuptools-scm-git-archive setuptools-scm + installShellFiles ]; propagatedBuildInputs = [ @@ -84,6 +85,12 @@ buildPythonPackage rec { "ocrmypdf" ]; + postInstall = '' + installShellCompletion --cmd ocrmypdf \ + --bash misc/completion/ocrmypdf.bash \ + --fish misc/completion/ocrmypdf.fish + ''; + meta = with lib; { homepage = "https://github.com/ocrmypdf/OCRmyPDF"; description = "Adds an OCR text layer to scanned PDF files, allowing them to be searched";