2015-12-30 12:03:53 -05:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2021-07-15 07:53:12 -04:00
|
|
|
# This script is used by GitHub to install the dependencies
|
2021-04-16 13:23:28 -04:00
|
|
|
# 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).
|
2015-12-30 12:03:53 -05:00
|
|
|
|
2021-03-23 07:41:31 -04:00
|
|
|
set -e
|
|
|
|
|
2015-12-30 12:03:53 -05:00
|
|
|
SUDO=sudo
|
|
|
|
|
|
|
|
case $(uname -s) in
|
|
|
|
Linux)
|
|
|
|
if [ -f /etc/apt/sources.list ]; then
|
2021-03-23 07:57:40 -04:00
|
|
|
# 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 ---'
|
|
|
|
|
2021-03-23 07:23:39 -04:00
|
|
|
run_apt() {
|
2022-02-24 18:16:10 -05:00
|
|
|
echo "-> Running apt-get $@"
|
2021-03-23 07:23:39 -04:00
|
|
|
|
|
|
|
# Disable some (but not all) output.
|
|
|
|
$SUDO apt-get -q -o=Dpkg::Use-Pty=0 "$@"
|
|
|
|
|
2022-04-10 11:47:54 -04:00
|
|
|
rc=$?
|
|
|
|
echo "-> Done with $rc"
|
2022-02-24 18:16:10 -05:00
|
|
|
|
2022-04-10 11:47:54 -04:00
|
|
|
return $rc
|
2021-03-23 07:23:39 -04:00
|
|
|
}
|
2021-03-22 20:55:50 -04:00
|
|
|
|
2021-03-22 20:36:06 -04:00
|
|
|
if [ "$wxUSE_ASAN" = 1 ]; then
|
|
|
|
codename=$(lsb_release --codename --short)
|
|
|
|
# Enable the `-dbgsym` repositories.
|
|
|
|
echo "deb http://ddebs.ubuntu.com ${codename} main restricted universe multiverse
|
2021-03-22 20:58:30 -04:00
|
|
|
deb http://ddebs.ubuntu.com ${codename}-updates main restricted universe multiverse" | \
|
2021-03-22 20:59:05 -04:00
|
|
|
$SUDO tee --append /etc/apt/sources.list.d/ddebs.list >/dev/null
|
2021-03-22 20:36:06 -04:00
|
|
|
|
|
|
|
# Import the debug symbol archive signing key from the Ubuntu server.
|
|
|
|
# Note that this command works only on Ubuntu 18.04 LTS and newer.
|
2021-03-23 07:23:39 -04:00
|
|
|
run_apt install -y ubuntu-dbgsym-keyring
|
2021-03-22 20:36:06 -04:00
|
|
|
|
|
|
|
# Install the symbols to allow LSAN suppression list to work.
|
2021-03-23 08:36:48 -04:00
|
|
|
dbgsym_pkgs='libfontconfig1-dbgsym libglib2.0-0-dbgsym libgtk-3-0-dbgsym libatk-bridge2.0-0-dbgsym'
|
2021-03-22 20:36:06 -04:00
|
|
|
fi
|
|
|
|
|
2021-04-12 15:04:21 -04:00
|
|
|
run_apt update || echo 'Failed to update packages, but continuing nevertheless.'
|
2018-09-18 04:28:33 -04:00
|
|
|
|
|
|
|
case "$wxCONFIGURE_FLAGS" in
|
|
|
|
*--with-directfb*) libtoolkit_dev='libdirectfb-dev' ;;
|
|
|
|
*--with-motif*) libtoolkit_dev='libmotif-dev libxmu-dev' ;;
|
2020-04-22 11:12:03 -04:00
|
|
|
*--with-qt*) libtoolkit_dev='qtdeclarative5-dev libqt5opengl5-dev';;
|
2020-04-22 11:56:45 -04:00
|
|
|
*--with-x11*) extra_deps='libpango1.0-dev' ;;
|
2020-04-22 12:26:02 -04:00
|
|
|
*--disable-gui*) ;;
|
2020-04-22 11:25:33 -04:00
|
|
|
*)
|
|
|
|
case "$wxGTK_VERSION" in
|
|
|
|
3) libtoolkit_dev=libgtk-3-dev
|
2022-01-28 11:50:21 -05:00
|
|
|
extra_deps='libwebkit2gtk-4.0-dev libgspell-1-dev'
|
2020-04-22 11:25:33 -04:00
|
|
|
;;
|
2020-10-19 10:50:56 -04:00
|
|
|
2) libtoolkit_dev=libgtk2.0-dev
|
2020-04-22 11:25:33 -04:00
|
|
|
extra_deps='libwebkitgtk-dev'
|
|
|
|
;;
|
2020-10-19 10:50:56 -04:00
|
|
|
*) echo 'Please specify wxGTK_VERSION explicitly.' >&2
|
|
|
|
exit 1
|
|
|
|
;;
|
2020-04-22 11:25:33 -04:00
|
|
|
esac
|
2018-09-18 04:28:33 -04:00
|
|
|
|
2020-04-22 11:25:33 -04:00
|
|
|
extra_deps="$extra_deps \
|
|
|
|
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
|
|
|
|
libglu1-mesa-dev"
|
|
|
|
esac
|
2018-11-04 16:00:32 -05:00
|
|
|
|
2021-03-23 11:15:00 -04:00
|
|
|
pkg_install="$pkg_install $libtoolkit_dev gdb"
|
2021-03-22 20:37:31 -04:00
|
|
|
|
2021-01-27 18:04:39 -05:00
|
|
|
extra_deps="$extra_deps libcurl4-openssl-dev libsecret-1-dev libnotify-dev"
|
2020-04-22 11:25:33 -04:00
|
|
|
for pkg in $extra_deps; do
|
2018-11-04 16:00:32 -05:00
|
|
|
if $(apt-cache pkgnames | grep -q $pkg) ; then
|
|
|
|
pkg_install="$pkg_install $pkg"
|
2021-03-22 21:17:51 -04:00
|
|
|
else
|
|
|
|
echo "Not installing non-existent package $pkg"
|
2018-11-04 16:00:32 -05:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2021-03-23 08:36:48 -04:00
|
|
|
if ! run_apt install -y $pkg_install $dbgsym_pkgs; then
|
|
|
|
if [ -z "$dbgsym_pkgs" ]; then
|
2022-04-10 11:47:54 -04:00
|
|
|
exit 1
|
2021-03-23 08:36:48 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Retry without dbgsym packages that currently fail to install
|
|
|
|
# under Ubuntu Focal (20.04).
|
|
|
|
echo 'Installing with dbgsym packages failed, retrying without...'
|
2022-04-10 11:47:54 -04:00
|
|
|
if ! run_apt install -y $pkg_install; then
|
|
|
|
exit 1
|
|
|
|
fi
|
2021-03-23 08:36:48 -04:00
|
|
|
else
|
|
|
|
touch wx_dbgsym_available
|
|
|
|
fi
|
2015-12-30 12:03:53 -05:00
|
|
|
fi
|
|
|
|
;;
|
2015-12-30 09:56:44 -05:00
|
|
|
|
|
|
|
Darwin)
|
|
|
|
;;
|
2015-12-30 12:03:53 -05:00
|
|
|
esac
|