123456789101112 |
- {% macro builder(build, build_output) -%}
- {% if build.tesseract_languages %}
- {% do build_output.x.append("RUN apt update || { echo 'Failed to update apt cache. Exiting...'; exit 1; }") %}
- {% endif %}
- {# Tesseract OCR Languages #}
- {% for lang in build.tesseract_languages %}
- {% set lang_pack = "tesseract-ocr-%s" | format(lang|replace("_", "-")) %}
- {% do build_output.x.append("RUN apt install -y --no-install-recommends %s || { echo 'Failed to install [%s]. Exiting...'; exit 1; }"|format(lang_pack, lang_pack)) %}
- {% endfor %}
- {%- endmacro %}
|