1# THIS FILE WAS AUTO-GENERATED
2#
3#  $ lcitool dockerfile --layers all --cross-arch s390x debian-11 qemu
4#
5# https://gitlab.com/libvirt/libvirt-ci
6
7FROM docker.io/library/debian:11-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                      bsdextrautils \
18                      bzip2 \
19                      ca-certificates \
20                      ccache \
21                      dbus \
22                      debianutils \
23                      diffutils \
24                      exuberant-ctags \
25                      findutils \
26                      flex \
27                      gcc \
28                      gcovr \
29                      gettext \
30                      git \
31                      hostname \
32                      libglib2.0-dev \
33                      libpcre2-dev \
34                      libsndio-dev \
35                      libspice-protocol-dev \
36                      llvm \
37                      locales \
38                      make \
39                      meson \
40                      mtools \
41                      ncat \
42                      ninja-build \
43                      openssh-client \
44                      pkgconf \
45                      python3 \
46                      python3-numpy \
47                      python3-opencv \
48                      python3-pillow \
49                      python3-pip \
50                      python3-setuptools \
51                      python3-sphinx \
52                      python3-sphinx-rtd-theme \
53                      python3-venv \
54                      python3-wheel \
55                      python3-yaml \
56                      rpm2cpio \
57                      sed \
58                      socat \
59                      sparse \
60                      tar \
61                      tesseract-ocr \
62                      tesseract-ocr-eng \
63                      xorriso \
64                      zstd && \
65    eatmydata apt-get autoremove -y && \
66    eatmydata apt-get autoclean -y && \
67    sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \
68    dpkg-reconfigure locales
69
70RUN /usr/bin/pip3 install tomli
71
72ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
73ENV LANG "en_US.UTF-8"
74ENV MAKE "/usr/bin/make"
75ENV NINJA "/usr/bin/ninja"
76ENV PYTHON "/usr/bin/python3"
77
78RUN export DEBIAN_FRONTEND=noninteractive && \
79    dpkg --add-architecture s390x && \
80    eatmydata apt-get update && \
81    eatmydata apt-get dist-upgrade -y && \
82    eatmydata apt-get install --no-install-recommends -y dpkg-dev && \
83    eatmydata apt-get install --no-install-recommends -y \
84                      g++-s390x-linux-gnu \
85                      gcc-s390x-linux-gnu \
86                      libaio-dev:s390x \
87                      libasan5:s390x \
88                      libasound2-dev:s390x \
89                      libattr1-dev:s390x \
90                      libbpf-dev:s390x \
91                      libbrlapi-dev:s390x \
92                      libbz2-dev:s390x \
93                      libc6-dev:s390x \
94                      libcacard-dev:s390x \
95                      libcap-ng-dev:s390x \
96                      libcapstone-dev:s390x \
97                      libcmocka-dev:s390x \
98                      libcurl4-gnutls-dev:s390x \
99                      libdaxctl-dev:s390x \
100                      libdrm-dev:s390x \
101                      libepoxy-dev:s390x \
102                      libfdt-dev:s390x \
103                      libffi-dev:s390x \
104                      libfuse3-dev:s390x \
105                      libgbm-dev:s390x \
106                      libgcrypt20-dev:s390x \
107                      libglib2.0-dev:s390x \
108                      libglusterfs-dev:s390x \
109                      libgnutls28-dev:s390x \
110                      libgtk-3-dev:s390x \
111                      libibumad-dev:s390x \
112                      libibverbs-dev:s390x \
113                      libiscsi-dev:s390x \
114                      libjemalloc-dev:s390x \
115                      libjpeg62-turbo-dev:s390x \
116                      libjson-c-dev:s390x \
117                      liblttng-ust-dev:s390x \
118                      liblzo2-dev:s390x \
119                      libncursesw5-dev:s390x \
120                      libnfs-dev:s390x \
121                      libnuma-dev:s390x \
122                      libpam0g-dev:s390x \
123                      libpipewire-0.3-dev:s390x \
124                      libpixman-1-dev:s390x \
125                      libpng-dev:s390x \
126                      libpulse-dev:s390x \
127                      librbd-dev:s390x \
128                      librdmacm-dev:s390x \
129                      libsasl2-dev:s390x \
130                      libsdl2-dev:s390x \
131                      libsdl2-image-dev:s390x \
132                      libseccomp-dev:s390x \
133                      libselinux1-dev:s390x \
134                      libslirp-dev:s390x \
135                      libsnappy-dev:s390x \
136                      libssh-gcrypt-dev:s390x \
137                      libsystemd-dev:s390x \
138                      libtasn1-6-dev:s390x \
139                      libubsan1:s390x \
140                      libudev-dev:s390x \
141                      liburing-dev:s390x \
142                      libusb-1.0-0-dev:s390x \
143                      libusbredirhost-dev:s390x \
144                      libvdeplug-dev:s390x \
145                      libvirglrenderer-dev:s390x \
146                      libvte-2.91-dev:s390x \
147                      libzstd-dev:s390x \
148                      nettle-dev:s390x \
149                      systemtap-sdt-dev:s390x \
150                      xfslibs-dev:s390x \
151                      zlib1g-dev:s390x && \
152    eatmydata apt-get autoremove -y && \
153    eatmydata apt-get autoclean -y && \
154    mkdir -p /usr/local/share/meson/cross && \
155    printf "[binaries]\n\
156c = '/usr/bin/s390x-linux-gnu-gcc'\n\
157ar = '/usr/bin/s390x-linux-gnu-gcc-ar'\n\
158strip = '/usr/bin/s390x-linux-gnu-strip'\n\
159pkgconfig = '/usr/bin/s390x-linux-gnu-pkg-config'\n\
160\n\
161[host_machine]\n\
162system = 'linux'\n\
163cpu_family = 's390x'\n\
164cpu = 's390x'\n\
165endian = 'big'\n" > /usr/local/share/meson/cross/s390x-linux-gnu && \
166    dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt && \
167    mkdir -p /usr/libexec/ccache-wrappers && \
168    ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/s390x-linux-gnu-c++ && \
169    ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/s390x-linux-gnu-cc && \
170    ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/s390x-linux-gnu-g++ && \
171    ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/s390x-linux-gnu-gcc
172
173ENV ABI "s390x-linux-gnu"
174ENV MESON_OPTS "--cross-file=s390x-linux-gnu"
175ENV QEMU_CONFIGURE_OPTS --cross-prefix=s390x-linux-gnu-
176ENV DEF_TARGET_LIST s390x-softmmu,s390x-linux-user
177# As a final step configure the user (if env is defined)
178ARG USER
179ARG UID
180RUN if [ "${USER}" ]; then \
181  id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
182