1# THIS FILE WAS AUTO-GENERATED
2#
3#  $ lcitool dockerfile --layers all --cross 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
38ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
39ENV LANG "en_US.UTF-8"
40ENV MAKE "/usr/bin/make"
41ENV NINJA "/usr/bin/ninja"
42ENV PYTHON "/usr/bin/python3"
43
44RUN export DEBIAN_FRONTEND=noninteractive && \
45    dpkg --add-architecture riscv64 && \
46    eatmydata apt-get install debian-ports-archive-keyring && \
47    eatmydata echo 'deb http://ftp.ports.debian.org/debian-ports/ sid main' > /etc/apt/sources.list.d/ports.list && \
48    eatmydata echo 'deb http://ftp.ports.debian.org/debian-ports/ unreleased main' >> /etc/apt/sources.list.d/ports.list && \
49    eatmydata apt-get update && \
50    eatmydata apt-get dist-upgrade -y && \
51    eatmydata apt-get install --no-install-recommends -y dpkg-dev && \
52    eatmydata apt-get install --no-install-recommends -y \
53                      g++-riscv64-linux-gnu \
54                      gcc-riscv64-linux-gnu \
55                      libc6-dev:riscv64 \
56                      libfdt-dev:riscv64 \
57                      libffi-dev:riscv64 \
58                      libglib2.0-dev:riscv64 \
59                      libpixman-1-dev:riscv64 && \
60    eatmydata apt-get autoremove -y && \
61    eatmydata apt-get autoclean -y && \
62    mkdir -p /usr/local/share/meson/cross && \
63    printf "[binaries]\n\
64c = '/usr/bin/riscv64-linux-gnu-gcc'\n\
65ar = '/usr/bin/riscv64-linux-gnu-gcc-ar'\n\
66strip = '/usr/bin/riscv64-linux-gnu-strip'\n\
67pkgconfig = '/usr/bin/riscv64-linux-gnu-pkg-config'\n\
68\n\
69[host_machine]\n\
70system = 'linux'\n\
71cpu_family = 'riscv64'\n\
72cpu = 'riscv64'\n\
73endian = 'little'\n" > /usr/local/share/meson/cross/riscv64-linux-gnu && \
74    dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt && \
75    mkdir -p /usr/libexec/ccache-wrappers && \
76    ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/riscv64-linux-gnu-c++ && \
77    ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/riscv64-linux-gnu-cc && \
78    ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/riscv64-linux-gnu-g++ && \
79    ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/riscv64-linux-gnu-gcc
80
81ENV ABI "riscv64-linux-gnu"
82ENV MESON_OPTS "--cross-file=riscv64-linux-gnu"
83ENV QEMU_CONFIGURE_OPTS --cross-prefix=riscv64-linux-gnu-
84ENV DEF_TARGET_LIST riscv64-softmmu,riscv64-linux-user
85# As a final step configure the user (if env is defined)
86ARG USER
87ARG UID
88RUN if [ "${USER}" ]; then \
89  id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
90