Repository navigation
Expand file tree
/
Copy pathinstall-linux.sh
More file actions
executable file
·96 lines (86 loc) · 3.12 KB
/
Copy pathinstall-linux.sh
File metadata and controls
executable file
·96 lines (86 loc) · 3.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/usr/bin/env bash
# Install distribution dependencies, build if needed, and install for one user.
set -euo pipefail
root=$(cd -- "$(dirname -- "$0")/.." && pwd)
dry_run=false
if [ "${1:-}" = "--dry-run" ]; then
dry_run=true
elif [ "$#" -ne 0 ]; then
echo "Usage: $0 [--dry-run]" >&2
exit 2
fi
if [ ! -r /etc/os-release ]; then
echo "Cannot detect this Linux distribution; see README.md for manual installation." >&2
exit 1
fi
. /etc/os-release
case "${ID:-}" in
gentoo)
installer=(emerge --ask --noreplace)
packages=(media-video/pipewire media-video/wireplumber media-video/ffmpeg
dev-db/sqlite dev-qt/qtbase dev-qt/qtdeclarative dev-qt/qtsvg)
build_packages=(dev-lang/rust-bin llvm-core/clang dev-util/pkgconf dev-qt/qttools)
;;
arch|endeavouros|manjaro)
installer=(pacman -S --needed)
packages=(pipewire wireplumber ffmpeg sqlite qt6-base qt6-declarative qt6-svg)
build_packages=(base-devel rust clang pkgconf qt6-tools)
;;
ubuntu|pop|linuxmint)
installer=(apt-get install --yes)
packages=(pipewire wireplumber ffmpeg libsqlite3-0 libqt6svg6 qt6-base-dev
qt6-declarative-dev qml6-module-qt-labs-platform qml6-module-qtcore
qml6-module-qtqml-workerscript qml6-module-qtquick
qml6-module-qtquick-controls qml6-module-qtquick-dialogs
qml6-module-qtquick-layouts qml6-module-qtquick-templates
qml6-module-qtquick-window)
build_packages=(build-essential clang libclang-dev pkg-config
libpipewire-0.3-dev libsqlite3-dev qt6-declarative-dev-tools
qt6-tools-dev-tools rustup)
;;
*)
echo "Unsupported distribution '${ID:-unknown}'; see README.md for manual installation." >&2
exit 1
;;
esac
if [ -x "$root/bin/fiwnode-gui" ]; then
source_archive=true
else
source_archive=false
packages+=("${build_packages[@]}")
fi
if [ "$(id -u)" -eq 0 ]; then
elevate=()
elif command -v sudo >/dev/null 2>&1; then
elevate=(sudo)
elif command -v doas >/dev/null 2>&1; then
elevate=(doas)
else
echo "Install dependencies as root, then run scripts/install-user.sh." >&2
exit 1
fi
if "$dry_run"; then
printf 'Distribution: %s\n' "${PRETTY_NAME:-$ID}"
printf 'Package command:'
printf ' %q' "${elevate[@]}" "${installer[@]}" "${packages[@]}"
printf '\n'
if ! "$source_archive"; then
printf 'Then: cargo build --workspace --release --locked\n'
fi
printf 'Then: scripts/install-user.sh\n'
exit 0
fi
"${elevate[@]}" "${installer[@]}" "${packages[@]}"
if ! "$source_archive"; then
if [ "${ID:-}" = ubuntu ] || [ "${ID:-}" = pop ] || [ "${ID:-}" = linuxmint ]; then
# Ubuntu 24.04's rustc package is older than this workspace's MSRV.
rustup default stable
export PATH="$HOME/.cargo/bin:$PATH"
fi
if ! command -v cargo >/dev/null 2>&1; then
echo "Cargo is not on PATH after installing Rust; open a new shell and rerun." >&2
exit 1
fi
(cd "$root" && cargo build --workspace --release --locked)
fi
"$root/scripts/install-user.sh"