1# THIS FILE WAS AUTO-GENERATED
2#
3#  $ lcitool dockerfile --layers all --cross-arch riscv64 debian-sid qemu-minimal
4#
5# https://gitlab.com/libvirt/libvirt-ci
6
7FROM docker.io/library/debian:sid-slim
8
9RUN export DEBIAN_FRONTEND=noninteractive && \
10    apt-get update && \
11    apt-get install -y eatmydata && \
12    eatmydata apt-get dist-upgrade -y && \
13    eatmydata apt-get install --no-install-recommends -y \
14                      bash \
15                      bc \
16                      bison \
17                      ca-certificates \
18                      ccache \
19                      findutils \
20                      flex \
21                      gcc \
22                      git \
23                      libglib2.0-dev \
24                      locales \
25                      make \
26                      meson \
27                      ninja-build \
28                      pkgconf \
29                      python3 \
30                      python3-venv \
31                      sed \
32                      tar && \
33    eatmydata apt-get autoremove -y && \
34    eatmydata apt-get autoclean -y && \
35    sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \
36    dpkg-reconfigure locales && \
37    rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED
38
39ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
40ENV LANG "en_US.UTF-8"
41ENV MAKE "/usr/bin/make"
42ENV NINJA "/usr/bin/ninja"
43ENV PYTHON "/usr/bin/python3"
44
45RUN export DEBIAN_FRONTEND=noninteractive && \
46    dpkg --add-architecture riscv64 && \
47    eatmydata apt-get install debian-ports-archive-keyring && \
48    eatmydata echo 'deb http://ftp.ports.debian.org/debian-ports/ sid main' > /etc/apt/sources.list.d/ports.list && \
49    eatmydata echo 'deb http://ftp.ports.debian.org/debian-ports/ unreleased main' >> /etc/apt/sources.list.d/ports.list && \
50    eatmydata apt-get update && \
51    eatmydata apt-get dist-upgrade -y && \
52    eatmydata apt-get install --no-install-recommends -y dpkg-dev && \
53    eatmydata apt-get install --no-install-recommends -y \
54                      g++-riscv64-linux-gnu \
55                      gcc-riscv64-linux-gnu \
56                      libc6-dev:riscv64 \
57                      libfdt-dev:riscv64 \
58                      libffi-dev:riscv64 \
59                      libglib2.0-dev:riscv64 \
60                      libpixman-1-dev:riscv64 && \
61    eatmydata apt-get autoremove -y && \
62    eatmydata apt-get autoclean -y && \
63    mkdir -p /usr/local/share/meson/cross && \
64    printf "[binaries]\n\
65c = '/usr/bin/riscv64-linux-gnu-gcc'\n\
66ar = '/usr/bin/riscv64-linux-gnu-gcc-ar'\n\
67strip = '/usr/bin/riscv64-linux-gnu-strip'\n\
68pkgconfig = '/usr/bin/riscv64-linux-gnu-pkg-config'\n\
69\n\
70[host_machine]\n\
71system = 'linux'\n\
72cpu_family = 'riscv64'\n\
73cpu = 'riscv64'\n\
74endian = 'little'\n" > /usr/local/share/meson/cross/riscv64-linux-gnu && \
75    dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt && \
76    mkdir -p /usr/libexec/ccache-wrappers && \
77    ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/riscv64-linux-gnu-c++ && \
78    ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/riscv64-linux-gnu-cc && \
79    ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/riscv64-linux-gnu-g++ && \
80    ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/riscv64-linux-gnu-gcc
81
82ENV ABI "riscv64-linux-gnu"
83ENV MESON_OPTS "--cross-file=riscv64-linux-gnu"
84ENV QEMU_CONFIGURE_OPTS --cross-prefix=riscv64-linux-gnu-
85ENV DEF_TARGET_LIST riscv64-softmmu,riscv64-linux-user
86# As a final step configure the user (if env is defined)
87ARG USER
88ARG UID
89RUN if [ "${USER}" ]; then \
90  id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
91