2021-06-03 13:47:08 +02:00
|
|
|
#!/usr/bin/env bash
|
2021-05-18 14:56:12 +02:00
|
|
|
|
2024-09-23 16:43:08 +02:00
|
|
|
# trisquel script: installs build dependencies for Trisquel 9 and 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>
|
|
|
|
# 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
|
|
|
|
|
2023-12-09 02:39:53 +01:00
|
|
|
install_packages()
|
|
|
|
{
|
|
|
|
to_install=""
|
|
|
|
|
2024-09-23 16:43:06 +02:00
|
|
|
# Users might run Trisquel in various languages, and it is easier to
|
|
|
|
# grep for 'Installed' in the language being used than properly setup
|
|
|
|
# everything to use the right locale for the given situation.
|
2024-11-22 15:01:27 +01:00
|
|
|
installed="$(pkcon resolve packagekit-tools | tail -n1 | awk '{print $1}')"
|
2024-09-23 16:43:06 +02:00
|
|
|
|
2023-12-09 02:39:53 +01:00
|
|
|
for package in $@ ; do
|
2024-09-23 16:43:06 +02:00
|
|
|
if pkcon resolve ${package} | grep "^${installed}" 2>&1>/dev/null ; then
|
2023-12-09 02:39:53 +01:00
|
|
|
continue
|
|
|
|
else
|
|
|
|
to_install="${to_install} ${package}"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ -n "${to_install}" ] ; then
|
|
|
|
pkcon -y --allow-reinstall install ${to_install}
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
|
2023-12-01 18:06:18 +01:00
|
|
|
apt-get -y install packagekit-tools
|
|
|
|
|
2021-05-18 14:56:12 +02:00
|
|
|
# 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-22 15:01:28 +01:00
|
|
|
install_packages fonts-unifont 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 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)
|
|
|
|
# ------------------------------------------------------------
|
|
|
|
|
2023-12-08 03:33:56 +01:00
|
|
|
install_packages libpci-dev pciutils zlib1g-dev libftdi-dev build-essential libusb-1.0-0-dev 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-09-23 16:43:07 +02:00
|
|
|
install_packages pandoc
|