[GTK] basic OpenWebRTC build support
[WebKit-https.git] / Tools / gtk / install-dependencies
1 #!/bin/bash
2
3 # This script needs to be run with root rights.
4 if [ $UID -ne 0 ]; then
5     sudo $0
6     exit 0
7 fi
8
9 function printNotSupportedMessageAndExit() {
10     echo
11     echo "Currently this script only works for distributions supporting apt-get and yum."
12     echo "Please add support for your distribution: http://webkit.org/b/110693"
13     echo
14     exit 1
15 }
16
17 function checkInstaller {
18     # apt-get - Debian based distributions
19     apt-get --version &> /dev/null
20     if [ $? -eq 0 ]; then
21         installDependenciesWithApt
22         exit 0
23     fi
24
25     # yum - Fedora 21 and below
26     yum --version &> /dev/null
27     if [ $? -eq 0 ]; then
28         installFedoraDependencies yum
29         exit 0
30     fi
31
32     # dnf - Fedora 22 and above
33     dnf --version &> /dev/null
34     if [ $? -eq 0 ]; then
35         installFedoraDependencies dnf
36         exit 0
37     fi
38
39     # pacman - Arch Linux
40     # pacman --version and pacman --help both return non-0
41     pacman -Ss &> /dev/null
42     if [ $? -eq 0 ]; then
43         installDependenciesWithPacman
44         exit 0
45     fi
46
47     printNotSupportedMessageAndExit
48 }
49
50 function installDependenciesWithApt {
51     # These are dependencies necessary for building WebKitGTK+.
52     apt-get install \
53         autoconf \
54         automake \
55         autopoint \
56         autotools-dev \
57         bison \
58         cmake \
59         flex \
60         gawk \
61         gnome-common \
62         gperf \
63         gtk-doc-tools \
64         intltool \
65         itstool \
66         libatk1.0-dev \
67         libenchant-dev \
68         libfaad-dev \
69         libgeoclue-dev \
70         libgirepository1.0-dev \
71         libgl1-mesa-dev \
72         libgl1-mesa-glx \
73         libgnutls28-dev \
74         libgtk2.0-dev \
75         libgtk-3-dev \
76         libgudev-1.0-dev \
77         libharfbuzz-dev \
78         libicu-dev \
79         libjpeg-dev \
80         libmpg123-dev \
81         libopus-dev \
82         libpango1.0-dev \
83         libpng12-dev \
84         libpulse-dev \
85         librsvg2-dev \
86         libsecret-1-dev \
87         libsoup2.4-dev \
88         libsqlite3-dev \
89         libtheora-dev \
90         libtool \
91         libvorbis-dev \
92         libwebp-dev \
93         libxcomposite-dev \
94         libxslt1-dev \
95         libxt-dev \
96         libxtst-dev \
97         ruby \
98         xfonts-utils
99
100     # These are dependencies necessary for running tests.
101     apt-get install \
102         apache2 \
103         curl \
104         dbus-x11 \
105         libapache2-mod-bw \
106         libapache2-mod-php5 \
107         libgpg-error-dev \
108         pulseaudio-utils \
109         python-gi \
110         ruby \
111         ruby-json \
112         ruby-highline \
113         xvfb
114
115     # These are dependencies necessary for building the jhbuild.
116     apt-get install \
117         git \
118         gobject-introspection \
119         icon-naming-utils \
120         libcroco3-dev \
121         libegl1-mesa-dev \
122         libgcrypt11-dev \
123         libgpg-error-dev \
124         libjson-glib-dev \
125         liborc-0.4-dev \
126         libp11-kit-dev \
127         libpciaccess-dev \
128         libssl-dev \
129         libtiff5-dev \
130         libv4l-dev \
131         libxcb-xfixes0-dev \
132         libxfont-dev \
133         libxkbfile-dev \
134         llvm \
135         llvm-dev \
136         python-dev \
137         ragel \
138         x11proto-bigreqs-dev \
139         x11proto-composite-dev \
140         x11proto-gl-dev \
141         x11proto-input-dev \
142         x11proto-randr-dev \
143         x11proto-resource-dev \
144         x11proto-scrnsaver-dev \
145         x11proto-video-dev \
146         x11proto-xcmisc-dev \
147         x11proto-xf86dri-dev \
148         xfonts-utils \
149         xtrans-dev \
150         xutils-dev
151
152     # These are dependencies necessary for using webkit-patch
153     apt-get install \
154         git-svn \
155         subversion
156
157     # ninja is a faster build system than GNU make, but it doesn't
158     # exist on Ubuntu 12.04
159     apt-get install ninja-build || true
160 }
161
162 function installDependenciesWithPacman {
163     # These are dependencies necessary for building WebKitGTK+.
164     packages=" \
165         autoconf \
166         automake \
167         bison \
168         cmake \
169         file \
170         findutils \
171         flex \
172         gawk \
173         gcc \
174         gettext \
175         gnome-common \
176         gperf \
177         grep \
178         groff \
179         gzip \
180         libtool \
181         m4 \
182         make \
183         patch \
184         pkg-config \
185         sed \
186         texinfo \
187         util-linux \
188         which \
189         gtk-doc \
190         intltool \
191         itstool \
192         atk \
193         enchant \
194         faad2 \
195         geoclue \
196         gobject-introspection \
197         mesa \
198         mesa-libgl \
199         gnutls \
200         gtk2 \
201         gtk3 \
202         libsystemd \
203         harfbuzz \
204         harfbuzz-icu \
205         icu \
206         libjpeg-turbo \
207         mpg123 \
208         opus \
209         pango \
210         libpng \
211         libpulse \
212         librsvg \
213         libsecret \
214         libsoup \
215         sqlite \
216         libtheora \
217         libtool \
218         libvorbis \
219         libwebp \
220         libxcomposite \
221         libxslt \
222         libxt \
223         libxtst \
224         ninja \
225         ruby \
226         xorg-font-utils"
227
228     # These are dependencies necessary for running tests.
229     # Note: apache-mod_bw is available in the AUR, but the main repos
230     #       could not find ruby-json
231     packages="$packages \
232         apache \
233         curl \
234         hunspell \
235         hunspell-en \
236         php-apache \
237         libgpg-error \
238         pulseaudio \
239         python-gobject \
240         ruby \
241         ruby-highline \
242         xorg-server-xvfb"
243
244     # These are dependencies necessary for building the jhbuild.
245     # Note: Could not find libegl-mesa
246     packages="$packages \
247         git \
248         gobject-introspection \
249         icon-naming-utils \
250         libcroco \
251         libgcrypt \
252         libgpg-error \
253         p11-kit \
254         libpciaccess \
255         libtiff \
256         libxfixes \
257         libxfont \
258         libxkbfile \
259         llvm \
260         python2 \
261         python2-lxml \
262         ragel \
263         bigreqsproto \
264         compositeproto \
265         glproto \
266         inputproto \
267         randrproto \
268         resourceproto \
269         scrnsaverproto \
270         videoproto \
271         xcmiscproto \
272         xf86driproto \
273         xorg-font-utils \
274         xorg-util-macros \
275         xtrans \
276         xorg-utils"
277
278     # These are dependencies necessary for using webkit-patch
279     packages="$packages \
280         svn"
281     pacman -S --needed $packages
282
283     echo "You will also need to follow the instructions on the Arch Wiki to make"
284     echo "'python' call python2 in the webkit folder"
285     echo "https://wiki.archlinux.org/index.php/Python#Dealing_with_version_problem_in_build_scripts"
286 }
287
288 function installFedoraDependencies {
289     # These are dependencies necessary for building WebKitGTK+.
290     $1 install \
291         atk-devel \
292         autoconf \
293         automake \
294         bison \
295         cairo-devel \
296         cmake \
297         enchant-devel \
298         flex \
299         fontconfig-devel \
300         freetype-devel \
301         gcc-c++ \
302         geoclue-devel \
303         gettext-devel \
304         gobject-introspection-devel \
305         gperf \
306         gstreamer1-devel \
307         gstreamer1-plugins-base-devel \
308         gtk-doc \
309         gtk2-devel \
310         gtk3-devel \
311         harfbuzz-devel \
312         libXt-devel \
313         libXtst-devel \
314         libgudev1-devel \
315         libicu-devel \
316         libjpeg-turbo-devel \
317         libpng-devel \
318         libsecret-devel \
319         libsoup-devel \
320         libwebp-devel \
321         libxslt-devel \
322         mesa-libGL-devel \
323         ninja-build \
324         pcre-devel \
325         perl-Switch \
326         perl-version \
327         python-devel \
328         ruby \
329         sqlite-devel
330
331     # These are dependencies necessary for running tests.
332     $1 install \
333         curl \
334         dbus-x11 \
335         hunspell-en \
336         httpd \
337         libgpg-error-devel \
338         mod_bw \
339         mod_ssl \
340         perl-CGI \
341         php \
342         pulseaudio-utils \
343         pygobject3-base \
344         ruby \
345         rubygem-json \
346         rubygem-highline \
347         xorg-x11-server-Xvfb
348
349     # These are dependencies necessary for building the jhbuild.
350     $1 install \
351         docbook-utils \
352         docbook-utils-pdf \
353         git \
354         gobject-introspection \
355         icon-naming-utils \
356         itstool \
357         libXfont-devel \
358         libcroco-devel \
359         libgcrypt-devel \
360         libgpg-error-devel \
361         libp11-devel \
362         libpciaccess-devel \
363         libtiff-devel \
364         libxkbfile-devel \
365         llvm \
366         llvm-devel \
367         mesa-libEGL-devel \
368         ragel \
369         xorg-x11-font-utils \
370         xorg-x11-proto-devel \
371         xorg-x11-util-macros \
372         xorg-x11-xtrans-devel
373
374     # These are dependencies necessary for using webkit-patch
375     $1 install \
376         git-svn \
377         subversion
378 }
379
380 checkInstaller
381