Merge tag 'pull-loongarch-20241016' of https://gitlab.com/gaosong/qemu into staging
[qemu/armbru.git] / tests / docker / dockerfiles / debian-riscv64-cross.docker
blob4d8ca83cb37e470d446d00dd616d053acff735a0
1 # THIS FILE WAS AUTO-GENERATED
3 #  $ lcitool dockerfile --layers all --cross-arch riscv64 debian-sid qemu-minimal
5 # https://gitlab.com/libvirt/libvirt-ci
7 FROM docker.io/library/debian:sid-slim
9 RUN 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
39 ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
40 ENV LANG "en_US.UTF-8"
41 ENV MAKE "/usr/bin/make"
42 ENV NINJA "/usr/bin/ninja"
43 ENV PYTHON "/usr/bin/python3"
45 RUN 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                       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\
64 c = '/usr/bin/riscv64-linux-gnu-gcc'\n\
65 ar = '/usr/bin/riscv64-linux-gnu-gcc-ar'\n\
66 strip = '/usr/bin/riscv64-linux-gnu-strip'\n\
67 pkgconfig = '/usr/bin/riscv64-linux-gnu-pkg-config'\n\
68 \n\
69 [host_machine]\n\
70 system = 'linux'\n\
71 cpu_family = 'riscv64'\n\
72 cpu = 'riscv64'\n\
73 endian = '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-cc && \
77     ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/riscv64-linux-gnu-gcc
79 ENV ABI "riscv64-linux-gnu"
80 ENV MESON_OPTS "--cross-file=riscv64-linux-gnu"
81 ENV QEMU_CONFIGURE_OPTS --cross-prefix=riscv64-linux-gnu-
82 ENV DEF_TARGET_LIST riscv64-softmmu,riscv64-linux-user
83 # As a final step configure the user (if env is defined)
84 ARG USER
85 ARG UID
86 RUN if [ "${USER}" ]; then \
87   id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi