mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-04 19:48:56 -05:00
74 lines
1.8 KiB
Plaintext
74 lines
1.8 KiB
Plaintext
autoload -Uz log_error log_status log_info mkcd
|
|
|
|
if (( ! ${+project_root} )) {
|
|
log_error "'project_root' not set. Please set before running ${0}."
|
|
return 2
|
|
}
|
|
|
|
if (( ! ${+target} )) {
|
|
log_error "'target' not set. Please set before running ${0}."
|
|
return 2
|
|
}
|
|
|
|
pushd ${project_root}
|
|
|
|
typeset -g QT_VERSION
|
|
|
|
local -a apt_args=(
|
|
${CI:+-y}
|
|
--no-install-recommends
|
|
)
|
|
if (( _loglevel == 0 )) apt_args+=(--quiet)
|
|
|
|
if (( ! (${skips[(Ie)all]} + ${skips[(Ie)deps]}) )) {
|
|
log_group 'Installing obs-studio build dependencies...'
|
|
|
|
local suffix
|
|
if [[ ${CPUTYPE} != "${target##*-}" ]] {
|
|
local -A arch_mappings=(
|
|
aarch64 arm64
|
|
x86_64 amd64
|
|
)
|
|
|
|
suffix=":${arch_mappings[${target##*-}]}"
|
|
|
|
sudo apt-get install ${apt_args} gcc-${${target##*-}//_/-}-linux-gnu g++-${${target##*-}//_/-}-linux-gnu
|
|
}
|
|
|
|
local dist_version
|
|
read -r dist_version <<< "$(source /etc/os-release; print "${VERSION_ID}")"
|
|
|
|
# The OBS PPA may not yet support newer Ubuntu versions.
|
|
# On those, use the native obs-studio packages and install libobs-dev separately,
|
|
# as it is not bundled in obs-studio itself on newer Ubuntu releases.
|
|
local -a obs_packages=(build-essential libgles2-mesa-dev libsimde-dev obs-studio)
|
|
if is-at-least 26.04 ${dist_version}; then
|
|
obs_packages+=(libobs-dev)
|
|
else
|
|
sudo add-apt-repository --yes ppa:obsproject/obs-studio
|
|
sudo apt update
|
|
fi
|
|
|
|
sudo apt-get install ${apt_args} ${obs_packages}
|
|
|
|
local -a _qt_packages=()
|
|
|
|
if (( QT_VERSION == 5 )) {
|
|
_qt_packages+=(
|
|
qtbase5-dev${suffix}
|
|
libqt5svg5-dev${suffix}
|
|
qtbase5-private-dev${suffix}
|
|
libqt5x11extras5-dev${suffix}
|
|
)
|
|
} else {
|
|
_qt_packages+=(
|
|
qt6-base-dev${suffix}
|
|
libqt6svg6-dev${suffix}
|
|
qt6-base-private-dev${suffix}
|
|
)
|
|
}
|
|
|
|
sudo apt-get install ${apt_args} ${_qt_packages}
|
|
log_group
|
|
}
|