mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-14 07:43:06 +00:00
0161da44a9
Changelog since 12.2.0: https://github.com/jbarlow83/OCRmyPDF/blob/v12.3.2/docs/release_notes.rst
68 lines
2.8 KiB
Makefile
68 lines
2.8 KiB
Makefile
PORTNAME= ocrmypdf
|
|
DISTVERSION= 12.3.2
|
|
CATEGORIES= textproc python
|
|
MASTER_SITES= CHEESESHOP
|
|
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
|
|
|
|
MAINTAINER= kai@FreeBSD.org
|
|
COMMENT= Adds an OCR text layer to scanned PDF files
|
|
|
|
LICENSE= MPL20
|
|
LICENSE_FILE= ${WRKSRC}/LICENSE
|
|
|
|
BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}cffi>=1.9.1:devel/py-cffi@${PY_FLAVOR} \
|
|
${PYTHON_PKGNAMEPREFIX}setuptools_scm>=0:devel/py-setuptools_scm@${PY_FLAVOR} \
|
|
${PYTHON_PKGNAMEPREFIX}setuptools_scm_git_archive>=0:devel/py-setuptools_scm_git_archive@${PY_FLAVOR}
|
|
LIB_DEPENDS= liblept.so:graphics/leptonica
|
|
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}cffi>=1.9.1:devel/py-cffi@${PY_FLAVOR} \
|
|
${PYTHON_PKGNAMEPREFIX}coloredlogs>=14.0:devel/py-coloredlogs@${PY_FLAVOR} \
|
|
${PYTHON_PKGNAMEPREFIX}img2pdf>=0.3.0<0.5:graphics/py-img2pdf@${PY_FLAVOR} \
|
|
${PYTHON_PKGNAMEPREFIX}pillow>=8.2.0:graphics/py-pillow@${PY_FLAVOR} \
|
|
${PYTHON_PKGNAMEPREFIX}tqdm>=4:misc/py-tqdm@${PY_FLAVOR} \
|
|
${PYTHON_PKGNAMEPREFIX}reportlab>=3.5.66:print/py-reportlab@${PY_FLAVOR} \
|
|
${PYTHON_PKGNAMEPREFIX}pdfminer.six>=20191110<20201019:textproc/py-pdfminer.six@${PY_FLAVOR} \
|
|
${PYTHON_PKGNAMEPREFIX}pikepdf>=2.10.0:textproc/py-pikepdf@${PY_FLAVOR} \
|
|
${PYTHON_PKGNAMEPREFIX}pluggy>=0.13.0<1.0:devel/py-pluggy@${PY_FLAVOR} \
|
|
tesseract:graphics/tesseract
|
|
TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pytest>=4.4.1:devel/py-pytest@${PY_FLAVOR} \
|
|
${PYTHON_PKGNAMEPREFIX}pytest-xdist>=1.31.0:devel/py-pytest-xdist@${PY_FLAVOR} \
|
|
${PYTHON_PKGNAMEPREFIX}python-xmp-toolkit>=2.0.1:textproc/py-python-xmp-toolkit@${PY_FLAVOR}
|
|
|
|
USES= ghostscript:run python:3.6+ shebangfix
|
|
USE_LOCALE= en_US.UTF-8
|
|
USE_PYTHON= autoplist concurrent distutils
|
|
|
|
SHEBANG_FILES= src/ocrmypdf/__main__.py \
|
|
src/ocrmypdf/hocrtransform.py \
|
|
src/ocrmypdf/leptonica.py \
|
|
src/ocrmypdf/pdfinfo/__init__.py
|
|
|
|
NO_ARCH= yes
|
|
|
|
PLIST_FILES= etc/bash_completion.d/ocrmypdf.bash share/fish/vendor_completions.d/ocrmypdf.fish
|
|
|
|
OPTIONS_DEFINE= PNGQUANT UNPAPER
|
|
OPTIONS_DEFAULT=PNGQUANT UNPAPER
|
|
|
|
PNGQUANT_DESC= Optimizes the encoding of PNG-style images in PDFs
|
|
UNPAPER_DESC= Deskew and clean up pages before OCR processing
|
|
|
|
PNGQUANT_RUN_DEPENDS= pngquant:graphics/pngquant
|
|
UNPAPER_RUN_DEPENDS= unpaper:graphics/unpaper
|
|
|
|
post-install:
|
|
# Install shell completion files
|
|
@${MKDIR} ${STAGEDIR}${PREFIX}/etc/bash_completion.d ${STAGEDIR}${PREFIX}/share/fish/vendor_completions.d/
|
|
${INSTALL_DATA} ${WRKSRC}/misc/completion/ocrmypdf.bash ${STAGEDIR}${PREFIX}/etc/bash_completion.d/
|
|
${INSTALL_DATA} ${WRKSRC}/misc/completion/ocrmypdf.fish ${STAGEDIR}${PREFIX}/share/fish/vendor_completions.d/
|
|
|
|
do-test:
|
|
# Skip some checks as they yield wrong results if run with the root account
|
|
@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} -m pytest -rs -v \
|
|
-n ${MAKE_JOBS_NUMBER} -k ' \
|
|
not test_dev_null \
|
|
and not test_input_file_not_readable \
|
|
and not test_chmod'
|
|
|
|
.include <bsd.port.mk>
|