From 4f9e6563e25f92c457e174494470c0658d89fe70 Mon Sep 17 00:00:00 2001 From: DavidKorczynski Date: Fri, 17 Sep 2021 19:00:59 +0100 Subject: [PATCH] tesseract-ocr: fix build for latest base builder (#6474) * tesseract-ocr: fix build for latest base builder * tesseract-ocr: download data --- projects/tesseract-ocr/Dockerfile | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/projects/tesseract-ocr/Dockerfile b/projects/tesseract-ocr/Dockerfile index f468f4044..3e02c5ea1 100644 --- a/projects/tesseract-ocr/Dockerfile +++ b/projects/tesseract-ocr/Dockerfile @@ -14,13 +14,25 @@ # ################################################################################ -# Using Ubuntu 16.04 because of breakage on Ubuntu 20.04. -# See https://github.com/google/oss-fuzz/issues/6291 for more details. -FROM gcr.io/oss-fuzz-base/base-builder:xenial -# Delete line above and uncomment line below to upgrade to 20.04. -# FROM gcr.io/oss-fuzz-base/base-builder -RUN apt-get update && apt-get install -y autoconf automake libtool pkg-config libpng-dev libjpeg8-dev libtiff5-dev zlib1g-dev +FROM gcr.io/oss-fuzz-base/base-builder +RUN apt-get update && apt-get install -y autoconf automake libtool pkg-config libpng-dev libjpeg8-dev liblzma-dev + +RUN git clone https://www.cl.cam.ac.uk/~mgk25/git/jbigkit jbigkit && \ + cd jbigkit && \ + make clean && \ + make -j$(nproc) lib && \ + cp libjbig/libjbig.a /usr/lib/x86_64-linux-gnu/libjbig.a + +RUN git clone --depth 1 https://gitlab.com/libtiff/libtiff libtiff && \ + cd libtiff && \ + cmake . -DBUILD_SHARED_LIBS=off && \ + make clean && \ + make -j$(nproc) && \ + make install && \ + cp libtiff/libtiff.a /usr/lib/x86_64-linux-gnu/libtiff.a + RUN git clone --depth 1 https://github.com/danbloomberg/leptonica RUN git clone --depth 1 https://github.com/tesseract-ocr/tesseract RUN git clone --depth 1 https://github.com/tesseract-ocr/tessdata + COPY build.sh $SRC/