# syntax=docker/dockerfile:1 # # libmspub (Microsoft Publisher), libcdr (CorelDRAW) and libvisio (Visio), with # librevenge, compiled to one WebAssembly module for johnmcm.com's /pub-viewer, # /cdr-viewer and /visio-viewer. # # Reproducible: the Emscripten image is pinned by version and digest, and every # source tarball by version and SHA-256, downloaded from the projects' own # release locations. Built from the OpenImprenta libmspub-wasm spike # (https://github.com/RicardoNigrelli/libmspub-wasm, MPL-2.0), with libcdr # and lcms2 added. # # ./build.ps1 (or) docker build --target export --output type=local,dest=dist . # # Licences: librevenge, libmspub, libcdr and libvisio are MPL-2.0; lcms2 and # libxml2 are MIT; zlib zlib; ICU Unicode-DFS-2016; Boost headers BSL-1.0. These build # files, with the patches applied to the MPL libraries, are published at # /source/revenge/. The MPL library sources themselves are not copied there: # they are the upstream release tarballs named below by version and SHA-256. ARG EMSDK_IMAGE=emscripten/emsdk:6.0.10@sha256:e077d54e2b8970575ebc4f185ac1de0b95c05f2b266134d4ba27449af7aebf65 FROM ${EMSDK_IMAGE} AS deps ARG LIBREVENGE_VERSION=0.0.5 ARG LIBREVENGE_SHA256=5892ca6796f7a2a93d580832e907e849b19d980b40d326a283b18877ab6de0c5 ARG LIBMSPUB_VERSION=0.1.5 ARG LIBMSPUB_SHA256=3671095f5a10bee8a755052a30576952c5b16d8b0f2ba9f2fb998338c18cb119 ARG LIBCDR_VERSION=0.1.9 ARG LIBCDR_SHA256=f7bb6abdd7f226820f288a93dd8d07759833c0250d9e202af90f9b312c4665a3 ARG LCMS2_VERSION=2.19.1 ARG LCMS2_SHA256=bfc54f7bab59fbc921012014a8032e4cba4abd46db47d46b76416a8c0b2815c8 ARG LIBVISIO_VERSION=0.1.11 ARG LIBVISIO_SHA256=2a6efd40b6d9dbcb70fba3be53112366882ba97b57151df3698dfa478c8d8dd3 ARG LIBXML2_VERSION=2.13.9 ARG LIBXML2_SHA256=a2c9ae7b770da34860050c309f903221c67830c86e4a7e760692b803df95143a # libmspub and libcdr use C++ exceptions for ordinary control flow, so # exceptions stay on, as native WebAssembly exceptions, everywhere. ENV EH_FLAGS="-fwasm-exceptions" ENV PREFIX=/opt/rv ENV PORT_FLAGS="-sUSE_ZLIB=1 -sUSE_ICU=1 -sUSE_BOOST_HEADERS=1" RUN embuilder build icu boost_headers zlib WORKDIR /src RUN curl -fsSL -o librevenge.tar.bz2 https://dev-www.libreoffice.org/src/librevenge-${LIBREVENGE_VERSION}.tar.bz2 \ && echo "${LIBREVENGE_SHA256} librevenge.tar.bz2" | sha256sum -c - \ && curl -fsSL -o libmspub.tar.xz https://dev-www.libreoffice.org/src/libmspub/libmspub-${LIBMSPUB_VERSION}.tar.xz \ && echo "${LIBMSPUB_SHA256} libmspub.tar.xz" | sha256sum -c - \ && curl -fsSL -o libcdr.tar.xz https://dev-www.libreoffice.org/src/libcdr/libcdr-${LIBCDR_VERSION}.tar.xz \ && echo "${LIBCDR_SHA256} libcdr.tar.xz" | sha256sum -c - \ && curl -fsSL -o lcms2.tar.gz https://github.com/mm2/Little-CMS/releases/download/lcms${LCMS2_VERSION}/lcms2-${LCMS2_VERSION}.tar.gz \ && echo "${LCMS2_SHA256} lcms2.tar.gz" | sha256sum -c - \ && curl -fsSL -o libvisio.tar.xz https://dev-www.libreoffice.org/src/libvisio/libvisio-${LIBVISIO_VERSION}.tar.xz \ && echo "${LIBVISIO_SHA256} libvisio.tar.xz" | sha256sum -c - \ && curl -fsSL -o libxml2.tar.xz https://download.gnome.org/sources/libxml2/2.13/libxml2-${LIBXML2_VERSION}.tar.xz \ && echo "${LIBXML2_SHA256} libxml2.tar.xz" | sha256sum -c - \ && tar xjf librevenge.tar.bz2 && tar xJf libmspub.tar.xz && tar xJf libcdr.tar.xz && tar xzf lcms2.tar.gz \ && tar xJf libvisio.tar.xz && tar xJf libxml2.tar.xz # librevenge: core and streams (the generators are not needed: ours is in src/). WORKDIR /src/librevenge-${LIBREVENGE_VERSION} RUN emconfigure ./configure --prefix=${PREFIX} \ --disable-shared --enable-static \ --disable-tests --without-docs --disable-werror --disable-weffc \ --enable-streams --disable-generators \ CFLAGS="-Oz ${EH_FLAGS}" CXXFLAGS="-Oz ${EH_FLAGS} ${PORT_FLAGS}" CPPFLAGS="${PORT_FLAGS}" \ LDFLAGS="${PORT_FLAGS} ${EH_FLAGS}" \ ZLIB_CFLAGS=" " ZLIB_LIBS="-sUSE_ZLIB=1" \ && emmake make -j"$(nproc)" && emmake make install # lcms2 (colour management, used by libcdr for CMYK and spot colours). WORKDIR /src/lcms2-${LCMS2_VERSION} RUN emconfigure ./configure --prefix=${PREFIX} --disable-shared --enable-static \ --without-jpeg --without-tiff --without-zlib CFLAGS="-Oz" \ && emmake make -j"$(nproc)" -C src && emmake make -C src install && emmake make -C include install # libmspub, with the spike's three patches. COPY patches/libmspub/ /patches/libmspub/ WORKDIR /src/libmspub-${LIBMSPUB_VERSION} RUN for p in /patches/libmspub/*.patch; do echo "applying $p"; git apply --verbose "$p"; done \ && emconfigure ./configure --prefix=${PREFIX} \ --disable-shared --enable-static \ --disable-tools --disable-fuzzers --without-docs --disable-werror --disable-weffc \ CFLAGS="-Oz ${EH_FLAGS}" CXXFLAGS="-Oz ${EH_FLAGS} ${PORT_FLAGS}" CPPFLAGS="${PORT_FLAGS}" \ LDFLAGS="${PORT_FLAGS} ${EH_FLAGS}" \ REVENGE_CFLAGS="-I${PREFIX}/include/librevenge-0.0" REVENGE_LIBS="-L${PREFIX}/lib -lrevenge-0.0" \ ZLIB_CFLAGS=" " ZLIB_LIBS="-sUSE_ZLIB=1" ICU_CFLAGS=" " ICU_LIBS="-sUSE_ICU=1" \ && emmake make -j"$(nproc)" && emmake make install # libcdr. WORKDIR /src/libcdr-${LIBCDR_VERSION} RUN emconfigure ./configure --prefix=${PREFIX} \ --disable-shared --enable-static \ --disable-tools --disable-fuzzers --disable-tests --without-docs --disable-werror --disable-weffc \ CFLAGS="-Oz ${EH_FLAGS}" CXXFLAGS="-Oz ${EH_FLAGS} ${PORT_FLAGS}" CPPFLAGS="${PORT_FLAGS} -I${PREFIX}/include" \ LDFLAGS="${PORT_FLAGS} ${EH_FLAGS} -L${PREFIX}/lib" \ REVENGE_CFLAGS="-I${PREFIX}/include/librevenge-0.0" REVENGE_LIBS="-L${PREFIX}/lib -lrevenge-0.0" \ LCMS2_CFLAGS="-I${PREFIX}/include" LCMS2_LIBS="-L${PREFIX}/lib -llcms2" \ ZLIB_CFLAGS=" " ZLIB_LIBS="-sUSE_ZLIB=1" ICU_CFLAGS=" " ICU_LIBS="-sUSE_ICU=1" \ && emmake make -j"$(nproc)" && emmake make install # libxml2 (MIT), the XML reader libvisio uses for .vsdx and .vdx: just the # parser and reader, no network, threads, compression or iconv (the files are # UTF-8 or UTF-16, which libxml2 decodes itself). WORKDIR /src/libxml2-${LIBXML2_VERSION} RUN emconfigure ./configure --prefix=${PREFIX} --disable-shared --enable-static \ --without-python --without-http --without-ftp --without-threads --without-thread-alloc \ --without-zlib --without-lzma --without-iconv --without-icu --without-modules \ --without-debug --without-catalog --without-schematron --without-xinclude \ CFLAGS="-Oz" \ && emmake make -j"$(nproc)" libxml2.la && emmake make install-libLTLIBRARIES install-pkgconfigDATA \ && emmake make -C include install # libvisio (Microsoft Visio .vsd, .vdx, .vsdx, stencils and templates). Its # XML token table is generated at build time with gperf. RUN apt-get update && apt-get install -y --no-install-recommends gperf=3.1-1build1 && rm -rf /var/lib/apt/lists/* WORKDIR /src/libvisio-${LIBVISIO_VERSION} RUN emconfigure ./configure --prefix=${PREFIX} \ --disable-shared --enable-static \ --disable-tools --disable-fuzzers --disable-tests --without-docs --disable-werror --disable-weffc \ CFLAGS="-Oz ${EH_FLAGS}" CXXFLAGS="-Oz ${EH_FLAGS} ${PORT_FLAGS}" CPPFLAGS="${PORT_FLAGS} -I${PREFIX}/include" \ LDFLAGS="${PORT_FLAGS} ${EH_FLAGS} -L${PREFIX}/lib" \ REVENGE_CFLAGS="-I${PREFIX}/include/librevenge-0.0" REVENGE_LIBS="-L${PREFIX}/lib -lrevenge-0.0" \ LIBXML_CFLAGS="-I${PREFIX}/include/libxml2" LIBXML_LIBS="-L${PREFIX}/lib -lxml2" \ ICU_CFLAGS=" " ICU_LIBS="-sUSE_ICU=1" \ && emmake make -j"$(nproc)" && emmake make install # Filtered ICU data: only the codepage converters the libraries ask for. FROM deps AS icudata RUN apt-get update && apt-get install -y --no-install-recommends icu-devtools=74.2-1ubuntu3.1 && rm -rf /var/lib/apt/lists/* COPY icu/make-icudata.sh /icu/make-icudata.sh RUN bash /icu/make-icudata.sh /opt/icudata FROM deps AS wasm WORKDIR /binding COPY --from=icudata /opt/icudata/icudata_subset.c ./ COPY src/ ./ RUN bash ./compile.sh /out FROM scratch AS export COPY --from=wasm /out/ / # --------------------------------------------------------------------------- # A second module, dtp.wasm, for the QuarkXPress, PageMaker and FreeHand # viewers: libqxp, libpagemaker and libfreehand on the same librevenge, lcms2 # and Emscripten build. Its own module, so the Publisher, CorelDRAW and Visio # viewers do not download these readers. # # docker build --target dtp-export --output type=local,dest=dist-dtp . FROM deps AS dtpdeps ARG LIBQXP_VERSION=0.0.2 ARG LIBQXP_SHA256=e137b6b110120a52c98edd02ebdc4095ee08d0d5295a94316a981750095a945c ARG LIBPAGEMAKER_VERSION=0.0.4 ARG LIBPAGEMAKER_SHA256=66adacd705a7d19895e08eac46d1e851332adf2e736c566bef1164e7a442519d ARG LIBFREEHAND_VERSION=0.1.2 ARG LIBFREEHAND_SHA256=0e422d1564a6dbf22a9af598535425271e583514c0f7ba7d9091676420de34ac WORKDIR /src RUN curl -fsSL -o libqxp.tar.xz https://dev-www.libreoffice.org/src/libqxp/libqxp-${LIBQXP_VERSION}.tar.xz \ && echo "${LIBQXP_SHA256} libqxp.tar.xz" | sha256sum -c - \ && curl -fsSL -o libpagemaker.tar.xz https://dev-www.libreoffice.org/src/libpagemaker/libpagemaker-${LIBPAGEMAKER_VERSION}.tar.xz \ && echo "${LIBPAGEMAKER_SHA256} libpagemaker.tar.xz" | sha256sum -c - \ && curl -fsSL -o libfreehand.tar.xz https://dev-www.libreoffice.org/src/libfreehand/libfreehand-${LIBFREEHAND_VERSION}.tar.xz \ && echo "${LIBFREEHAND_SHA256} libfreehand.tar.xz" | sha256sum -c - \ && tar xJf libqxp.tar.xz && tar xJf libpagemaker.tar.xz && tar xJf libfreehand.tar.xz ENV DTP_FLAGS="--disable-shared --enable-static --disable-tools --disable-fuzzers --disable-tests --without-docs --disable-werror --disable-weffc" # libqxp (QuarkXPress 3.1 to 4.x, and the pages of 5 and 6). WORKDIR /src/libqxp-${LIBQXP_VERSION} RUN emconfigure ./configure --prefix=${PREFIX} ${DTP_FLAGS} \ CFLAGS="-Oz ${EH_FLAGS}" CXXFLAGS="-Oz ${EH_FLAGS} ${PORT_FLAGS}" CPPFLAGS="${PORT_FLAGS} -I${PREFIX}/include" \ LDFLAGS="${PORT_FLAGS} ${EH_FLAGS} -L${PREFIX}/lib" \ REVENGE_CFLAGS="-I${PREFIX}/include/librevenge-0.0" REVENGE_LIBS="-L${PREFIX}/lib -lrevenge-0.0" \ ICU_CFLAGS=" " ICU_LIBS="-sUSE_ICU=1" \ && emmake make -j"$(nproc)" && emmake make install # libpagemaker (Adobe PageMaker 6 and 7), with text bytes from 0x80 up read as Windows-1252 # instead of dropped, and facing pages placed by spread (and every page read) instead of drawn # on top of each other. COPY patches/libpagemaker/ /patches/libpagemaker/ WORKDIR /src/libpagemaker-${LIBPAGEMAKER_VERSION} RUN for p in /patches/libpagemaker/*.patch; do echo "applying $p"; git apply --verbose "$p"; done && emconfigure ./configure --prefix=${PREFIX} ${DTP_FLAGS} \ CFLAGS="-Oz ${EH_FLAGS}" CXXFLAGS="-Oz ${EH_FLAGS} ${PORT_FLAGS}" CPPFLAGS="${PORT_FLAGS} -I${PREFIX}/include" \ LDFLAGS="${PORT_FLAGS} ${EH_FLAGS} -L${PREFIX}/lib" \ REVENGE_CFLAGS="-I${PREFIX}/include/librevenge-0.0" REVENGE_LIBS="-L${PREFIX}/lib -lrevenge-0.0" \ && emmake make -j"$(nproc)" && emmake make install # libfreehand (Macromedia FreeHand 3 to 11 / MX), with one fix for current ICU. Its token tables are # generated with gperf, installed in deps. COPY patches/libfreehand/ /patches/libfreehand/ WORKDIR /src/libfreehand-${LIBFREEHAND_VERSION} RUN for p in /patches/libfreehand/*.patch; do echo "applying $p"; git apply --verbose "$p"; done && emconfigure ./configure --prefix=${PREFIX} ${DTP_FLAGS} \ CFLAGS="-Oz ${EH_FLAGS}" CXXFLAGS="-Oz ${EH_FLAGS} ${PORT_FLAGS}" CPPFLAGS="${PORT_FLAGS} -I${PREFIX}/include" \ LDFLAGS="${PORT_FLAGS} ${EH_FLAGS} -L${PREFIX}/lib" \ REVENGE_CFLAGS="-I${PREFIX}/include/librevenge-0.0" REVENGE_LIBS="-L${PREFIX}/lib -lrevenge-0.0" \ LCMS2_CFLAGS="-I${PREFIX}/include" LCMS2_LIBS="-L${PREFIX}/lib -llcms2" \ ZLIB_CFLAGS=" " ZLIB_LIBS="-sUSE_ZLIB=1" ICU_CFLAGS=" " ICU_LIBS="-sUSE_ICU=1" \ && emmake make -j"$(nproc)" && emmake make install # ICU data with the converters libqxp asks for besides the Windows ones: Mac Roman ("macroman"). FROM dtpdeps AS dtpicu RUN apt-get update && apt-get install -y --no-install-recommends icu-devtools=74.2-1ubuntu3.1 && rm -rf /var/lib/apt/lists/* COPY icu/make-icudata.sh /icu/make-icudata.sh RUN EXTRA_ITEMS="macos-0_2-10.2.cnv" bash /icu/make-icudata.sh /opt/icudata FROM dtpdeps AS dtpwasm WORKDIR /binding COPY --from=dtpicu /opt/icudata/icudata_subset.c ./ COPY src/ ./ RUN bash ./compile_dtp.sh /out FROM scratch AS dtp-export COPY --from=dtpwasm /out/ / # The old Mac document module (mac.wasm) for the AppleWorks / ClarisWorks and # MacWrite viewers: libmwaw (MPL-2.0 or LGPL-2.1+, used under the MPL), which # reads some fifty pre-OS X word processors, drawing, paint and spreadsheet # programs. Word processing files go through librevenge's HTML generator, # spreadsheets and databases through its CSV generator, drawings and paintings # through our JSON drawing generator. No ICU: libmwaw decodes Mac text itself. # # docker build --target mac-export --output type=local,dest=dist-mac . FROM deps AS macdeps ARG LIBMWAW_VERSION=0.3.23 ARG LIBMWAW_SHA256=ac3590f691a2904eb8c7dc8b757b8a29f125f592449e421459ae8fa928b399eb # librevenge again, this time with its generators. WORKDIR /src/librevenge-${LIBREVENGE_VERSION} RUN emmake make distclean \ && emconfigure ./configure --prefix=${PREFIX} \ --disable-shared --enable-static \ --disable-tests --without-docs --disable-werror --disable-weffc \ --enable-streams --enable-generators \ CFLAGS="-Oz ${EH_FLAGS}" CXXFLAGS="-Oz ${EH_FLAGS} ${PORT_FLAGS}" CPPFLAGS="${PORT_FLAGS}" \ LDFLAGS="${PORT_FLAGS} ${EH_FLAGS}" \ ZLIB_CFLAGS=" " ZLIB_LIBS="-sUSE_ZLIB=1" \ && emmake make -j"$(nproc)" && emmake make install # libmwaw's configure insists on the pkg-config program, even with the flags given. RUN apt-get update && apt-get install -y --no-install-recommends pkg-config=1.8.1-2build1 && rm -rf /var/lib/apt/lists/* WORKDIR /src RUN curl -fsSL -o libmwaw.tar.xz https://dev-www.libreoffice.org/src/libmwaw-${LIBMWAW_VERSION}.tar.xz \ && echo "${LIBMWAW_SHA256} libmwaw.tar.xz" | sha256sum -c - \ && tar xJf libmwaw.tar.xz WORKDIR /src/libmwaw-${LIBMWAW_VERSION} RUN emconfigure ./configure --prefix=${PREFIX} \ --disable-shared --enable-static \ --disable-tools --disable-zip --disable-fuzzers --without-docs --disable-werror --disable-weffc \ CFLAGS="-Oz ${EH_FLAGS}" CXXFLAGS="-Oz ${EH_FLAGS} ${PORT_FLAGS}" CPPFLAGS="${PORT_FLAGS} -I${PREFIX}/include" \ LDFLAGS="${PORT_FLAGS} ${EH_FLAGS} -L${PREFIX}/lib" \ REVENGE_CFLAGS="-I${PREFIX}/include/librevenge-0.0" REVENGE_LIBS="-L${PREFIX}/lib -lrevenge-0.0" \ && emmake make -j"$(nproc)" && emmake make install FROM macdeps AS macwasm WORKDIR /binding COPY src/ ./ RUN bash ./compile_mac.sh /out FROM scratch AS mac-export COPY --from=macwasm /out/ / # The StarOffice module (star.wasm) for the Works Viewer's StarOffice 3 to 5.2 # documents: libstaroffice (MPL-2.0 or LGPL-2.1+, used under the MPL), which # reads StarWriter (.sdw, .sgl, .vor), StarCalc (.sdc), StarDraw (.sda) and # StarImpress (.sdd) files. Text and spreadsheets come back as the recorder's # events, drawings through our JSON drawing generator, presentations as # librevenge's SVG, with two fixes (patches/libstaroffice). It is built on the old Mac module's stage, which already # has librevenge with its generators and pkg-config. # # docker build --target star-export --output type=local,dest=dist-star . FROM macdeps AS stardeps ARG LIBSTAROFFICE_VERSION=0.0.7 ARG LIBSTAROFFICE_SHA256=f94fb0ad8216f97127bedef163a45886b43c62deac5e5b0f5e628e234220c8db WORKDIR /src RUN curl -fsSL -o libstaroffice.tar.xz https://dev-www.libreoffice.org/src/libstaroffice-${LIBSTAROFFICE_VERSION}.tar.xz \ && echo "${LIBSTAROFFICE_SHA256} libstaroffice.tar.xz" | sha256sum -c - \ && tar xJf libstaroffice.tar.xz # Two fixes: lengths near 4 GB in a damaged file no longer wrap past their bounds checks (long is 32 bits # here), and a Calc file's encryption flag is read from its own stream. COPY patches/libstaroffice/ /patches/libstaroffice/ WORKDIR /src/libstaroffice-${LIBSTAROFFICE_VERSION} RUN for p in /patches/libstaroffice/*.patch; do echo "applying $p"; git apply --verbose "$p"; done && emconfigure ./configure --prefix=${PREFIX} \ --disable-shared --enable-static \ --disable-tools --disable-fuzzers --without-docs --disable-werror --disable-weffc \ CFLAGS="-Oz ${EH_FLAGS}" CXXFLAGS="-Oz ${EH_FLAGS} ${PORT_FLAGS}" CPPFLAGS="${PORT_FLAGS} -I${PREFIX}/include" \ LDFLAGS="${PORT_FLAGS} ${EH_FLAGS} -L${PREFIX}/lib" \ REVENGE_CFLAGS="-I${PREFIX}/include/librevenge-0.0" REVENGE_LIBS="-L${PREFIX}/lib -lrevenge-0.0" \ ZLIB_CFLAGS=" " ZLIB_LIBS="-sUSE_ZLIB=1" \ && emmake make -j"$(nproc)" && emmake make install FROM stardeps AS starwasm WORKDIR /binding COPY src/ ./ RUN bash ./compile_star.sh /out FROM scratch AS star-export COPY --from=starwasm /out/ / # The File Opener's drawing module (draw.wasm): WordPerfect Graphics clip art # (libwpg 0.3.4, WPG 1 and 2, with libwpd 0.10.3 for the text a WPG file keeps # as WordPerfect text) and Zoner Draw / Zoner Callisto drawings (libzmf 0.0.2, # with libpng for the pictures it hands on). All MPL-2.0 (libwpg and libwpd # also LGPL-2.1+, used under the MPL). Its own module, so revenge.wasm, which # the Publisher viewer downloads, does not grow. Built on deps (librevenge # with its streams); libzmf decodes its text as UTF-16, which ICU converts # without data, so no ICU data file. # # docker build --target draw-export --output type=local,dest=dist-draw . FROM deps AS drawdeps ARG LIBWPD_VERSION=0.10.3 ARG LIBWPD_SHA256=2465b0b662fdc5d4e3bebcdc9a79027713fb629ca2bff04a3c9251fdec42dd09 ARG LIBWPG_VERSION=0.3.4 ARG LIBWPG_SHA256=b55fda9440d1e070630eb2487d8b8697cf412c214a27caee9df69cec7c004de3 ARG LIBZMF_VERSION=0.0.2 ARG LIBZMF_SHA256=27051a30cb057fdb5d5de65a1f165c7153dc76e27fe62251cbb86639eb2caf22 RUN embuilder build libpng RUN apt-get update && apt-get install -y --no-install-recommends pkg-config=1.8.1-2build1 && rm -rf /var/lib/apt/lists/* WORKDIR /src RUN curl -fsSL -o libwpd.tar.xz https://dev-www.libreoffice.org/src/libwpd-${LIBWPD_VERSION}.tar.xz \ && echo "${LIBWPD_SHA256} libwpd.tar.xz" | sha256sum -c - \ && curl -fsSL -o libwpg.tar.xz https://dev-www.libreoffice.org/src/libwpg-${LIBWPG_VERSION}.tar.xz \ && echo "${LIBWPG_SHA256} libwpg.tar.xz" | sha256sum -c - \ && curl -fsSL -o libzmf.tar.xz https://dev-www.libreoffice.org/src/libzmf/libzmf-${LIBZMF_VERSION}.tar.xz \ && echo "${LIBZMF_SHA256} libzmf.tar.xz" | sha256sum -c - \ && tar xJf libwpd.tar.xz && tar xJf libwpg.tar.xz && tar xJf libzmf.tar.xz ENV DRAW_FLAGS="--disable-shared --enable-static --disable-tools --disable-fuzzers --without-docs --disable-werror --disable-weffc" # libwpd (WordPerfect documents): libwpg reads a WPG file's text boxes with it. WORKDIR /src/libwpd-${LIBWPD_VERSION} RUN emconfigure ./configure --prefix=${PREFIX} ${DRAW_FLAGS} \ CFLAGS="-Oz ${EH_FLAGS}" CXXFLAGS="-Oz ${EH_FLAGS} ${PORT_FLAGS}" CPPFLAGS="${PORT_FLAGS}" \ LDFLAGS="${PORT_FLAGS} ${EH_FLAGS}" \ REVENGE_CFLAGS="-I${PREFIX}/include/librevenge-0.0" REVENGE_LIBS="-L${PREFIX}/lib -lrevenge-0.0" \ REVENGE_STREAM_CFLAGS="-I${PREFIX}/include/librevenge-0.0" REVENGE_STREAM_LIBS="-L${PREFIX}/lib -lrevenge-stream-0.0" \ && emmake make -j"$(nproc)" && emmake make install # libwpg (WordPerfect Graphics 1 and 2). WORKDIR /src/libwpg-${LIBWPG_VERSION} RUN emconfigure ./configure --prefix=${PREFIX} ${DRAW_FLAGS} \ CFLAGS="-Oz ${EH_FLAGS}" CXXFLAGS="-Oz ${EH_FLAGS} ${PORT_FLAGS}" CPPFLAGS="${PORT_FLAGS}" \ LDFLAGS="${PORT_FLAGS} ${EH_FLAGS}" \ REVENGE_CFLAGS="-I${PREFIX}/include/librevenge-0.0" REVENGE_LIBS="-L${PREFIX}/lib -lrevenge-0.0" \ WPD_CFLAGS="-I${PREFIX}/include/libwpd-0.10" WPD_LIBS="-L${PREFIX}/lib -lwpd-0.10" \ && emmake make -j"$(nproc)" && emmake make install # libzmf (Zoner Draw and Zoner Callisto 4 and 5). WORKDIR /src/libzmf-${LIBZMF_VERSION} RUN emconfigure ./configure --prefix=${PREFIX} ${DRAW_FLAGS} --disable-tests \ CFLAGS="-Oz ${EH_FLAGS}" CXXFLAGS="-Oz ${EH_FLAGS} ${PORT_FLAGS} -sUSE_LIBPNG=1" CPPFLAGS="${PORT_FLAGS} -sUSE_LIBPNG=1" \ LDFLAGS="${PORT_FLAGS} ${EH_FLAGS} -sUSE_LIBPNG=1" \ REVENGE_CFLAGS="-I${PREFIX}/include/librevenge-0.0" REVENGE_LIBS="-L${PREFIX}/lib -lrevenge-0.0" \ ZLIB_CFLAGS=" " ZLIB_LIBS="-sUSE_ZLIB=1" LIBPNG_CFLAGS=" " LIBPNG_LIBS="-sUSE_LIBPNG=1" \ ICU_CFLAGS=" " ICU_LIBS="-sUSE_ICU=1" \ && emmake make -j"$(nproc)" && emmake make install FROM drawdeps AS drawwasm WORKDIR /binding COPY src/ ./ RUN bash ./compile_draw.sh /out FROM scratch AS draw-export COPY --from=drawwasm /out/ /