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