2020-11-17 08:49:39 +03:00
|
|
|
#!/bin/sh
|
|
|
|
set -eufx
|
|
|
|
|
2021-03-29 00:57:06 +03:00
|
|
|
FEATURE_SET=min
|
|
|
|
ARCH=amd64
|
2020-11-17 08:49:39 +03:00
|
|
|
|
2021-09-03 14:12:29 +03:00
|
|
|
# See apt.conf(5)
|
|
|
|
DEBUG_OPTS=
|
|
|
|
#DEBUG_OPTS="$DEBUG_OPTS -oDebug::pkgProblemResolver=1"
|
|
|
|
|
|
|
|
# Given a list of i386 packages, this call makes sure the amd64 variants
|
|
|
|
# of the development libraries are not installed
|
|
|
|
remove_64bit_libdev_packages()
|
|
|
|
{
|
|
|
|
flags=$-
|
|
|
|
set +x ;# Disable tracing for this func
|
|
|
|
rlist=""
|
|
|
|
for p in $PACKAGES; do
|
|
|
|
# Identify packages starting with 'lib' and ending with '-dev:i386'
|
|
|
|
if [ "${p#lib}" != "$p" -a "${p%-dev:i386}" != "$p" ]; then
|
|
|
|
p64=${p%i386}amd64
|
|
|
|
if dpkg -s $p64 >/dev/null 2>&1 ; then
|
|
|
|
rlist="$rlist ${p%i386}amd64"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if [ -n "$rlist" ]; then
|
|
|
|
echo "** Some 64-bit development packages appear to clash with i386 packages"
|
|
|
|
echo "**$rlist"
|
|
|
|
apt-get remove $rlist || :
|
|
|
|
fi
|
|
|
|
# Restore tracing, if enabled on entry
|
|
|
|
set -$flags
|
|
|
|
}
|
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# M A I N
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
2021-03-29 00:57:06 +03:00
|
|
|
if [ $# -ge 1 ]; then
|
|
|
|
FEATURE_SET="$1"
|
|
|
|
shift
|
2020-11-17 08:49:39 +03:00
|
|
|
fi
|
2021-03-29 00:57:06 +03:00
|
|
|
if [ $# -ge 1 ]; then
|
|
|
|
ARCH="$1"
|
|
|
|
shift
|
2020-11-17 08:49:39 +03:00
|
|
|
fi
|
2021-03-29 00:57:06 +03:00
|
|
|
APT_EXTRA_ARGS="$@"
|
2020-11-17 08:49:39 +03:00
|
|
|
|
|
|
|
# common build tools for all architectures and feature sets
|
|
|
|
PACKAGES=" \
|
|
|
|
autoconf \
|
|
|
|
automake \
|
|
|
|
clang \
|
|
|
|
gcc \
|
|
|
|
g++ \
|
|
|
|
libtool \
|
|
|
|
make \
|
|
|
|
nasm \
|
2021-03-29 00:55:19 +03:00
|
|
|
pkg-config \
|
|
|
|
check \
|
2023-02-04 23:14:22 +03:00
|
|
|
libcmocka-dev
|
2020-11-17 08:49:39 +03:00
|
|
|
"
|
|
|
|
|
2022-09-06 11:58:04 +03:00
|
|
|
# libfreetype-dev package was renamed from libfreetype6-dev in older
|
|
|
|
# versions
|
|
|
|
case `lsb_release -si`/`lsb_release -sr` in
|
|
|
|
Debian/10) LIBFREETYPE_DEV=libfreetype6-dev ;;
|
|
|
|
Ubuntu/18.*) LIBFREETYPE_DEV=libfreetype6-dev ;;
|
|
|
|
*) LIBFREETYPE_DEV=libfreetype-dev
|
|
|
|
esac
|
|
|
|
|
2020-11-17 08:49:39 +03:00
|
|
|
case "$ARCH"
|
|
|
|
in
|
|
|
|
amd64)
|
|
|
|
PACKAGES_AMD64_MIN=" \
|
|
|
|
libpam0g-dev \
|
|
|
|
libssl-dev \
|
|
|
|
libx11-dev \
|
|
|
|
libxrandr-dev \
|
|
|
|
libxfixes-dev"
|
2022-09-03 03:50:56 +03:00
|
|
|
|
2020-11-17 08:49:39 +03:00
|
|
|
case "$FEATURE_SET"
|
|
|
|
in
|
|
|
|
min)
|
|
|
|
PACKAGES="$PACKAGES $PACKAGES_AMD64_MIN"
|
|
|
|
;;
|
|
|
|
max)
|
|
|
|
PACKAGES="$PACKAGES \
|
2023-02-04 23:14:22 +03:00
|
|
|
$PACKAGES_AMD64_MIN \
|
2022-09-06 11:58:04 +03:00
|
|
|
$LIBFREETYPE_DEV \
|
2020-11-17 08:49:39 +03:00
|
|
|
libfuse-dev \
|
|
|
|
libjpeg-dev \
|
|
|
|
libmp3lame-dev \
|
|
|
|
libfdk-aac-dev \
|
2021-07-22 17:23:30 +03:00
|
|
|
libimlib2-dev \
|
2020-11-17 08:49:39 +03:00
|
|
|
libopus-dev \
|
|
|
|
libpixman-1-dev"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "unsupported feature set: $FEATURE_SET"
|
|
|
|
exit 1;
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
i386)
|
2022-10-19 13:29:11 +03:00
|
|
|
# This list is not as complete as the amd64 list. It currently
|
|
|
|
# supports 32-bit CI building only, rather than being a generic
|
|
|
|
# build support tool.
|
|
|
|
# - Ubuntu 18.04 -> 20.04
|
|
|
|
# Removed fdk-aac-dev:i386 and libfuse-dev:i386
|
2020-11-17 08:49:39 +03:00
|
|
|
PACKAGES="$PACKAGES \
|
|
|
|
g++-multilib \
|
|
|
|
gcc-multilib \
|
2022-09-06 11:58:04 +03:00
|
|
|
$LIBFREETYPE_DEV:i386 \
|
2020-11-17 08:49:39 +03:00
|
|
|
libgl1-mesa-dev:i386 \
|
|
|
|
libglu1-mesa-dev:i386 \
|
|
|
|
libjpeg-dev:i386 \
|
2021-08-09 14:00:06 +03:00
|
|
|
libimlib2-dev:i386 \
|
2020-11-17 08:49:39 +03:00
|
|
|
libmp3lame-dev:i386 \
|
|
|
|
libopus-dev:i386 \
|
|
|
|
libpam0g-dev:i386 \
|
|
|
|
libssl-dev:i386 \
|
|
|
|
libx11-dev:i386 \
|
|
|
|
libxext-dev:i386 \
|
|
|
|
libxfixes-dev:i386 \
|
|
|
|
libxrandr-dev:i386 \
|
2023-02-11 08:28:30 +03:00
|
|
|
libxrender-dev:i386 \
|
|
|
|
libsubunit-dev:i386 \
|
|
|
|
check:i386 \
|
|
|
|
libcmocka-dev:i386"
|
2022-09-03 03:50:56 +03:00
|
|
|
|
2020-11-17 08:49:39 +03:00
|
|
|
dpkg --add-architecture i386
|
|
|
|
dpkg --print-architecture
|
|
|
|
dpkg --print-foreign-architectures
|
|
|
|
apt-get update
|
2021-09-03 14:12:29 +03:00
|
|
|
remove_64bit_libdev_packages $PACKAGES
|
2020-11-17 08:49:39 +03:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "unsupported architecture: $ARCH"
|
|
|
|
exit 1;
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2021-05-28 12:15:52 +03:00
|
|
|
apt-get update
|
2023-02-04 23:14:22 +03:00
|
|
|
apt-get upgrade
|
2020-11-17 08:49:39 +03:00
|
|
|
apt-get -yq \
|
|
|
|
--no-install-suggests \
|
|
|
|
--no-install-recommends \
|
2021-09-03 14:12:29 +03:00
|
|
|
$DEBUG_OPTS \
|
2020-11-17 08:49:39 +03:00
|
|
|
$APT_EXTRA_ARGS \
|
|
|
|
install $PACKAGES
|