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