1# Build environment for Floss
2#
3# This dockerfile generates the build environment required to build Floss, which
4# is the Linux build for the Fluoride Bluetooth stack.
5
6# Inherit from a recent Debian version. The slim version is a smaller variant
7# meant for containers.
8# This digest is taken from the tag debian:bookworm-slim (if you want to update)
9FROM debian@sha256:b66f66d473ef3128436ba2812198edcae86c268eb530dff44ff6ae26f9a2ee30
10
11# First install all required apt packages.
12RUN apt-get update && \
13    apt-get install -y \
14    bison \
15    build-essential \
16    clang \
17    cmake \
18    curl \
19    debmake \
20    flatbuffers-compiler \
21    flex \
22    g++-multilib \
23    gcc-multilib \
24    generate-ninja \
25    gnupg \
26    gperf \
27    libabsl-dev \
28    libc++abi-dev \
29    libc++-dev \
30    libdbus-1-dev \
31    libdouble-conversion-dev \
32    libevent-dev \
33    libflatbuffers-dev \
34    libfmt-dev \
35    libgl1-mesa-dev \
36    libglib2.0-dev \
37    libgtest-dev \
38    libgmock-dev \
39    liblc3-dev \
40    liblz4-tool \
41    libncurses5 \
42    libnss3-dev \
43    libprotobuf-dev \
44    libre2-9 \
45    libre2-dev \
46    libssl-dev \
47    libtinyxml2-dev \
48    libx11-dev \
49    libxml2-utils \
50    ninja-build \
51    openssl \
52    protobuf-compiler \
53    python3 \
54    unzip \
55    x11proto-core-dev \
56    xsltproc \
57    zip \
58    zlib1g-dev \
59    ;
60
61# Next install the Rust toolchain. Download the toolchain to the local folder
62# using curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs
63ADD rustup/rustup.sh /tmp
64RUN /tmp/rustup.sh -y --default-toolchain 1.77.1
65
66# Add .cargo/bin to $PATH
67ENV PATH="/root/.cargo/bin:${PATH}"
68
69# Install cargo packages required on build image.
70RUN cargo install --locked cxxbridge-cmd@1.0.94 pdl-compiler@0.1.1 grpcio-compiler@0.13.0
71RUN cargo install --git https://android.googlesource.com/platform/build#8f9ca807 aconfig
72
73# Rename llvm packages. By default, they are named 11vm-ar-13, etc. which won't
74# work properly with the build.
75ADD llvm-rename.sh /tmp
76RUN /tmp/llvm-rename.sh 14
77
78# At this point, the base container is ready. Now we need to build and install
79# both libchrome and modp-b64. If you ran this via `docker-build-image.py`, this
80# will be done after the image is created and tagged. Otherwise, you need to
81# manually mount the source and run the dpkg builders in `system/build/dpkg`.
82