List libtasn1 packages in GTK+ and WPE install-dependencies scripts
[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
26     dnf --version &> /dev/null
27     if [ $? -eq 0 ]; then
28         installDependenciesWithDnf
29         exit 0
30     fi
31
32     # pacman - Arch Linux
33     # pacman --version and pacman --help both return non-0
34     pacman -Ss &> /dev/null
35     if [ $? -eq 0 ]; then
36         installDependenciesWithPacman
37         exit 0
38     fi
39
40     if [ `uname` = "Darwin" ]; then
41        installDependenciesWithBrew
42        exit 0
43     fi
44
45     printNotSupportedMessageAndExit
46 }
47
48 function installDependenciesWithBrew {
49     brew &> /dev/null
50     if [ $? -gt 1 ]; then
51         echo "Please install HomeBrew. Instructions on http://brew.sh"
52         exit 1
53     fi
54
55     brew install autoconf \
56          automake \
57          bison \
58          cmake \
59          enchant \
60          flex \
61          gettext \
62          gobject-introspection \
63          intltool \
64          itstool \
65          libcroco \
66          libgcrypt \
67          libgpg-error \
68          libtasn1 \
69          libtiff \
70          libtool \
71          ninja \
72          pango \
73          pkg-config \
74          sqlite \
75          webp \
76          xz
77 }
78
79 # If the package $1 is available, prints it. Otherwise prints $2.
80 # Useful for handling when a package is renamed on new versions of Debian/Ubuntu.
81 function aptIfElse {
82     if apt-cache show $1 &>/dev/null; then
83         echo $1
84     else
85         echo $2
86     fi
87 }
88
89 function installDependenciesWithApt {
90     # These are dependencies necessary for building WebKitGTK+.
91     packages=" \
92         autoconf \
93         automake \
94         autopoint \
95         autotools-dev \
96         bison \
97         cmake \
98         flex \
99         gawk \
100         geoclue-2.0 \
101         gnome-common \
102         gperf \
103         gtk-doc-tools \
104         intltool \
105         itstool \
106         libatk1.0-dev \
107         libedit-dev \
108         libenchant-dev \
109         libfaad-dev \
110         $(aptIfElse libgcrypt20-dev libgcrypt11-dev) \
111         $(aptIfElse libgeoclue-2-dev libgeoclue-dev) \
112         libgirepository1.0-dev \
113         libgl1-mesa-dev \
114         libgl1-mesa-glx \
115         libgtk2.0-dev \
116         libgtk-3-dev \
117         libgstreamer1.0-dev \
118         libgstreamer-plugins-base1.0-dev \
119         libgudev-1.0-dev \
120         libhyphen-dev \
121         libjpeg-dev \
122         libmount-dev \
123         libmpg123-dev \
124         libnotify-dev \
125         libopus-dev \
126         libpango1.0-dev \
127         $(aptIfElse libpng-dev libpng12-dev) \
128         libpulse-dev \
129         librsvg2-dev \
130         libsecret-1-dev \
131         libsoup2.4-dev \
132         libsqlite3-dev \
133         libsrtp0-dev \
134         libtasn1-6-dev \
135         libtheora-dev \
136         libtool \
137         libvorbis-dev \
138         libvpx-dev \
139         libwebp-dev \
140         libxcomposite-dev \
141         libxt-dev \
142         libxtst-dev \
143         libxslt1-dev \
144         libwayland-dev \
145         ninja-build \
146         patch \
147         ruby \
148         xfonts-utils"
149
150     # These are dependencies necessary for running tests.
151     packages="$packages \
152         apache2 \
153         curl \
154         dbus-x11 \
155         gdb \
156         libapache2-mod-bw \
157         $(aptIfElse libapache2-mod-php7.0 libapache2-mod-php5) \
158         libcgi-pm-perl \
159         libgpg-error-dev \
160         psmisc \
161         pulseaudio-utils \
162         python-gi \
163         python-psutil \
164         ruby \
165         ruby-json \
166         ruby-highline \
167         weston \
168         xvfb"
169
170     # These are dependencies necessary for building the jhbuild.
171     packages="$packages \
172         git \
173         gobject-introspection \
174         gsettings-desktop-schemas-dev \
175         icon-naming-utils \
176         libcroco3-dev \
177         libdrm-dev \
178         libegl1-mesa-dev \
179         libepoxy-dev \
180         libevdev-dev \
181         libexpat1-dev \
182         libgbm-dev \
183         libgles2-mesa-dev \
184         libgnutls28-dev \
185         libgpg-error-dev \
186         libjson-glib-dev \
187         libinput-dev \
188         libmtdev-dev \
189         liborc-0.4-dev \
190         libp11-kit-dev \
191         libpciaccess-dev \
192         libproxy-dev \
193         libssl-dev \
194         libtiff5-dev \
195         libv4l-dev \
196         libxcb-composite0-dev \
197         libxcb-xfixes0-dev \
198         $(aptIfElse libxfont1-dev libxfont-dev) \
199         libxkbfile-dev \
200         libtool-bin \
201         libudev-dev \
202         python-dev \
203         ragel \
204         x11proto-bigreqs-dev \
205         x11proto-composite-dev \
206         x11proto-gl-dev \
207         x11proto-input-dev \
208         x11proto-randr-dev \
209         x11proto-resource-dev \
210         x11proto-scrnsaver-dev \
211         x11proto-video-dev \
212         x11proto-xcmisc-dev \
213         x11proto-xf86dri-dev \
214         xfonts-utils \
215         xtrans-dev \
216         xutils-dev \
217         yasm"
218
219     # These are dependencies necessary for using webkit-patch
220     packages="$packages \
221         git-svn \
222         subversion"
223
224     apt-get install $packages
225 }
226
227 function installDependenciesWithPacman {
228     # These are dependencies necessary for building WebKitGTK+.
229     packages=" \
230         autoconf \
231         automake \
232         bison \
233         cmake \
234         libedit \
235         file \
236         findutils \
237         flex \
238         gawk \
239         gcc \
240         gettext \
241         gnome-common \
242         gperf \
243         grep \
244         groff \
245         gstreamer \
246         gst-plugins-base-libs \
247         gzip \
248         hyphen \
249         libtool \
250         m4 \
251         make \
252         patch \
253         pkg-config \
254         sed \
255         texinfo \
256         util-linux \
257         which \
258         gtk-doc \
259         intltool \
260         itstool \
261         atk \
262         enchant \
263         faad2 \
264         geoclue \
265         gobject-introspection \
266         mesa \
267         mesa-libgl \
268         gtk2 \
269         gtk3 \
270         libsystemd \
271         libjpeg-turbo \
272         mpg123 \
273         opus \
274         pango \
275         libgcrypt \
276         libnotify \
277         libpng \
278         libpulse \
279         librsvg \
280         libsecret \
281         libsoup \
282         libsrtp \
283         sqlite \
284         libtasn1 \
285         libtheora \
286         libtool \
287         libvorbis \
288         libvpx \
289         libwebp \
290         libxcomposite \
291         libxt \
292         libxslt \
293         libxtst \
294         ninja \
295         ruby \
296         util-linux \
297         xorg-font-utils \
298         wayland"
299
300     # These are dependencies necessary for running tests.
301     # Note: apache-mod_bw is available in the AUR, but the main repos
302     #       could not find ruby-json
303     packages="$packages \
304         apache \
305         curl \
306         gdb \
307         hunspell \
308         hunspell-en \
309         php-apache \
310         libgpg-error \
311         psmisc \
312         pulseaudio \
313         python-gobject \
314         python2-psutil \
315         ruby \
316         ruby-highline \
317         weston \
318         xorg-server-xvfb"
319
320     # These are dependencies necessary for building the jhbuild.
321     # Note: Could not find libegl-mesa
322     packages="$packages \
323         expat \
324         git \
325         gnutls \
326         gobject-introspection \
327         gsettings-desktop-schemas \
328         icon-naming-utils \
329         libcroco \
330         libdrm \
331         libepoxy \
332         libevdev \
333         libgpg-error \
334         libinput \
335         p11-kit \
336         libpciaccess \
337         libproxy \
338         libtiff \
339         libxfixes \
340         libxfont \
341         libxcb \
342         libxkbfile \
343         mtdev \
344         orc \
345         python2 \
346         python2-lxml \
347         ragel \
348         bigreqsproto \
349         compositeproto \
350         glproto \
351         inputproto \
352         randrproto \
353         resourceproto \
354         scrnsaverproto \
355         videoproto \
356         xcmiscproto \
357         xf86driproto \
358         xorg-font-utils \
359         xorg-util-macros \
360         xtrans \
361         xorg-utils \
362         yasm"
363
364     # These are dependencies necessary for using webkit-patch
365     packages="$packages \
366         svn"
367     pacman -S --needed $packages
368
369     echo "You will also need to follow the instructions on the Arch Wiki to make"
370     echo "'python' call python2 in the webkit folder"
371     echo "https://wiki.archlinux.org/index.php/Python#Dealing_with_version_problem_in_build_scripts"
372 }
373
374 function installDependenciesWithDnf {
375     # These are dependencies necessary for building WebKitGTK+.
376     packages=" \
377         atk-devel \
378         autoconf \
379         automake \
380         bison \
381         cairo-devel \
382         cmake \
383         enchant-devel \
384         flex \
385         gcc-c++ \
386         geoclue2-devel \
387         gettext-devel \
388         gobject-introspection-devel \
389         gperf \
390         gstreamer1-devel \
391         gstreamer1-plugins-base-devel \
392         gtk-doc \
393         gtk2-devel \
394         gtk3-devel \
395         hyphen-devel \
396         intltool \
397         json-glib-devel \
398         libXt-devel \
399         libXtst-devel \
400         libxslt-devel \
401         libedit-devel \
402         libgcrypt-devel \
403         libgudev1-devel \
404         libjpeg-turbo-devel \
405         libmount-devel \
406         libnotify-devel \
407         libpng-devel \
408         libsecret-devel \
409         libsoup-devel \
410         libsrtp-devel \
411         libtasn1-devel \
412         libtheora-devel \
413         libv4l-devel \
414         libvorbis-devel \
415         libvpx-devel \
416         libwebp-devel \
417         libwayland-client-devel \
418         libwayland-server-devel \
419         mesa-libGL-devel \
420         ninja-build \
421         openssl-devel \
422         opus-devel \
423         patch \
424         pcre-devel \
425         perl-Switch \
426         perl-version \
427         pulseaudio-libs-devel \
428         python-devel \
429         redhat-rpm-config \
430         ruby \
431         sqlite-devel"
432
433     # These are dependencies necessary for running tests.
434     packages="$packages \
435         curl \
436         dbus-x11 \
437         gdb \
438         hunspell-en \
439         httpd \
440         libgpg-error-devel \
441         mod_bw \
442         mod_ssl \
443         perl-CGI \
444         php \
445         psmisc \
446         pulseaudio-utils \
447         pygobject3-base \
448         python2-psutil \
449         ruby \
450         rubygem-json \
451         rubygem-highline \
452         weston-devel \
453         xorg-x11-server-Xvfb"
454
455     # These are dependencies necessary for building the jhbuild.
456     packages="$packages \
457         expat-devel \
458         docbook-utils \
459         docbook-utils-pdf \
460         git \
461         gobject-introspection \
462         gnutls-devel \
463         gsettings-desktop-schemas-devel \
464         icon-naming-utils \
465         itstool \
466         libXfont-devel \
467         libcroco-devel \
468         libdrm-devel \
469         libepoxy-devel \
470         libevdev-devel
471         libgpg-error-devel \
472         libinput-devel \
473         libp11-devel \
474         libpciaccess-devel \
475         libproxy-devel \
476         libtiff-devel \
477         libxcb-devel \
478         libxkbfile-devel \
479         mesa-libEGL-devel \
480         mtdev-devel \
481         orc-devel \
482         ragel \
483         systemd-devel \
484         xorg-x11-font-utils \
485         xorg-x11-proto-devel \
486         xorg-x11-util-macros \
487         xorg-x11-xtrans-devel \
488         yasm"
489
490     # These are dependencies necessary for using webkit-patch
491     packages="$packages
492         git-svn \
493         subversion"
494
495     dnf install $packages
496 }
497
498 checkInstaller
499