From 3a5ffc79e0d66332fe93aad3c619f5ebcefa1c94 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Sat, 22 Aug 2015 00:30:39 -0700 Subject: [PATCH] Stock debian unpaper is no good; replace with 6.1 built from source debian and ubuntu both install unpaper 0.4.2 or so. No .deb packages available at higher version numbers although ArchLinux had something. Considered making a separate image to handle building and install but decided that was a premature optimization at this point, so just build the unpaper that works. All tests pass. --- Dockerfile | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5fb64ac2..27cefca5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ tesseract-ocr \ tesseract-ocr-deu tesseract-ocr-spa tesseract-ocr-eng tesseract-ocr-fra \ qpdf \ - unpaper \ poppler-utils \ python3 \ python3-pip \ @@ -31,6 +30,37 @@ RUN dpkg-reconfigure locales && \ /usr/sbin/update-locale LANG=C.UTF-8 ENV LC_ALL C.UTF-8 +# Build unpaper 6.1 +RUN apt-get install -y \ + wget \ + gcc \ + libavformat-dev \ + libavcodec-dev \ + libavutil-dev \ + autoconf \ + automake \ + make \ + pkg-config \ + xsltproc + +WORKDIR /root +RUN wget https://github.com/Flameeyes/unpaper/archive/unpaper-6.1.tar.gz +RUN tar xf unpaper-6.1.tar.gz +WORKDIR /root/unpaper-unpaper-6.1 +RUN autoreconf -i +RUN ./configure CFLAGS="-O2 -march=native -pipe -flto" +RUN make -j install + +RUN apt-get remove -y \ + gcc \ + autoconf \ + automake \ + pkg-config \ + xsltproc \ + make +RUN apt-get autoremove -y && apt-get clean -y +RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + # Set up a Python virtualenv and take all of the system packages, so we can # rely on the platform packages rather than importing GCC and compiling them RUN pyvenv /appenv \