7c22a6db841964d6db021896596ec486728a67ca
[WebKit-https.git] / Tools / efl / 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."
12     echo "Please add support for your distribution."
13     echo
14     exit 1
15 }
16
17 function checkCmakeVersion() {
18     CMAKE_VERSION=`cmake --version`
19
20     VERSION=`echo "$CMAKE_VERSION" | awk '{split($3,num,".");
21     if (!(num[1]>2 || num[2]>8 || num[3]>=10))
22         printf $3}'`
23
24     if [ -n "${VERSION}" ]; then
25         echo "Warning: CMake version detected (${VERSION}) is lower then 2.8.10."
26         echo "  This will probably cause errors, as older version didn't support CMAKE_NINJA_FORCE_RESPONSE_FILE,"
27         echo "  which is needed now for building. (look at: https://lists.webkit.org/pipermail/webkit-gtk/2014-March/001809.html )"
28         echo ""
29
30         if [ -f "/etc/issue" ]; then
31             ubuntu_version=`cat /etc/issue`
32             if [[ $ubuntu_version == *Ubuntu\ 12.04* ]]; then
33                 echo "  For Ubuntu 12.04 or 12.10 You might consider adding ppa from https://launchpad.net/~kalakris/+archive/ubuntu/cmake"
34             fi
35         fi
36     fi
37 }
38
39 function checkInstaller {
40     # apt-get - Debian based distributions
41     apt-get --version &> /dev/null
42     if [ $? -eq 0 ]; then
43         installDependenciesWithApt
44         checkCmakeVersion;
45         exit 0
46     fi
47
48     printNotSupportedMessageAndExit
49 }
50
51 function installDependenciesWithApt {
52     # These are dependencies necessary for building WebKitEFL.
53     apt-get install \
54         bison \
55         cmake \
56         doxygen \
57         flex \
58         g++ \
59         gperf \
60         gtk-doc-tools \
61         libatk1.0-dev \
62         libdbus-1-dev \
63         libenchant-dev \
64         libespeak-dev \
65         libfaad-dev \
66         libffi-dev \
67         libfreetype6-dev \
68         libgcrypt11-dev \
69         libgeoclue-dev \
70         libgif-dev \
71         libgl1-mesa-dev \
72         libgnutls28-dev \
73         libgpg-error-dev \
74         libicu-dev \
75         libjpeg-dev \
76         liblua5.1-0-dev \
77         libmpg123-dev \
78         libp11-kit-dev \
79         libpng-dev \
80         libpulse-dev \
81         libsqlite3-dev \
82         libssl-dev \
83         libtheora-dev \
84         libtiff4-dev \
85         libudev-dev \
86         libvorbis-dev \
87         libwebp-dev \
88         libxcomposite-dev \
89         libxcursor-dev \
90         libxinerama-dev \
91         libxp-dev \
92         libxrandr-dev \
93         libxrender-dev \
94         libxslt1-dev \
95         libxss-dev \
96         libxt-dev \
97         libxtst-dev \
98         ninja-build \
99         ragel \
100         ruby \
101         subversion \
102         x11proto-print-dev
103
104     # These are dependencies necessary for building WebKitEFL and not available on ARM64.
105     apt-get install \
106         luajit
107
108     # These are dependencies necessary for running tests.
109     apt-get install \
110         apache2 \
111         libapache2-mod-php5 \
112         libruby \
113         xvfb
114 }
115
116 checkInstaller
117