2021-06-03 13:47:08 +02:00
|
|
|
#!/usr/bin/env bash
|
2021-05-18 14:56:12 +02:00
|
|
|
|
2024-11-29 20:14:22 +01:00
|
|
|
# trisquel script: installs build dependencies for PureOS 10, Trisquel 9 and Trisquel 10.
|
2021-05-18 14:56:12 +02:00
|
|
|
#
|
2024-09-23 16:43:04 +02:00
|
|
|
# Copyright (C) 2014-2016, 2020-2021 Leah Rowe <info@minifree.org>
|
|
|
|
# Copyright (C) 2016, Klemens Nanni <contact@autoboot.org>
|
|
|
|
# Copyright (C) 2020, Wei Mingzhi <whistler_wmz@users.sf.net>
|
|
|
|
# Copyright (C) 2021, madbehaviorus <mad.behaviorus@mailbox.org>
|
|
|
|
# Copyright (C) 2021, Ron Nazarov <noisytoot@disroot.org>
|
2024-11-29 20:14:22 +01:00
|
|
|
# Copyright (C) 2023, Adrien Bourmault <neox@gnu.org>
|
2024-09-23 16:43:04 +02:00
|
|
|
# Copyright (C) 2023-2024 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
2021-05-18 14:56:12 +02:00
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
2021-11-18 08:13:54 +01:00
|
|
|
# the Free Software Foundation, version 3 of the License.
|
2021-05-18 14:56:12 +02:00
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
|
|
|
|
[ "x${DEBUG+set}" = 'xset' ] && set -v
|
|
|
|
set -u -e
|
|
|
|
|
2024-11-29 20:14:19 +01:00
|
|
|
to_install=""
|
2023-12-09 02:39:53 +01:00
|
|
|
install_packages()
|
|
|
|
{
|
|
|
|
for package in $@ ; do
|
2024-11-22 23:14:33 +01:00
|
|
|
if dpkg -l "${package}" | grep "^ii" 2>&1>/dev/null ; then
|
2023-12-09 02:39:53 +01:00
|
|
|
continue
|
|
|
|
else
|
|
|
|
to_install="${to_install} ${package}"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2021-05-18 14:56:12 +02:00
|
|
|
if [ $EUID -ne 0 ]; then
|
|
|
|
printf "This script must be run as root\n"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Duplications are intentional. Please do not re-factor.
|
|
|
|
#
|
|
|
|
# This is so that they can moved to separate scripts.
|
|
|
|
#
|
|
|
|
|
2023-12-09 02:39:53 +01:00
|
|
|
install_packages wget
|
2021-05-18 14:56:12 +02:00
|
|
|
|
|
|
|
# For downloading source code
|
|
|
|
# ------------------------------------------------------------
|
|
|
|
|
2023-12-09 02:39:53 +01:00
|
|
|
install_packages git
|
2021-05-18 14:56:12 +02:00
|
|
|
|
|
|
|
# For Tianocore and iPXE
|
|
|
|
# TODO: check whether this is the full list
|
|
|
|
|
2023-12-09 02:39:53 +01:00
|
|
|
install_packages uuid-dev nasm
|
2021-05-18 14:56:12 +02:00
|
|
|
|
|
|
|
# For building source code:
|
|
|
|
# ------------------------------------------------------------
|
|
|
|
|
2023-12-09 02:39:53 +01:00
|
|
|
install_packages build-essential
|
2021-05-18 14:56:12 +02:00
|
|
|
|
|
|
|
# for running the crostool script (to get mrc.bin file for t440p)
|
2023-12-09 02:39:53 +01:00
|
|
|
install_packages sharutils curl parted e2fsprogs unzip
|
2021-05-18 14:56:12 +02:00
|
|
|
|
|
|
|
# to use the right software versions and links for compiling
|
2024-07-29 16:56:58 +02:00
|
|
|
install_packages libtool pkg-config
|
2021-05-18 14:56:12 +02:00
|
|
|
|
|
|
|
# for cross-compiling ARM binaries
|
2023-12-09 02:39:53 +01:00
|
|
|
install_packages gcc-arm-linux-gnueabi
|
2021-05-18 14:56:12 +02:00
|
|
|
|
|
|
|
[ "$(uname -i)" = x86_64 ] || [ "$(uname -m)" = x86_64 ]
|
|
|
|
arch=${?}
|
|
|
|
|
|
|
|
# For cross-compiling i686 target on x86_64 host.
|
|
|
|
if [ "${arch}" -eq 0 ]; then
|
2023-12-09 02:39:53 +01:00
|
|
|
install_packages gcc-multilib libc6-i386 libc6-dev-i386
|
|
|
|
install_packages lib32stdc++6 g++-multilib dh-autoreconf
|
2021-05-18 14:56:12 +02:00
|
|
|
fi
|
|
|
|
|
2021-11-01 03:51:10 +01:00
|
|
|
# Memtest86+ build dependencies
|
|
|
|
# ------------------------------------------------------------
|
|
|
|
|
2023-12-09 16:11:58 +01:00
|
|
|
install_packages build-essential python2.7 python-is-python3
|
2021-11-01 03:51:10 +01:00
|
|
|
|
2021-05-18 14:56:12 +02:00
|
|
|
# i945-pwm build dependencies
|
|
|
|
# ------------------------------------------------------------
|
|
|
|
|
2023-12-09 02:39:53 +01:00
|
|
|
install_packages build-essential perl
|
2021-05-18 14:56:12 +02:00
|
|
|
|
|
|
|
# Coreboot build dependencies (also requires build-essential and git)
|
|
|
|
# ------------------------------------------------------------
|
|
|
|
|
2023-12-08 03:33:56 +01:00
|
|
|
install_packages libncurses5-dev doxygen acpica-tools gdb flex bison build-essential git libssl-dev gnat
|
2021-05-18 14:56:12 +02:00
|
|
|
|
|
|
|
# GRUB build dependencies (also requires build-essential, bison and flex)
|
|
|
|
# ------------------------------------------------------------
|
|
|
|
|
2024-11-29 20:14:15 +01:00
|
|
|
# Trisquel 10 (nabia) doesn't have fonts-unifont. Also for the check
|
|
|
|
# we can assume that the 'nabia' code name is unique as it is in the
|
|
|
|
# upstream debootstrap in /usr/share/debootstrap/scripts/nabia.
|
|
|
|
if ! grep -q 'VERSION_CODENAME="nabia"' /etc/os-release ; then
|
|
|
|
install_packages fonts-unifont
|
|
|
|
fi
|
|
|
|
|
2024-11-29 20:14:22 +01:00
|
|
|
install_packages libopts25 libselinux1-dev autogen m4 autoconf help2man libopts25-dev libfont-freetype-perl automake autotools-dev build-essential bison flex libfuse-dev liblzma-dev gawk libdevmapper-dev libtool libtool-bin libfreetype6-dev unifont
|
2021-05-18 14:56:12 +02:00
|
|
|
|
|
|
|
# BucTS build dependencies (external script)
|
|
|
|
# ------------------------------------------------------------
|
|
|
|
|
2023-12-09 02:39:53 +01:00
|
|
|
install_packages build-essential
|
2021-05-18 14:56:12 +02:00
|
|
|
|
|
|
|
# Flashrom build dependencies (also requires build-essential)
|
|
|
|
# ------------------------------------------------------------
|
|
|
|
|
2024-11-29 20:14:22 +01:00
|
|
|
install_packages libpci-dev pciutils zlib1g-dev libftdi-dev build-essential libusb-1.0-0 libusb-1.0-0-dev libusb-dev
|
2021-05-18 14:56:12 +02:00
|
|
|
|
|
|
|
# For cross-compiling i686 target on x86_64 host.
|
2023-12-09 02:39:53 +01:00
|
|
|
[ "${arch}" -eq 0 ] && install_packages lib32z1-dev
|
2023-11-28 18:21:56 +01:00
|
|
|
|
|
|
|
# For running make check
|
|
|
|
# ----------------------
|
2023-12-09 02:39:53 +01:00
|
|
|
install_packages shellcheck # lint
|
|
|
|
install_packages gawk git grep lzip make sed tar xz-utils # u-boot-libre
|
2023-12-09 17:23:35 +01:00
|
|
|
|
|
|
|
# For building the website tarball
|
2024-11-22 15:01:29 +01:00
|
|
|
install_packages \
|
2024-11-29 20:14:23 +01:00
|
|
|
graphicsmagick \
|
|
|
|
graphviz \
|
2024-11-29 20:14:24 +01:00
|
|
|
pandoc \
|
2024-11-29 20:14:25 +01:00
|
|
|
texinfo \
|
2024-11-29 20:14:26 +01:00
|
|
|
texlive \
|
|
|
|
texlive-plain-generic
|
2024-11-29 20:14:19 +01:00
|
|
|
|
|
|
|
if [ -n "${to_install}" ] ; then
|
|
|
|
apt install -y ${to_install}
|
|
|
|
fi
|