3 # This script needs to be run with root rights.
4 if [ $UID -ne 0 ]; then
9 function printNotSupportedMessageAndExit() {
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"
17 function checkInstaller {
18 # apt-get - Debian based distributions
19 apt-get --version &> /dev/null
21 installDependenciesWithApt
25 # yum - Fedora 21 and below
26 yum --version &> /dev/null
28 installFedoraDependencies yum
32 # dnf - Fedora 22 and above
33 dnf --version &> /dev/null
35 installFedoraDependencies dnf
40 # pacman --version and pacman --help both return non-0
41 pacman -Ss &> /dev/null
43 installDependenciesWithPacman
47 printNotSupportedMessageAndExit
50 function installDependenciesWithApt {
51 # These are dependencies necessary for building WebKitGTK+.
70 libgirepository1.0-dev \
100 # These are dependencies necessary for running tests.
106 libapache2-mod-php5 \
115 # These are dependencies necessary for building the jhbuild.
118 gobject-introspection \
134 x11proto-bigreqs-dev \
135 x11proto-composite-dev \
139 x11proto-resource-dev \
140 x11proto-scrnsaver-dev \
142 x11proto-xcmisc-dev \
143 x11proto-xf86dri-dev \
148 # These are dependencies necessary for using webkit-patch
153 # ninja is a faster build system than GNU make, but it doesn't
154 # exist on Ubuntu 12.04
155 apt-get install ninja-build || true
158 function installDependenciesWithPacman {
159 # These are dependencies necessary for building WebKitGTK+.
192 gobject-introspection \
224 # These are dependencies necessary for running tests.
225 # Note: apache-mod_bw is available in the AUR, but the main repos
226 # could not find ruby-json
227 packages="$packages \
240 # These are dependencies necessary for building the jhbuild.
241 # Note: Could not find libegl-mesa
242 packages="$packages \
244 gobject-introspection \
274 # These are dependencies necessary for using webkit-patch
275 packages="$packages \
277 pacman -S --needed $packages
279 echo "You will also need to follow the instructions on the Arch Wiki to make"
280 echo "'python' call python2 in the webkit folder"
281 echo "https://wiki.archlinux.org/index.php/Python#Dealing_with_version_problem_in_build_scripts"
284 function installFedoraDependencies {
285 # These are dependencies necessary for building WebKitGTK+.
300 gobject-introspection-devel \
303 gstreamer1-plugins-base-devel \
312 libjpeg-turbo-devel \
327 # These are dependencies necessary for running tests.
345 # These are dependencies necessary for building the jhbuild.
350 gobject-introspection \
365 xorg-x11-font-utils \
366 xorg-x11-proto-devel \
367 xorg-x11-util-macros \
368 xorg-x11-xtrans-devel
370 # These are dependencies necessary for using webkit-patch