File: install-dependencies

package info (click to toggle)
wpewebkit 2.50.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 438,288 kB
  • sloc: cpp: 3,777,429; javascript: 197,888; ansic: 156,951; python: 49,118; asm: 21,987; ruby: 18,540; perl: 16,722; xml: 4,623; yacc: 2,360; sh: 2,096; java: 2,019; lex: 1,327; pascal: 366; makefile: 92
file content (82 lines) | stat: -rwxr-xr-x 1,979 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/usr/bin/env bash

set -e

# This script needs to be run with root rights.
if [ $UID -ne 0 ]; then
    sudo $0
    exit $?
fi

declare -ga PACKAGES

function printNotSupportedMessageAndExit() {
    echo
    echo "Currently this script only works for distributions supporting apt-get, dnf or pacman."
    echo "Please add support for your distribution and submit the patch at https://bugs.webkit.org"
    echo
    exit 1
}

function guessPackageManager() {
    local ret

    if apt-get --version &>/dev/null; then
        # apt-get - Debian based distributions
        ret="apt"
    elif dnf --version &>/dev/null; then
        # dnf - Fedora
        ret="dnf"
    elif pacman -Ss &>/dev/null; then
        # pacman - Arch Linux
        # pacman --version and pacman --help both return non-0
        ret="pacman"
    else
        printNotSupportedMessageAndExit
    fi

    echo $ret
}

function installDependencies {
    local packageManager

    packageManager=$(guessPackageManager)
    source "$(dirname "$0")/dependencies/$packageManager"
    installDependenciesWith${packageManager^}
}

function installDependenciesWithApt {
    apt-get install -y --no-install-recommends ${PACKAGES[@]}
}

function installDependenciesWithDnf {
    dnf install ${PACKAGES[@]}
}

function installDependenciesWithPacman {
    pacman -S --needed ${PACKAGES[@]}

    cat <<-EOF

The following packages are available from AUR, and needed for running tests:

    ruby-json ruby-highline

Instructions on how to use the AUR can be found on the Arch Wiki:

    https://wiki.archlinux.org/index.php/Arch_User_Repository

You will also need to follow the instructions on the wiki to make 'python'
call python2 in the WebKit folder:

    https://wiki.archlinux.org/index.php/Python#Dealing_with_version_problem_in_build_scripts

Alternatively, you may use a Python 2.x virtualenv while hacking on WPE:

    https://wiki.archlinux.org/index.php/Python/Virtual_environment

EOF
}

installDependencies