docker/fedora: Fix rpmfusion urls
[platform/upstream/gstreamer.git] / 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 "gst-build@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     libaom \
26     libaom-devel \
27     libcaca-devel \
28     libdav1d \
29     libdav1d-devel \
30     ccache \
31     cmake \
32     clang-devel \
33     elfutils \
34     elfutils-libs \
35     elfutils-devel \
36     gcc \
37     gcc-c++ \
38     gdb \
39     git-lfs \
40     glslc \
41     gtk3 \
42     gtk3-devel \
43     gtest \
44     gtest-devel \
45     graphene \
46     graphene-devel \
47     gsl \
48     gsl-devel \
49     gupnp \
50     gupnp-devel \
51     gupnp-igd \
52     gupnp-igd-devel \
53     gssdp \
54     gssdp-devel \
55     faac-devel \
56     ffmpeg \
57     ffmpeg-libs \
58     ffmpeg-devel \
59     flex \
60     flite \
61     flite-devel \
62     mono-devel \
63     procps-ng \
64     patch \
65     qt5-devel \
66     redhat-rpm-config \
67     json-glib \
68     json-glib-devel \
69     libnice \
70     libnice-devel \
71     libsodium-devel \
72     libunwind \
73     libunwind-devel \
74     libyaml-devel \
75     libxml2-devel \
76     libxslt-devel \
77     llvm-devel \
78     log4c-devel \
79     make \
80     nasm \
81     neon \
82     neon-devel \
83     nunit \
84     npm \
85     opencv \
86     opencv-devel \
87     openjpeg2 \
88     openjpeg2-devel \
89     SDL2 \
90     SDL2-devel \
91     sbc \
92     sbc-devel \
93     x264 \
94     x264-libs \
95     x264-devel \
96     python3 \
97     python3-devel \
98     python3-libs \
99     python3-gobject \
100     python3-cairo \
101     python3-cairo-devel \
102     valgrind \
103     vulkan \
104     vulkan-devel \
105     mesa-omx-drivers \
106     mesa-libGL \
107     mesa-libGL-devel \
108     mesa-libGLU \
109     mesa-libGLU-devel \
110     mesa-libGLES \
111     mesa-libGLES-devel \
112     mesa-libOpenCL \
113     mesa-libOpenCL-devel \
114     mesa-libgbm \
115     mesa-libgbm-devel \
116     mesa-libd3d \
117     mesa-libd3d-devel \
118     mesa-libOSMesa \
119     mesa-libOSMesa-devel \
120     mesa-vulkan-drivers \
121     wpewebkit \
122     wpewebkit-devel \
123     xorg-x11-server-utils \
124     xorg-x11-server-Xvfb
125
126 # Install common debug symbols
127 dnf debuginfo-install -y gtk3 \
128     glib2 \
129     glibc \
130     gupnp \
131     gupnp-igd \
132     gssdp \
133     freetype \
134     openjpeg \
135     gobject-introspection \
136     python3 \
137     python3-libs \
138     python3-gobject \
139     libappstream-glib-devel \
140     libjpeg-turbo \
141     glib-networking \
142     libcurl \
143     libsoup \
144     nss \
145     nss-softokn \
146     nss-softokn-freebl \
147     nss-sysinit \
148     nss-util \
149     openssl \
150     openssl-libs \
151     openssl-pkcs11 \
152     brotli \
153     bzip2-libs \
154     gpm-libs \
155     harfbuzz \
156     harfbuzz-icu \
157     json-c \
158     json-glib \
159     libbabeltrace \
160     libffi \
161     libsrtp \
162     libunwind \
163     mpg123-libs \
164     neon \
165     orc-compiler \
166     orc \
167     pixman \
168     pulseaudio-libs \
169     pulseaudio-libs-glib2 \
170     wavpack \
171     webrtc-audio-processing \
172     ffmpeg \
173     ffmpeg-libs \
174     faad2-libs \
175     libavdevice \
176     libmpeg2 \
177     faac \
178     fdk-aac \
179     x264 \
180     x264-libs \
181     x265 \
182     x265-libs \
183     xz \
184     xz-libs \
185     zip \
186     zlib
187
188 pip3 install meson==0.56.2 hotdoc
189
190 # Install the dependencies of gstreamer
191 dnf builddep -y gstreamer1 \
192     gstreamer1-plugins-base \
193     gstreamer1-plugins-good \
194     gstreamer1-plugins-good-extras \
195     gstreamer1-plugins-ugly \
196     gstreamer1-plugins-ugly-free \
197     gstreamer1-plugins-bad-free \
198     gstreamer1-plugins-bad-free-extras \
199     gstreamer1-plugins-bad-freeworld \
200     gstreamer1-libav \
201     gstreamer1-rtsp-server  \
202     gstreamer1-vaapi \
203     python3-gstreamer1 \
204     -x meson
205
206 # Remove gst-devel packages installed by builddep above
207 dnf remove -y "gstreamer1*devel"
208
209 # FIXME: Why does installing directly with dnf doesn't actually install
210 # the documentation files?
211 dnf download glib2-doc gdk-pixbuf2-devel*x86_64* gtk3-devel-docs
212 rpm -i --reinstall *.rpm
213 rm -f *.rpm
214
215 # Install Rust
216 RUSTUP_VERSION=1.21.1
217 RUST_VERSION=1.44.1
218 RUST_ARCH="x86_64-unknown-linux-gnu"
219
220 dnf install -y wget
221 RUSTUP_URL=https://static.rust-lang.org/rustup/archive/$RUSTUP_VERSION/$RUST_ARCH/rustup-init
222 wget $RUSTUP_URL
223 dnf remove -y wget
224
225 chmod +x rustup-init;
226 ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION;
227 rm rustup-init;
228 chmod -R a+w $RUSTUP_HOME $CARGO_HOME
229
230 rustup --version
231 cargo --version
232 rustc --version
233
234 # get gst-build and make all subprojects available
235 git clone -b ${DEFAULT_BRANCH} https://gitlab.freedesktop.org/gstreamer/gst-build.git /gst-build/
236 cd /gst-build
237 meson subprojects download
238
239 # Run git gc to prune unwanted refs and reduce the size of the image
240 for i in $(find subprojects/ -mindepth 1- maxdepth 1 -type d);
241 do
242     git -C $i gc --aggressive || true;
243 done