diff options
Diffstat (limited to 'tools/debian-setup.sh')
-rwxr-xr-x | tools/debian-setup.sh | 265 |
1 files changed, 127 insertions, 138 deletions
diff --git a/tools/debian-setup.sh b/tools/debian-setup.sh index 9b688794..8fade5ac 100755 --- a/tools/debian-setup.sh +++ b/tools/debian-setup.sh @@ -26,6 +26,26 @@ function print_usage() { printf "\\t[other]: other options are passed as-is to apt\\n" } +# Adds package $2 to list variable $1 if the package is found. +# If $3 is given, then this version requirement must be satisfied. +function add_package() { + local list="$1" pkgname="$2" versionreq="${3:-}" version + + version=$(apt-cache show "$pkgname" 2>/dev/null | + awk '/^Version:/{ print $2; exit}') + # fail if the package is not known + if [ -z "$version" ]; then + return 1 + elif [ -n "$versionreq" ]; then + # Require minimum version or fail. + # shellcheck disable=SC2086 + dpkg --compare-versions $version $versionreq || return 1 + fi + + # package is found, append it to list + eval "${list}=\"\${${list}} \${pkgname}\"" +} + ADDITIONAL=0 DEBDEPS=0 TESTDEPS=0 @@ -75,36 +95,48 @@ then exit 1 fi -BASIC_LIST="gcc \ - g++\ - libglib2.0-dev \ - libc-ares-dev \ - libpcap-dev \ - libpcre2-dev \ - flex \ - make \ - python3 \ - libgcrypt-dev \ - libspeexdsp-dev" - -QT5_LIST="qttools5-dev \ - qttools5-dev-tools \ - libqt5svg5-dev \ - qtmultimedia5-dev \ - qtbase5-dev \ - qtchooser \ - qt5-qmake \ - qtbase5-dev-tools" - -QT6_LIST="qt6-base-dev \ - qt6-multimedia-dev \ - qt6-tools-dev \ - qt6-tools-dev-tools \ - qt6-l10n-tools \ - libqt6core5compat6-dev \ - freeglut3-dev \ - libvulkan-dev \ - libxkbcommon-dev" +BASIC_LIST=" + cmake + flex + g++ + gcc + libc-ares-dev + libgcrypt-dev + libglib2.0-dev + libpcap-dev + libpcre2-dev + libspeexdsp-dev + make + python3 + " + +QT5_LIST=" + libqt5svg5-dev + qt5-qmake + qtbase5-dev + qtbase5-dev-tools + qtchooser + qtmultimedia5-dev + qttools5-dev + qttools5-dev-tools + " + +QT6_LIST=" + freeglut3-dev + libqt6svg6-dev + libvulkan-dev + libxkbcommon-dev + qt6-base-dev + qt6-l10n-tools + qt6-multimedia-dev + qt6-tools-dev + qt6-tools-dev-tools + " + +# qt6-5compat-dev: Debian >= bookworm, Ubuntu >= 23.04 +# libqt6core5compat6-dev: Ubuntu 22.04 +add_package QT6_LIST qt6-5compat-dev || +QT6_LIST="$QT6_LIST libqt6core5compat6-dev" if [ $ADD_QT5 -ne 0 ] then @@ -125,144 +157,101 @@ then # shellcheck disable=SC1090 . "${os_release}" - # Ubuntu 22.04 (jammy) or later + # Ubuntu 22.04 (jammy) / Debian 12 (bookworm) or later MAJOR=$(echo "$VERSION_ID" | cut -f1 -d.) if [ "${ID:-linux}" = "ubuntu" ] && [ "${MAJOR:-0}" -ge "22" ]; then echo "Installing Qt6." BASIC_LIST="$BASIC_LIST $QT6_LIST" + elif [ "${ID:-linux}" = "debian" ] && [ "${MAJOR:-0}" -ge "12" ]; then + echo "Installing Qt6." + BASIC_LIST="$BASIC_LIST $QT6_LIST" else echo "Installing Qt5." BASIC_LIST="$BASIC_LIST $QT5_LIST" fi fi -ADDITIONAL_LIST="libnl-3-dev \ - libkrb5-dev \ - libsmi2-dev \ - libsbc-dev \ - liblua5.2-dev \ - libnl-cli-3-dev \ - libparse-yapp-perl \ - libcap-dev \ - liblz4-dev \ - libsnappy-dev \ - libzstd-dev \ - libspandsp-dev \ - libxml2-dev \ - libminizip-dev \ - git \ - ninja-build \ - perl \ - xsltproc \ - ccache \ - doxygen" +ADDITIONAL_LIST=" + ccache + doxygen + git + libbrotli-dev + libcap-dev + libgnutls28-dev + libkrb5-dev + liblz4-dev + libmaxminddb-dev + libminizip-dev + libnghttp2-dev + libnl-3-dev + libnl-cli-3-dev + libopencore-amrnb-dev + libopus-dev + libparse-yapp-perl + libsbc-dev + libssh-gcrypt-dev + libsmi2-dev + libsnappy-dev + libspandsp-dev + libsystemd-dev + libxml2-dev + libzstd-dev + ninja-build + perl + xsltproc + " # Uncomment to add PNG compression utilities used by compress-pngs: -# ADDITIONAL_LIST="$ADDITIONAL_LIST \ -# advancecomp \ -# optipng \ -# pngcrush" - -DEBDEPS_LIST="debhelper \ - dh-python \ - asciidoctor \ - docbook-xml \ - docbook-xsl \ - libxml2-utils \ - lintian \ - lsb-release \ - po-debconf \ - python3-ply \ - quilt" - -TESTDEPS_LIST="python3-pytest \ - python3-pytest-xdist" - -# Adds package $2 to list variable $1 if the package is found. -# If $3 is given, then this version requirement must be satisfied. -add_package() { - local list="$1" pkgname="$2" versionreq="${3:-}" version - - version=$(apt-cache show "$pkgname" 2>/dev/null | - awk '/^Version:/{ print $2; exit}') - # fail if the package is not known - if [ -z "$version" ]; then - return 1 - elif [ -n "$versionreq" ]; then - # Require minimum version or fail. - # shellcheck disable=SC2086 - dpkg --compare-versions $version $versionreq || return 1 - fi - - # package is found, append it to list - eval "${list}=\"\${${list}} \${pkgname}\"" -} +# ADDITIONAL_LIST=" +# $ADDITIONAL_LIST +# advancecomp +# optipng +# pngcrush +# " + +DEBDEPS_LIST=" + asciidoctor + debhelper + dh-python + docbook-xml + docbook-xsl + libxml2-utils + lintian + lsb-release + po-debconf + python3-ply + quilt + " + +TESTDEPS_LIST=" + gdb + python3-pytest + python3-pytest-xdist + softhsm2 + " # apt-get update must be called before calling add_package # otherwise available packages appear as unavailable apt-get update || exit 2 -# cmake3 3.5.1: Ubuntu 14.04 -# cmake >= 3.5: Debian >= jessie-backports, Ubuntu >= 16.04 -add_package BASIC_LIST cmake3 || -BASIC_LIST="$BASIC_LIST cmake" - -# Debian >= wheezy-backports, Ubuntu >= 16.04 -add_package ADDITIONAL_LIST libnghttp2-dev || -echo "libnghttp2-dev is unavailable" >&2 +# Lua 5.4: Debian >= bullseye, Ubuntu >= 22.04 (jammy) +# Lua 5.3: Debian >= buster, Ubuntu >= 20.04 (focal) +add_package ADDITIONAL_LIST liblua5.4-dev || +ADDITIONAL_LIST="$ADDITIONAL_LIST liblua5.3-dev" # Debian >= bookworm, Ubuntu >= 22.04 add_package ADDITIONAL_LIST libnghttp3-dev || echo "libnghttp3-dev is unavailable" >&2 -# libssh-gcrypt-dev: Debian >= jessie, Ubuntu >= 16.04 -# libssh-dev (>= 0.6): Debian >= jessie, Ubuntu >= 14.04 -add_package ADDITIONAL_LIST libssh-gcrypt-dev || -add_package ADDITIONAL_LIST libssh-dev || -echo "libssh-gcrypt-dev and libssh-dev are unavailable" >&2 - -# libgnutls28-dev: Debian >= wheezy-backports, Ubuntu >= 12.04 -add_package ADDITIONAL_LIST libgnutls28-dev || -echo "libgnutls28-dev is unavailable" >&2 - -# Debian >= jessie-backports, Ubuntu >= 16.04 -add_package ADDITIONAL_LIST libmaxminddb-dev || -echo "libmaxminddb-dev is unavailable" >&2 - -# Debian >= stretch-backports, Ubuntu >= 16.04 -add_package ADDITIONAL_LIST libbrotli-dev || -echo "libbrotli-dev is unavailable" >&2 - -# libsystemd-journal-dev: Ubuntu 14.04 -# libsystemd-dev: Ubuntu >= 16.04 -add_package ADDITIONAL_LIST libsystemd-dev || -add_package ADDITIONAL_LIST libsystemd-journal-dev || -echo "libsystemd-dev is unavailable" - # ilbc library from http://www.deb-multimedia.org add_package ADDITIONAL_LIST libilbc-dev || echo "libilbc-dev is unavailable" -# opus library libopus-dev -add_package ADDITIONAL_LIST libopus-dev || - echo "libopus-dev is unavailable" - +# Debian >= bullseye, Ubuntu >= 22.04 (jammy) # bcg729 library libbcg729-dev add_package ADDITIONAL_LIST libbcg729-dev || echo "libbcg729-dev is unavailable" -# softhsm2 2.0.0: Ubuntu 16.04 -# softhsm2 2.2.0: Debian >= jessie-backports, Ubuntu 18.04 -# softhsm2 >= 2.4.0: Debian >= buster, Ubuntu >= 18.10 -if ! add_package TESTDEPS_LIST softhsm2 '>= 2.3.0'; then - if add_package TESTDEPS_LIST softhsm2; then - # If SoftHSM 2.3.0 is unavailble, install p11tool. - TESTDEPS_LIST="$TESTDEPS_LIST gnutls-bin" - else - echo "softhsm2 is unavailable" >&2 - fi -fi - ACTUAL_LIST=$BASIC_LIST # Now arrange for optional support libraries |