[cairo] Error during CMakeFiles with pdf2htmlEX

David Faizulaev dfaizulaev at chegg.com
Thu Aug 5 11:33:07 UTC 2021


Hello,

I’m working on upgrading a Docker image which uses Cairo, poppler and pdf2htmlEX and encounter cairo compilation related errors.

Here my dockerfile

FROM 342484191705.dkr.ecr.us-west-2.amazonaws.com/node-ghost:master

RUN echo $ECR_IMAGE_TAG_NONPROD
RUN echo $ARTIFACTORY_USER_NAME
RUN echo $ARTIFACTORY_PASSWORD
RUN echo $BUILD_CHEGG_ENV
RUN echo $SVC_AWS_ACCESS_KEY_ID
RUN echo $SVC_AWS_SECRET_ACCESS_KEY
RUN echo $SVC_AWS_DEFAULT_REGION

RUN echo $CI_PROJECT_DIR
RUN dpkg --configure -a
RUN apt-get clean
RUN apt-get update
RUN apt-get install -f -y python3
RUN apt-get install dialog apt-utils -y
RUN apt-get install -f -y python3-pip
RUN apt-get install -f -y python3-setuptools
RUN apt-get install -f -y wget
RUN apt-get install -f -y poppler-utils
RUN apt-get install -f -y jq
RUN apt-get install -f -y pdftk
RUN apt-get install -f -y ffmpeg
RUN apt-get install -f -y build-essential
RUN apt-get install -f -y cmake
RUN apt-get install -f -y libfontforge-dev
RUN pip3 install --upgrade pip \
    && apt-get clean
RUN pip3 --no-cache-dir install --upgrade awscli
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
#RUN apt-get install -f -y libpaper1
#RUN apt-get --purge remove -f -y libpaper1:amd64 libpaper-utils unattended-upgrades libgs9:amd64 ghostscript
#RUN apt-get clean -y
#RUN apt-get update  -y && apt-get upgrade -y
#RUN apt autoremove -y
#RUN apt-get install -f -y ghostscript --option=Dpkg::Options::=--force-all
WORKDIR /tmp

COPY lib/cairo-1.17.4.tar.xz /tmp

RUN wget https://cairographics.org/releases/pixman-0.36.0.tar.gz
RUN tar xvfz pixman-0.36.0.tar.gz
RUN ./pixman-0.36.0/configure && make && make install

RUN tar -xf cairo-1.17.4.tar.xz
RUN ./cairo-1.17.4/configure --prefix=/tmp/cairob && make && make install
RUN cp -r /tmp/cairob/lib/* /usr/lib/x86_64-linux-gnu/

COPY lib/poppler-poppler-0.70.0.tar.gz /tmp
RUN tar -xvf poppler-poppler-0.70.0.tar.gz
WORKDIR /tmp/poppler-poppler-0.70.0
# compile and install the poppler for debian..
RUN mkdir build && cd build && cmake  -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -L$HOME/prefix/lib -I$HOME/prefix/include -DTESTDATADIR=$PWD/testfiles -DENABLE_XPDF_HEADERS=ON  .. && make && make install

WORKDIR /tmp

COPY lib/pdf2htmlEX-0.15.0.tar.gz /tmp
RUN tar -xf /tmp/pdf2htmlEX-0.15.0.tar.gz
WORKDIR /tmp/pdf2htmlEX-0.15.0
# get the created poopler config file pass it as agrument to pdf2htmlEX
COPY ./includes/ /tmp/pdf2htmlEX-0.15.0/3rdparty/
RUN cp /tmp/poppler-poppler-0.70.0/build/poppler/poppler-config.h /tmp/pdf2htmlEX-0.15.0/3rdparty/poppler/git/

RUN cmake -L$HOME/prefix/lib -I$HOME/prefix/include . && make && make install

RUN wget https://www.imagemagick.org/download/ImageMagick.tar.gz && \
tar -xf ImageMagick.tar.gz && \
cd ImageMagick* && \
./configure && \
make && \
make install && \
ldconfig /usr/local/lib



and here is the error I get during docker build:

#51 2.179 [  2%] Building CXX object CMakeFiles/pdf2htmlEX.dir/3rdparty/poppler/git/CairoFontEngine.cc.o
#51 2.900 In file included from /tmp/pdf2htmlEX-0.15.0/3rdparty/poppler/git/CairoFontEngine.cc:41:0:
#51 2.900 /tmp/pdf2htmlEX-0.15.0/3rdparty/poppler/git/CairoOutputDev.h:148:8: error: 'void CairoOutputDev::setDefaultCTM(double*)' marked 'override', but does not override
#51 2.900    void setDefaultCTM(double *ctm) override;
#51 2.900         ^~~~~~~~~~~~~
#51 2.900 /tmp/pdf2htmlEX-0.15.0/3rdparty/poppler/git/CairoOutputDev.h:172:9: error: 'GBool CairoOutputDev::tilingPatternFill(GfxState*, Gfx*, Catalog*, Object*, double*, int, int, Dict*, double*, double*, int, int, int, int, double, double)' marked 'override', but does not override
#51 2.900    GBool tilingPatternFill(GfxState *state, Gfx *gfx, Catalog *cat, Object *str,
#51 2.900          ^~~~~~~~~~~~~~~~~
#51 2.900 /tmp/pdf2htmlEX-0.15.0/3rdparty/poppler/git/CairoOutputDev.h:194:8: error: 'void CairoOutputDev::beginString(GfxState*, GooString*)' marked 'override', but does not override
#51 2.900    void beginString(GfxState *state, GooString *s) override;
#51 2.900         ^~~~~~~~~~~
#51 2.900 /tmp/pdf2htmlEX-0.15.0/3rdparty/poppler/git/CairoOutputDev.h:200:8: error: 'void CairoOutputDev::beginActualText(GfxState*, GooString*)' marked 'override', but does not override
#51 2.900    void beginActualText(GfxState *state, GooString *text) override;
#51 2.900         ^~~~~~~~~~~~~~~
#51 2.900 /tmp/pdf2htmlEX-0.15.0/3rdparty/poppler/git/CairoOutputDev.h:247:8: error: 'void CairoOutputDev::beginTransparencyGroup(GfxState*, double*, GfxColorSpace*, GBool, GBool, GBool)' marked 'override', but does not override
#51 2.900    void beginTransparencyGroup(GfxState * /*state*/, double * /*bbox*/,
#51 2.900         ^~~~~~~~~~~~~~~~~~~~~~
#51 2.900 /tmp/pdf2htmlEX-0.15.0/3rdparty/poppler/git/CairoOutputDev.h:253:8: error: 'void CairoOutputDev::paintTransparencyGroup(GfxState*, double*)' marked 'override', but does not override
#51 2.900    void paintTransparencyGroup(GfxState * /*state*/, double * /*bbox*/) override;
#51 2.900         ^~~~~~~~~~~~~~~~~~~~~~
#51 2.900 /tmp/pdf2htmlEX-0.15.0/3rdparty/poppler/git/CairoOutputDev.h:254:8: error: 'void CairoOutputDev::setSoftMask(GfxState*, double*, GBool, Function*, GfxColor*)' marked 'override', but does not override
#51 2.900    void setSoftMask(GfxState * /*state*/, double * /*bbox*/, GBool /*alpha*/,
#51 2.900         ^~~~~~~~~~~
#51 2.902 /tmp/pdf2htmlEX-0.15.0/3rdparty/poppler/git/CairoOutputDev.h:433:8: error: 'void CairoImageOutputDev::setDefaultCTM(double*)' marked 'override', but does not override
#51 2.902    void setDefaultCTM(double *ctm) override { }
#51 2.902         ^~~~~~~~~~~~~
#51 2.902 /tmp/pdf2htmlEX-0.15.0/3rdparty/poppler/git/CairoOutputDev.h:456:9: error: 'GBool CairoImageOutputDev::tilingPatternFill(GfxState*, Gfx*, Catalog*, Object*, double*, int, int, Dict*, double*, double*, int, int, int, int, double, double)' marked 'override', but does not override
#51 2.902    GBool tilingPatternFill(GfxState *state, Gfx *gfx, Catalog *cat, Object *str,
#51 2.902          ^~~~~~~~~~~~~~~~~
#51 2.902 /tmp/pdf2htmlEX-0.15.0/3rdparty/poppler/git/CairoOutputDev.h:501:8: error: 'void CairoImageOutputDev::beginTransparencyGroup(GfxState*, double*, GfxColorSpace*, GBool, GBool, GBool)' marked 'override', but does not override
#51 2.902    void beginTransparencyGroup(GfxState * /*state*/, double * /*bbox*/,
#51 2.902         ^~~~~~~~~~~~~~~~~~~~~~
#51 2.902 /tmp/pdf2htmlEX-0.15.0/3rdparty/poppler/git/CairoOutputDev.h:506:8: error: 'void CairoImageOutputDev::paintTransparencyGroup(GfxState*, double*)' marked 'override', but does not override
#51 2.902    void paintTransparencyGroup(GfxState * /*state*/, double * /*bbox*/) override {}
#51 2.902         ^~~~~~~~~~~~~~~~~~~~~~
#51 2.902 /tmp/pdf2htmlEX-0.15.0/3rdparty/poppler/git/CairoOutputDev.h:507:8: error: 'void CairoImageOutputDev::setSoftMask(GfxState*, double*, GBool, Function*, GfxColor*)' marked 'override', but does not override
#51 2.902    void setSoftMask(GfxState * /*state*/, double * /*bbox*/, GBool /*alpha*/,
#51 2.902         ^~~~~~~~~~~
#51 2.961 /tmp/pdf2htmlEX-0.15.0/3rdparty/poppler/git/CairoFontEngine.cc: In member function 'double CairoFont::getSubstitutionCorrection(GfxFont*)':
#51 2.961 /tmp/pdf2htmlEX-0.15.0/3rdparty/poppler/git/CairoFontEngine.cc:123:56: error: invalid conversion from 'const char*' to 'char*' [-fpermissive]
#51 2.961        if ((name = ((Gfx8BitFont *)gfxFont)->getCharName(code)) &&
#51 2.961                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
#51 2.962 /tmp/pdf2htmlEX-0.15.0/3rdparty/poppler/git/CairoFontEngine.cc: In static member function 'static CairoFreeTypeFont* CairoFreeTypeFont::create(GfxFont*, XRef*, FT_Library, GBool)':
#51 2.962 /tmp/pdf2htmlEX-0.15.0/3rdparty/poppler/git/CairoFontEngine.cc:448:37: error: invalid conversion from 'const char*' to 'char*' [-fpermissive]
#51 2.962      fileNameC = fileName->getCString();
#51 2.962                  ~~~~~~~~~~~~~~~~~~~~^~
#51 2.964 /tmp/pdf2htmlEX-0.15.0/3rdparty/poppler/git/CairoFontEngine.cc: In function 'cairo_status_t _init_type3_glyph(cairo_scaled_font_t*, cairo_t*, cairo_font_extents_t*)':
#51 2.964 /tmp/pdf2htmlEX-0.15.0/3rdparty/poppler/git/CairoFontEngine.cc:645:26: error: invalid conversion from 'const double*' to 'double*' [-fpermissive]
#51 2.964    mat = font->getFontBBox();
#51 2.964          ~~~~~~~~~~~~~~~~~^~
#51 2.964 /tmp/pdf2htmlEX-0.15.0/3rdparty/poppler/git/CairoFontEngine.cc: In function 'cairo_status_t _render_type3_glyph(cairo_scaled_font_t*, long unsigned int, cairo_t*, cairo_text_extents_t*)':
#51 2.964 /tmp/pdf2htmlEX-0.15.0/3rdparty/poppler/git/CairoFontEngine.cc:686:28: error: invalid conversion from 'const double*' to 'double*' [-fpermissive]
#51 2.964    mat = font->getFontMatrix();
#51 2.964          ~~~~~~~~~~~~~~~~~~~^~
#51 2.965 /tmp/pdf2htmlEX-0.15.0/3rdparty/poppler/git/CairoFontEngine.cc:701:26: error: invalid conversion from 'const double*' to 'double*' [-fpermissive]
#51 2.965    mat = font->getFontBBox();
#51 2.965          ~~~~~~~~~~~~~~~~~^~
#51 3.045 make[2]: *** [CMakeFiles/pdf2htmlEX.dir/3rdparty/poppler/git/CairoFontEngine.cc.o] Error 1
#51 3.045 CMakeFiles/pdf2htmlEX.dir/build.make:62: recipe for target 'CMakeFiles/pdf2htmlEX.dir/3rdparty/poppler/git/CairoFontEngine.cc.o' failed
#51 3.045 CMakeFiles/Makefile2:355: recipe for target 'CMakeFiles/pdf2htmlEX.dir/all' failed
#51 3.045 make[1]: *** [CMakeFiles/pdf2htmlEX.dir/all] Error 2
#51 3.046 make: *** [all] Error 2
#51 3.046 Makefile:138: recipe for target 'all' failed

Please advise how I can resolve this
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo/attachments/20210805/78ec8468/attachment-0001.htm>


More information about the cairo mailing list