2023-08-31 08:11:59 +00:00
|
|
|
#!/bin/bash
|
2024-04-21 20:31:32 +00:00
|
|
|
# This script is installing the required dependencies to correctly run the pipeline and build the flatpak
|
|
|
|
|
2024-04-21 21:49:16 +00:00
|
|
|
unset pkg_mgr
|
2024-04-21 20:41:19 +00:00
|
|
|
|
2024-04-21 20:31:32 +00:00
|
|
|
# rpm-ostree must be checked before dnf because a dnf (wrapper) command also works on rpm-ostree distros (not what we want)
|
2024-04-21 21:49:16 +00:00
|
|
|
for potential_pkg_mgr in apt pacman rpm-ostree dnf; do
|
|
|
|
command -v "$potential_pkg_mgr" &> /dev/null && pkg_mgr="$potential_pkg_mgr" && break
|
2024-04-21 20:31:32 +00:00
|
|
|
done
|
|
|
|
|
2024-04-21 21:49:16 +00:00
|
|
|
case "$pkg_mgr" in
|
2024-04-21 20:31:32 +00:00
|
|
|
apt)
|
2024-05-23 13:21:09 +00:00
|
|
|
sudo apt update
|
2024-04-21 20:31:32 +00:00
|
|
|
sudo apt install -y flatpak flatpak-builder p7zip-full xmlstarlet bzip2 curl jq
|
|
|
|
;;
|
|
|
|
pacman)
|
|
|
|
sudo pacman -S --noconfirm flatpak flatpak-builder p7zip xmlstarlet bzip2
|
|
|
|
;;
|
|
|
|
rpm-ostree)
|
|
|
|
echo "When using a distro with rpm-ostree, you shouldn't build directly on the host. Try using a distrobox."
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
dnf)
|
|
|
|
sudo dnf install -y flatpak flatpak-builder p7zip p7zip-plugins xmlstarlet bzip2 curl
|
|
|
|
;;
|
|
|
|
*)
|
2024-04-21 21:49:16 +00:00
|
|
|
echo "Package manager $pkg_mgr not supported. Please open an issue."
|
2024-04-21 20:31:32 +00:00
|
|
|
;;
|
|
|
|
esac
|
2023-08-31 08:32:51 +00:00
|
|
|
|
2024-02-05 14:03:25 +00:00
|
|
|
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
2024-04-21 20:31:32 +00:00
|
|
|
flatpak remote-add --user --if-not-exists flathub-beta https://flathub.org/beta-repo/flathub-beta.flatpakrepo
|