joshuar-go-hass-agent/build/scripts/install-build-deps

31 lines
1.0 KiB
Bash
Executable File

#!/usr/bin/env bash
# Copyright (c) 2024 Joshua Rich <joshua.rich@gmail.com>
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
set -e
# set ccpkg and arch as appropriate
case $1 in
linux/amd64) ccpkg=(gcc) arch=(amd64) ;;
linux/arm/*) ccpkg=(gcc gcc-arm-linux-gnueabihf) arch=(armhf) ;;
linux/arm64) ccpkg=(gcc gcc-aarch64-linux-gnu) arch=(arm64) ;;
all) ccpkg=(gcc gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu) arch=(armhf arm64 amd64) ;;
*) echo "No arch specified" && exit -1 ;;
esac
export DEBIAN_FRONTEND=noninteractive
# install build dependencies as per given arch
apt-get update
apt-get -y install desktop-file-utils pkg-config git ${ccpkg[@]:0}
for a in "${arch[@]}"; do
apt-get -y install \
libgl-dev:${a} libglx-dev:${a} libglvnd-dev:${a} \
libxcb1-dev:${a} libxau-dev:${a} libxdmcp-dev:${a} \
libx11-dev:${a} libxcursor-dev:${a} libxrandr-dev:${a} \
libxinerama-dev:${a} libxi-dev:${a} libxxf86vm-dev:${a}
done