-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
85 lines (76 loc) · 2.78 KB
/
Dockerfile
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
FROM debian:buster-slim
# Toolchain dependencies for Unvanquished, Daemon, external_deps, or build-release
ENV TOOLCHAIN_DEPS=' \
autoconf \
cmake \
curl \
g++ \
g++-mingw-w64-i686 \
g++-mingw-w64-x86-64 \
git \
libtool \
make \
p7zip-full \
python2 \
python3-jinja2 \
python3-yaml \
rsync \
'
# Libraries statically linked into the Linux binaries of Daemon
ENV DAEMON_LINUX_STATIC_DEPS=' \
libfreetype6-dev \
libgmp-dev \
libjpeg-dev \
libogg-dev \
libopus-dev \
libopusfile-dev \
libpng-dev \
libvorbis-dev \
libwebp-dev \
nettle-dev \
zlib1g-dev \
'
# These are needed for building Daemon or its dependencies but not statically linked into the binary.
# The display-related ones are relevant for SDL configuration and are taken from
# https://wiki.libsdl.org/FAQLinux#How_do_I_get_all_the_dependencies_for_building_SDL_on_Ubuntu.3F
# The audio ones are relevant for OpenAL configuration.
ENV DAEMON_LINUX_AV_DEPS=' \
libasound2-dev \
libaudio-dev \
libgl1-mesa-dev \
libjack-jackd2-dev \
libpulse-dev \
libx11-dev \
libxcursor-dev \
libxext-dev \
libxi-dev \
libxinerama-dev \
libxrandr-dev \
libxss-dev \
libxxf86vm-dev \
'
RUN apt-get update && apt-get install -y $TOOLCHAIN_DEPS $DAEMON_LINUX_STATIC_DEPS $DAEMON_LINUX_AV_DEPS
RUN update-alternatives --set i686-w64-mingw32-gcc /usr/bin/i686-w64-mingw32-gcc-posix && \
update-alternatives --set i686-w64-mingw32-g++ /usr/bin/i686-w64-mingw32-g++-posix && \
update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix && \
update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
ARG rev
RUN test -n "$rev"
WORKDIR /Unvanquished
# Assume the desired revision of Unvanquished is near the tip of some branch (last 20 commits)
RUN git clone --depth 20 --no-single-branch https://github.com/Unvanquished/Unvanquished . && \
git checkout "$rev" && \
git submodule update --init --depth 1 --recursive
WORKDIR /Unvanquished/daemon/external_deps
# Build some static libraries in the cases where the package manager didn't provide a satisfactory one.
# openal, glew, ncurses: a static library is not provided
# sdl2: the static library is configured to have non-optional dependencies on some dynamic libs
# curl: static libraries are configured with unneeded protocols that have extra dynamic dependencies
RUN ./build.sh linux-amd64-default curl sdl2 glew openal ncurses naclsdk naclports
RUN ./build.sh linux-amd64-default install
COPY build-release /
WORKDIR /Unvanquished
ARG targets='linux-amd64 windows-i686 windows-amd64 vm'
RUN /build-release -j`nproc` ${targets}
COPY build-release make-unizip unizip-readme.txt /
RUN /make-unizip /Unvanquished/build/release