[EFL] Add OpenWebRTC in jhbuild
[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         libjson-glib-dev \
77         liblua5.1-0-dev \
78         libmpg123-dev \
79         liborc-0.4-dev \
80         libp11-kit-dev \
81         libpng-dev \
82         libpulse-dev \
83         libsqlite3-dev \
84         libssl-dev \
85         libtheora-dev \
86         libtiff4-dev \
87         libudev-dev \
88         libvorbis-dev \
89         libwebp-dev \
90         libxcomposite-dev \
91         libxcursor-dev \
92         libxinerama-dev \
93         libxp-dev \
94         libxrandr-dev \
95         libxrender-dev \
96         libxslt1-dev \
97         libxss-dev \
98         libxt-dev \
99         libxtst-dev \
100         ninja-build \
101         ragel \
102         ruby \
103         subversion \
104         x11proto-print-dev
105
106     # These are dependencies necessary for building WebKitEFL and not available on ARM64.
107     apt-get install \
108         luajit
109
110     # These are dependencies necessary for running tests.
111     apt-get install \
112         apache2 \
113         libapache2-mod-php5 \
114         libruby \
115         xvfb
116 }
117
118 checkInstaller
119