Skip to content

Commit 6769ecd

Browse files
committed
Dockerfile.cross: Add an option for building python
1 parent 52f07a1 commit 6769ecd

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

Dockerfile.cross

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,38 @@
1111
ARG BASE=mstorsjo/llvm-mingw:dev
1212
FROM $BASE
1313

14+
RUN apt-get update -qq && \
15+
apt-get install -qqy libltdl-dev swig autoconf-archive && \
16+
apt-get clean -y && \
17+
rm -rf /var/lib/apt/lists/*
18+
19+
COPY build-python.sh .
20+
COPY patches/python/ ./patches/python/
21+
22+
ARG WITH_PYTHON
23+
24+
RUN if [ -n "$WITH_PYTHON" ]; then \
25+
./build-python.sh /opt/python; \
26+
fi
27+
28+
ENV PATH=/opt/python/bin:$PATH
29+
1430
ARG CROSS_ARCH=x86_64
1531
ENV CROSS_TOOLCHAIN_PREFIX=/opt/llvm-mingw-$CROSS_ARCH
1632

1733
ENV HOST=$CROSS_ARCH-w64-mingw32
1834

35+
RUN if [ -n "$WITH_PYTHON" ]; then \
36+
./build-python.sh $CROSS_TOOLCHAIN_PREFIX/python --host=$HOST && \
37+
mkdir -p $CROSS_TOOLCHAIN_PREFIX/bin && \
38+
cp $CROSS_TOOLCHAIN_PREFIX/python/bin/*.dll $CROSS_TOOLCHAIN_PREFIX/bin; \
39+
fi
40+
1941
ARG FULL_LLVM
2042

2143
COPY build-llvm.sh .
22-
RUN ./build-llvm.sh $CROSS_TOOLCHAIN_PREFIX --host=$HOST
44+
RUN if [ -n "$WITH_PYTHON" ]; then ARG="--with-python"; fi && \
45+
./build-llvm.sh $CROSS_TOOLCHAIN_PREFIX --host=$HOST $ARG
2346

2447
COPY build-lldb-mi.sh .
2548
RUN ./build-lldb-mi.sh $CROSS_TOOLCHAIN_PREFIX --host=$HOST

0 commit comments

Comments
 (0)