[72768] | 1 | #!/bin/sh
|
---|
[72787] | 2 | # @file
|
---|
| 3 | ## $Id: prerequisites-deb.sh 98103 2023-01-17 14:15:46Z vboxsync $
|
---|
| 4 | # Fetches prerequisites for Debian based GNU/Linux systems.
|
---|
| 5 | #
|
---|
| 6 |
|
---|
| 7 | #
|
---|
[98103] | 8 | # Copyright (C) 2018-2023 Oracle and/or its affiliates.
|
---|
[72787] | 9 | #
|
---|
[96407] | 10 | # This file is part of VirtualBox base platform packages, as
|
---|
| 11 | # available from https://www.virtualbox.org.
|
---|
[72787] | 12 | #
|
---|
[96407] | 13 | # This program is free software; you can redistribute it and/or
|
---|
| 14 | # modify it under the terms of the GNU General Public License
|
---|
| 15 | # as published by the Free Software Foundation, in version 3 of the
|
---|
| 16 | # License.
|
---|
| 17 | #
|
---|
| 18 | # This program is distributed in the hope that it will be useful, but
|
---|
| 19 | # WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
| 21 | # General Public License for more details.
|
---|
| 22 | #
|
---|
| 23 | # You should have received a copy of the GNU General Public License
|
---|
| 24 | # along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
| 25 | #
|
---|
| 26 | # SPDX-License-Identifier: GPL-3.0-only
|
---|
| 27 | #
|
---|
[72787] | 28 |
|
---|
[73122] | 29 | # What this script does:
|
---|
| 30 | usage_msg="\
|
---|
| 31 | Usage: `basename ${0}` [--with-docs]
|
---|
| 32 |
|
---|
| 33 | Install the dependencies needed for building VirtualBox on an deb-based Linux
|
---|
| 34 | system. Additional distributions will be added as needed. There are no plans
|
---|
| 35 | to add support for or to accept patches for distributions we do not package.
|
---|
| 36 | The \`--with-docs\' parameter is to install the packages needed for building
|
---|
| 37 | documentation. It will also be implemented per distribution as needed."
|
---|
| 38 |
|
---|
| 39 | # To repeat: there are no plans to add support for or to accept patches
|
---|
| 40 | # for distributions we do not package.
|
---|
| 41 |
|
---|
| 42 | usage()
|
---|
| 43 | {
|
---|
| 44 | echo "${usage_msg}"
|
---|
| 45 | exit "${1}"
|
---|
| 46 | }
|
---|
| 47 |
|
---|
| 48 | unset WITHDOCS
|
---|
| 49 |
|
---|
| 50 | while test -n "${1}"; do
|
---|
| 51 | case "${1}" in
|
---|
| 52 | --with-docs)
|
---|
| 53 | WITHDOCS=1
|
---|
| 54 | shift ;;
|
---|
| 55 | -h|--help)
|
---|
| 56 | usage 0 ;;
|
---|
| 57 | *)
|
---|
| 58 | echo "Unknown parameter ${1}" >&2
|
---|
| 59 | usage 1 ;;
|
---|
| 60 | esac
|
---|
| 61 | done
|
---|
| 62 |
|
---|
| 63 | export LC_ALL=C
|
---|
| 64 | PATH=/sbin:/usr/sbin:$PATH
|
---|
| 65 | read DEBVER < /etc/debian_version
|
---|
| 66 |
|
---|
| 67 | apt-get update
|
---|
| 68 | # We deal with different distributions having different lists of prerequisites
|
---|
| 69 | # by splitting them into several apt commands. Some will fail on some
|
---|
| 70 | # distributions, but at the end everything needed should be there.
|
---|
[76314] | 71 | apt-get install -y chrpath g++ make wget iasl libidl-dev libsdl1.2-dev \
|
---|
[73341] | 72 | libsdl-ttf2.0-dev libpam0g-dev libssl-dev libpulse-dev \
|
---|
| 73 | libasound2-dev xsltproc libxml2-dev libxml2-utils unzip \
|
---|
| 74 | libxrandr-dev libxinerama-dev libcap-dev python-dev \
|
---|
| 75 | libxmu-dev libxcursor-dev libcurl4-openssl-dev libdevmapper-dev \
|
---|
[73122] | 76 | libvpx-dev g++-multilib libopus-dev || true
|
---|
[73503] | 77 | # 32-bits libs for 64-bit installs.
|
---|
| 78 | case `uname -m` in
|
---|
| 79 | x86_64|amd64|AMD64)
|
---|
| 80 | apt-get install -y libc6-dev-i386 lib32gcc1 lib32stdc++6 lib32z1-dev || true
|
---|
| 81 | ;;
|
---|
| 82 | esac
|
---|
[73122] | 83 | # Only install Qt5 on recent distributions
|
---|
| 84 | case "${DEBVER}" in
|
---|
| 85 | 7*|8*|jessie*|stretch*) ;;
|
---|
| 86 | *)
|
---|
| 87 | apt-get install -y qttools5-dev-tools libqt5opengl5-dev \
|
---|
[73341] | 88 | libqt5x11extras5-dev || true ;;
|
---|
[73122] | 89 | esac
|
---|
| 90 | test -n "${WITHDOCS}" &&
|
---|
| 91 | apt-get install -y doxygen texlive texlive-latex-extra texlive-fonts-extra
|
---|
[72768] | 92 | # Ubuntu only
|
---|
| 93 | grep Ubuntu /etc/lsb-release 2>/dev/null >&2 &&
|
---|
[73122] | 94 | apt-get install -y linux-headers-generic
|
---|
[72768] | 95 | # apt-get install wine linux-headers-`uname -r` # Not for chroot installs.
|
---|