blob: c16fd92517bfb1a17afc96864c94e960c8c19353 [file] [log] [blame]
Ilmari Lauhakangasac586d12021-08-20 11:10:30 +03001#!/usr/bin/env bash
Noel Grandin8da9f852021-03-30 10:35:05 +02002#
3# This file is part of the LibreOffice project.
4#
5# This Source Code Form is subject to the terms of the Mozilla Public
6# License, v. 2.0. If a copy of the MPL was not distributed with this
7# file, You can obtain one at http://mozilla.org/MPL/2.0/.
8#
9# This script attempts to install the necessary dependencies to do LibreOffice development.
10#
11# It should be kept in sync with the instructions at
12# https://wiki.documentfoundation.org/Development/BuildingOnLinux
13#
14
15# Detect OS (i.e. distro)
16if [ -f /etc/os-release ]; then
17 # freedesktop.org and systemd
18 . /etc/os-release
19 OS=$NAME
20 VER=$VERSION_ID
21elif type lsb_release >/dev/null 2>&1; then
22 # linuxbase.org
23 OS=$(lsb_release -si)
24 VER=$(lsb_release -sr)
25elif [ -f /etc/lsb-release ]; then
26 # For some versions of Debian/Ubuntu without lsb_release command
27 . /etc/lsb-release
28 OS=$DISTRIB_ID
29 VER=$DISTRIB_RELEASE
30elif [ -f /etc/debian_version ]; then
31 # Older Debian/Ubuntu/etc.
32 OS=Debian
33 VER=$(cat /etc/debian_version)
34elif [ -f /etc/SuSe-release ]; then
35 # Older SuSE/etc.
36 ...
37elif [ -f /etc/redhat-release ]; then
38 # Older Red Hat, CentOS, etc.
39 ...
40else
41 # Fall back to uname, e.g. "Linux <version>", also works for BSD, etc.
42 OS=$(uname -s)
43 VER=$(uname -r)
44fi
45
46echo "Detected OS/Distro/Version" $OS $VER
47
48if [ "$OS" = "Debian" -o "$OS" = "Ubuntu" ]; then
49 apt-get install git build-essential zip ccache junit4 libkrb5-dev nasm graphviz python3 python3-dev qtbase5-dev libkf5coreaddons-dev libkf5i18n-dev libkf5config-dev libkf5windowsystem-dev libkf5kio-dev autoconf libcups2-dev libfontconfig1-dev gperf default-jdk doxygen libxslt1-dev xsltproc libxml2-utils libxrandr-dev bison flex libgtk-3-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev ant ant-optional
50else
51 echo "Sorry, I don't know how to install dependencies for" $OS
52fi