Debian Codegraph @

Dockerfile.win64

raw
1 FROM debian:bookworm@sha256:b5fd0730c71f88a75e9d95dc6d812e8c34db679b3f009903d917be8f0300ba13 AS builder
2
3 LABEL maintainer="Liblouis Maintainers <[email protected]>"
4
5 # Fetch build dependencies
6 RUN apt-get update && apt-get install -y \
7 autoconf \
8 automake \
9 curl \
10 libtool \
11 make \
12 mingw-w64 \
13 pkg-config \
14 texinfo \
15 wine64 \
16 zip \
17 patch \
18 && rm -rf /var/lib/apt/lists/*
19
20 ARG LIBYAML_VERSION=0.1.4
21 ENV HOST=x86_64-w64-mingw32 PREFIX=/usr/build/win64 SRCDIR=/usr/src/
22
23 # Build and install libyaml
24 WORKDIR ${SRCDIR}
25 RUN curl -L https://github.com/yaml/libyaml/archive/${LIBYAML_VERSION}.tar.gz | tar zx
26 WORKDIR ${SRCDIR}/libyaml-${LIBYAML_VERSION}
27 # Unfortunately we need to apply a patch to version 0.1.4 of libyaml. But regretfully we
28 # depend on 0.1.4 to have a statically linked version of libyaml. With newer versions of
29 # liblouis we haven't managed to produce a self-contained lou_checkyaml.exe so far.
30 ADD libyaml_mingw.patch .
31 RUN patch -p1 <libyaml_mingw.patch
32 RUN ./bootstrap && \
33 ./configure --host ${HOST} --prefix=${PREFIX}/libyaml && \
34 make && \
35 make install
36
37 # Build release artifact, i.e. liblouis zip
38 ADD . ${SRCDIR}/liblouis
39 WORKDIR ${SRCDIR}/liblouis
40 RUN ./autogen.sh && \
41 ./configure --host ${HOST} --enable-ucs4 \
42 --prefix=${PREFIX}/liblouis \
43 CPPFLAGS="-I${PREFIX}/libyaml/include/" LDFLAGS="-L${PREFIX}/libyaml/lib/" && \
44 make LDFLAGS="-L${PREFIX}/libyaml/lib/ -avoid-version -Xcompiler -static-libgcc" && \
45 make check WINE=wine64 || cat tests/test-suite.log && \
46 make install && \
47 cd ${PREFIX}/liblouis && \
48 zip -r ${SRCDIR}/liblouis/liblouis.zip *
49
50 # Now we have all we really need namely the cross-compiled liblouis
51 # packaged neatly in a zip. But just to be extra sure we test the
52 # cross-compiled liblouis in a separate docker image with wine
53 FROM debian:bookworm@sha256:b5fd0730c71f88a75e9d95dc6d812e8c34db679b3f009903d917be8f0300ba13
54
55 # install wine
56 RUN apt-get update && apt-get install -y \
57 mingw-w64 \
58 wine64 \
59 unzip \
60 && rm -rf /var/lib/apt/lists/*
61
62 ENV SRCDIR=/usr/src/liblouis
63 WORKDIR ${SRCDIR}
64 COPY --from=builder ${SRCDIR}/liblouis.zip .
65 RUN unzip liblouis.zip
66
67 # just run any old self-contained yaml test that doesn't need any env setup
68 ADD tests/yaml/letterDefTest_harness.yaml .
69 RUN wine bin/lou_checkyaml.exe letterDefTest_harness.yaml