ocrmypdf: install completions

This commit is contained in:
Mario Rodas 2022-05-28 04:20:00 +00:00 committed by Robert Schütz
parent e2bdf49580
commit ab71980f5c

View file

@ -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";