36 lines
1.2 KiB
Bash
Executable File
36 lines
1.2 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 --no-install-recommends desktop-file-utils pkg-config git ${ccpkg[@]:0}
|
|
for a in "${arch[@]}"; do
|
|
apt-get -y install --no-install-recommends \
|
|
libc6-dev:${a} \
|
|
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
|
|
|
|
apt-get -y autoremove && apt-get -y clean && rm -rf /var/lib/apt/lists/*
|
|
|
|
exit 0
|