File: before_install.sh

package info (click to toggle)
wxpython4.0 4.2.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 232,540 kB
  • sloc: cpp: 958,937; python: 233,059; ansic: 150,441; makefile: 51,662; sh: 8,687; perl: 1,563; javascript: 584; php: 326; xml: 200
file content (118 lines) | stat: -rwxr-xr-x 4,785 bytes parent folder | download
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/bin/sh
#
# This script is used by GitHub to install the dependencies
# before building wxWidgets but can also be run by hand if necessary (but
# currently it only works for Ubuntu versions used by the CI builds).

set -e

SUDO=sudo

case $(uname -s) in
    Linux)
        if [ -f /etc/apt/sources.list ]; then
            # Show information about the repositories and priorities used.
            echo 'APT sources used:'
            $SUDO grep --no-messages '^[^#]' /etc/apt/sources.list /etc/apt/sources.list.d/* || true
            echo '--- End of APT files dump ---'

            run_apt() {
                echo "-> Running apt-get $@"

                # Disable some (but not all) output.
                $SUDO apt-get -q -o=Dpkg::Use-Pty=0 "$@"

                rc=$?
                echo "-> Done with $rc"

                return $rc
            }

            codename=$(lsb_release --codename --short)
            if [ "$wxUSE_ASAN" = 1 ]; then
                # Enable the `-dbgsym` repositories.
                echo "deb http://ddebs.ubuntu.com ${codename} main restricted universe multiverse
                deb http://ddebs.ubuntu.com ${codename}-updates main restricted universe multiverse" | \
                $SUDO tee --append /etc/apt/sources.list.d/ddebs.list >/dev/null

                # Import the debug symbol archive signing key from the Ubuntu server.
                # Note that this command works only on Ubuntu 18.04 LTS and newer.
                run_apt install -y ubuntu-dbgsym-keyring

                # Install the symbols to allow LSAN suppression list to work.
                dbgsym_pkgs='libfontconfig1-dbgsym libglib2.0-0-dbgsym libgtk-3-0-dbgsym libatk-bridge2.0-0-dbgsym'
            fi

            run_apt update || echo 'Failed to update packages, but continuing nevertheless.'

            case "$wxCONFIGURE_FLAGS" in
                *--with-directfb*) libtoolkit_dev='libdirectfb-dev'         ;;
                *--with-motif*)    libtoolkit_dev='libmotif-dev libxmu-dev' ;;
                *--with-qt*)       libtoolkit_dev='qtdeclarative5-dev libqt5opengl5-dev';;
                *--with-x11*)      extra_deps='libpango1.0-dev' ;;
                *--disable-gui*)   ;;
                *)
                    case "$wxGTK_VERSION" in
                        3)  libtoolkit_dev=libgtk-3-dev
                            extra_deps='libwebkit2gtk-4.0-dev libgspell-1-dev'
                            ;;
                        2)  libtoolkit_dev=libgtk2.0-dev
                            extra_deps='libwebkitgtk-dev'
                            ;;
                        *)  echo 'Please specify wxGTK_VERSION explicitly.' >&2
                            exit 1
                            ;;
                    esac

                    case "$codename" in
                        jammy)
                            # Under Ubuntu 22.04 installing libgstreamer1.0-dev
                            # fails because it depends on libunwind-dev which
                            # is not going to be installed because it conflicts
                            # with the pre-installed (in GitHub Actions
                            # environment) libc++-dev, so we need to install it
                            # directly to avoid errors later.
                            extra_deps="$extra_deps libunwind-dev"
                            ;;
                    esac

                    extra_deps="$extra_deps \
                            libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
                            libglu1-mesa-dev"
            esac

            pkg_install="$pkg_install $libtoolkit_dev gdb"

            extra_deps="$extra_deps libcurl4-openssl-dev libsecret-1-dev libnotify-dev"
            for pkg in $extra_deps; do
                if $(apt-cache pkgnames | grep -q $pkg) ; then
                    pkg_install="$pkg_install $pkg"
                else
                    echo "Not installing non-existent package $pkg"
                fi
            done

            if ! run_apt install -y $pkg_install $dbgsym_pkgs; then
                if [ -z "$dbgsym_pkgs" ]; then
                    exit 1
                fi

                # Retry without dbgsym packages that currently fail to install
                # under Ubuntu Focal (20.04).
                echo 'Installing with dbgsym packages failed, retrying without...'
                if ! run_apt install -y $pkg_install; then
                    exit 1
                fi
            else
                touch wx_dbgsym_available
            fi
        fi
        ;;

    FreeBSD)
        pkg install -q -y gspell gstreamer1 gtk3 jpeg-turbo libnotify libsecret mesa-libs pkgconf png tiff webkit2-gtk3
        ;;

    Darwin)
        ;;
esac