core
core copied to clipboard
deps-conda
This starts Conda with deps-conda as a replacement for Apt with deps-ubuntu to install system dependencies.
System dependencies should be encapsulated better than via fixed Linux distributions in OCR-D. Long ago I expressed my conviction that we can find some existing universal mechanism for porting. IMHO Conda fits that description quite well.
So the idea is to allow OCR-D modules to express their system requirements in a deps-conda rule, which will run conda install .... Of course, modules could do even more and provide a full conda build (i.e. build.sh and meta.yaml) and have the Makefile simply delegate to that.
For example, the ocrd/tesserocr Dockerfile could be as simple as
FROM ocrd/core
COPY Makefile .
RUN make deps-conda
RUN pip install .
where that would simply be defined as
deps-conda:
conda install -c conda-forge tesseract leptonica
(which would give us an up to date libtesseract against which pip install tesserocr will compile).
To make that work, this PR lays the foundation in ocrd/core:
- install Conda, if not already present
- install system dependencies for ocrd, ocrd_utils etc. via its own
deps-condarule
Techically, we could separate the second commit (i.e. switching from apt to conda in the Dockerfiles) and save it for another day (when we have the courage).