ci/docker/fedora: update rustc and meson versions
[platform/upstream/gstreamer.git] / ci / docker / fedora / prepare.sh
1 set -eux
2
3 # Fedora base image disable installing documentation files. See https://pagure.io/atomic-wg/issue/308
4 # We need them to cleanly build our doc.
5 sed -i "s/tsflags=nodocs//g" /etc/dnf/dnf.conf
6
7 dnf install -y git-core ninja-build dnf-plugins-core python3-pip
8
9 # Configure git for various usage
10 git config --global user.email "gstreamer@gstreamer.net"
11 git config --global user.name "Gstbuild Runner"
12
13 # Add rpm fusion repositories in order to access all of the gst plugins
14 sudo dnf install -y \
15   "https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm" \
16   "https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm"
17
18 dnf upgrade -y
19
20 # install rest of the extra deps
21 dnf install -y \
22     aalib-devel \
23     aom \
24     bat \
25     intel-mediasdk-devel \
26     libaom \
27     libaom-devel \
28     libcaca-devel \
29     libdav1d \
30     libdav1d-devel \
31     ccache \
32     cmake \
33     clang-devel \
34     elfutils \
35     elfutils-libs \
36     elfutils-devel \
37     gcc \
38     gcc-c++ \
39     gdb \
40     git-lfs \
41     glslc \
42     gtk3 \
43     gtk3-devel \
44     gtest \
45     gtest-devel \
46     graphene \
47     graphene-devel \
48     gsl \
49     gsl-devel \
50     gupnp \
51     gupnp-devel \
52     gupnp-igd \
53     gupnp-igd-devel \
54     gssdp \
55     gssdp-devel \
56     faac-devel \
57     ffmpeg \
58     ffmpeg-libs \
59     ffmpeg-devel \
60     flex \
61     flite \
62     flite-devel \
63     mono-devel \
64     procps-ng \
65     patch \
66     qt5-devel \
67     redhat-rpm-config \
68     json-glib \
69     json-glib-devel \
70     libnice \
71     libnice-devel \
72     libsodium-devel \
73     libunwind \
74     libunwind-devel \
75     libyaml-devel \
76     libxml2-devel \
77     libxslt-devel \
78     llvm-devel \
79     log4c-devel \
80     make \
81     nasm \
82     neon \
83     neon-devel \
84     nunit \
85     npm \
86     opencv \
87     opencv-devel \
88     openjpeg2 \
89     openjpeg2-devel \
90     SDL2 \
91     SDL2-devel \
92     sbc \
93     sbc-devel \
94     x264 \
95     x264-libs \
96     x264-devel \
97     python3 \
98     python3-devel \
99     python3-libs \
100     python3-gobject \
101     python3-cairo \
102     python3-cairo-devel \
103     valgrind \
104     vulkan \
105     vulkan-devel \
106     mesa-omx-drivers \
107     mesa-libGL \
108     mesa-libGL-devel \
109     mesa-libGLU \
110     mesa-libGLU-devel \
111     mesa-libGLES \
112     mesa-libGLES-devel \
113     mesa-libOpenCL \
114     mesa-libOpenCL-devel \
115     mesa-libgbm \
116     mesa-libgbm-devel \
117     mesa-libd3d \
118     mesa-libd3d-devel \
119     mesa-libOSMesa \
120     mesa-libOSMesa-devel \
121     mesa-vulkan-drivers \
122     wpewebkit \
123     wpewebkit-devel \
124     xorg-x11-server-utils \
125     xorg-x11-server-Xvfb
126
127 # Install common debug symbols
128 dnf debuginfo-install -y gtk3 \
129     glib2 \
130     glibc \
131     gupnp \
132     gupnp-igd \
133     gssdp \
134     freetype \
135     openjpeg \
136     gobject-introspection \
137     python3 \
138     python3-libs \
139     python3-gobject \
140     libappstream-glib-devel \
141     libjpeg-turbo \
142     glib-networking \
143     libcurl \
144     libsoup \
145     nss \
146     nss-softokn \
147     nss-softokn-freebl \
148     nss-sysinit \
149     nss-util \
150     openssl \
151     openssl-libs \
152     openssl-pkcs11 \
153     brotli \
154     bzip2-libs \
155     gpm-libs \
156     harfbuzz \
157     harfbuzz-icu \
158     json-c \
159     json-glib \
160     libbabeltrace \
161     libffi \
162     libsrtp \
163     libunwind \
164     mpg123-libs \
165     neon \
166     orc-compiler \
167     orc \
168     pixman \
169     pulseaudio-libs \
170     pulseaudio-libs-glib2 \
171     wavpack \
172     webrtc-audio-processing \
173     ffmpeg \
174     ffmpeg-libs \
175     faad2-libs \
176     libavdevice \
177     libmpeg2 \
178     faac \
179     fdk-aac \
180     x264 \
181     x264-libs \
182     x265 \
183     x265-libs \
184     xz \
185     xz-libs \
186     zip \
187     zlib
188
189 # Install the dependencies of gstreamer
190 dnf builddep -y gstreamer1 \
191     gstreamer1-plugins-base \
192     gstreamer1-plugins-good \
193     gstreamer1-plugins-good-extras \
194     gstreamer1-plugins-ugly \
195     gstreamer1-plugins-ugly-free \
196     gstreamer1-plugins-bad-free \
197     gstreamer1-plugins-bad-free-extras \
198     gstreamer1-plugins-bad-freeworld \
199     gstreamer1-libav \
200     gstreamer1-rtsp-server  \
201     gstreamer1-vaapi \
202     python3-gstreamer1
203
204 dnf remove -y meson
205 pip3 install meson==0.59.1 hotdoc
206
207 # Remove gst-devel packages installed by builddep above
208 dnf remove -y "gstreamer1*devel"
209
210 # FIXME: Why does installing directly with dnf doesn't actually install
211 # the documentation files?
212 dnf download glib2-doc gdk-pixbuf2-devel*x86_64* gtk3-devel-docs
213 rpm -i --reinstall *.rpm
214 rm -f *.rpm
215
216 # Install Rust
217 RUSTUP_VERSION=1.24.3
218 RUST_VERSION=1.55.0
219 RUST_ARCH="x86_64-unknown-linux-gnu"
220
221 dnf install -y wget
222 RUSTUP_URL=https://static.rust-lang.org/rustup/archive/$RUSTUP_VERSION/$RUST_ARCH/rustup-init
223 wget $RUSTUP_URL
224 dnf remove -y wget
225
226 export RUSTUP_HOME="/usr/local/rustup"
227 export CARGO_HOME="/usr/local/cargo"
228 export PATH="/usr/local/cargo/bin:$PATH"
229
230 chmod +x rustup-init;
231 ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION;
232 rm rustup-init;
233 chmod -R a+w $RUSTUP_HOME $CARGO_HOME
234
235 rustup --version
236 cargo --version
237 rustc --version
238
239 # get gstreamer and make all subprojects available
240 # FIXME: we don't really need to clone it now as we have the repo checkout out already
241 git clone -b  ${DEFAULT_BRANCH} https://gitlab.freedesktop.org/gstreamer/gstreamer.git /gstreamer
242 meson subprojects download --sourcedir /gstreamer
243 /gstreamer/ci/scripts/handle-subprojects-cache.py --build /gstreamer/subprojects/
244
245 # Run git gc to prune unwanted refs and reduce the size of the image
246 for i in $(find subprojects/ -mindepth 1 -maxdepth 1 -type d);
247 do
248     git -C $i gc --aggressive || true;
249 done
250
251 echo "Removing DNF cache"
252 dnf clean all
253
254 rm -R /root/*
255 rm -rf /var/cache/dnf /var/log/dnf*