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:trixie-slim (if you want to update)
9FROM debian@sha256:711e115ddeee4722199c82fb5aa189693f473a14999180ae6112ab2da5664ce5
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    libncurses6 \
41    libnss3-dev \
42    libprotobuf-dev \
43    libre2-11 \
44    libre2-dev \
45    libssl-dev \
46    libtinyxml2-dev \
47    libx11-dev \
48    libxml2-utils \
49    lz4 \
50    ninja-build \
51    openssl \
52    protobuf-compiler \
53    python3 \
54    python3-six \
55    unzip \
56    x11proto-core-dev \
57    xsltproc \
58    zip \
59    zlib1g-dev \
60    ;
61
62# Next install the Rust toolchain. Download the toolchain to the local folder
63# using curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs
64ADD rustup/rustup.sh /tmp
65RUN /tmp/rustup.sh -y --default-toolchain 1.80.1
66
67# Add .cargo/bin to $PATH
68ENV PATH="/root/.cargo/bin:${PATH}"
69
70# Install cargo packages required on build image.
71RUN cargo install --locked \
72    [email protected] \
73    [email protected] \
74    [email protected] \
75    [email protected]
76RUN cargo install --git https://android.googlesource.com/platform/build --rev 8f9ca807 aconfig
77
78# Rename llvm packages. By default, they are named 11vm-ar-13, etc. which won't
79# work properly with the build.
80ADD llvm-rename.sh /tmp
81RUN /tmp/llvm-rename.sh 16
82
83# At this point, the base container is ready. Now we need to build and install
84# both libchrome and modp-b64. If you ran this via `docker-build-image.py`, this
85# will be done after the image is created and tagged. Otherwise, you need to
86# manually mount the source and run the dpkg builders in `system/build/dpkg`.
87