minecraft-pi-docker/scripts/install-dependencies.sh

122 lines
2.8 KiB
Bash
Raw Normal View History

2021-06-17 21:32:24 +00:00
#!/bin/sh
set -e
# This Script Assumes An x86_64 Host
if [ "$(uname -m)" != "x86_64" ]; then
echo 'Invalid Build Architecture'
exit 1
fi
# Add ARM Repository
if [ ! -z "${ARM_PACKAGES_SUPPORTED}" ]; then
sudo dpkg --add-architecture armhf
2021-06-24 16:40:34 +00:00
sudo dpkg --add-architecture arm64
2021-06-17 21:32:24 +00:00
fi
# Update APT
sudo apt-get update
sudo apt-get dist-upgrade -y
2022-03-09 23:47:31 +00:00
# Install Everything In One Go
PKG_QUEUE=''
queue_pkg() {
PKG_QUEUE="${PKG_QUEUE} $@"
}
2022-03-10 02:23:41 +00:00
# Build Tools
2022-03-09 23:47:31 +00:00
queue_pkg \
2021-06-17 21:32:24 +00:00
git \
cmake \
2022-03-07 01:13:41 +00:00
ninja-build \
2021-06-17 21:32:24 +00:00
crossbuild-essential-armhf \
2021-11-12 03:27:10 +00:00
gcc g++ \
2022-03-10 02:23:41 +00:00
nodejs
# Dependencies
queue_pkg \
libfreeimage3 libfreeimage-dev \
2021-09-12 03:18:12 +00:00
libopenal-dev \
2022-03-25 02:47:34 +00:00
qemu-user \
patchelf
2021-06-17 21:32:24 +00:00
2022-03-10 02:23:41 +00:00
# GLFW Dependencies
queue_pkg \
libwayland-dev \
libxkbcommon-dev \
wayland-protocols \
libx11-dev \
libxcursor-dev \
libxi-dev \
libxinerama-dev \
libxrandr-dev \
libxext-dev
2022-03-11 05:00:13 +00:00
# Zenity Dependencies
queue_pkg \
libgtk-3-dev \
libglib2.0-dev
2022-03-10 02:23:41 +00:00
# ARM Packages
2021-06-17 21:32:24 +00:00
if [ ! -z "${ARM_PACKAGES_SUPPORTED}" ]; then
2022-03-10 02:23:41 +00:00
# Build Tools
2022-03-09 23:47:31 +00:00
queue_pkg \
2021-11-12 03:27:10 +00:00
crossbuild-essential-arm64
2022-03-10 02:23:41 +00:00
# Dependencies
queue_pkg \
libfreeimage3:armhf libfreeimage3:arm64 \
libopenal-dev:armhf libopenal-dev:arm64
# GLFW Dependencies
queue_pkg \
libwayland-dev:armhf libwayland-dev:arm64 \
libxkbcommon-dev:armhf libxkbcommon-dev:arm64 \
libx11-dev:armhf libx11-dev:arm64 \
libxcursor-dev:armhf libxcursor-dev:arm64 \
libxi-dev:armhf libxi-dev:arm64 \
libxinerama-dev:armhf libxinerama-dev:arm64 \
libxrandr-dev:armhf libxrandr-dev:arm64 \
libxext-dev:armhf libxext-dev:arm64
2022-03-11 05:00:13 +00:00
# Zenity Dependencies
queue_pkg \
libgtk-3-dev:armhf libgtk-3-dev:arm64 \
libglib2.0-dev:armhf libglib2.0-dev:arm64
2021-06-17 21:32:24 +00:00
fi
2022-03-10 04:29:37 +00:00
# Install appimagetool & appimage-builder Dependencies
2022-03-09 23:47:31 +00:00
queue_pkg \
python3-pip \
python3-setuptools \
2022-03-13 03:52:58 +00:00
python3-wheel \
2022-03-09 23:47:31 +00:00
patchelf \
desktop-file-utils \
libgdk-pixbuf2.0-dev \
fakeroot \
strace \
fuse \
2022-03-10 04:29:37 +00:00
gtk-update-icon-cache \
2022-03-12 01:02:38 +00:00
shared-mime-info \
2022-03-09 23:47:31 +00:00
sed
# Install Queue
sudo apt-get install --no-install-recommends -y ${PKG_QUEUE}
# Download appimagetool
sudo mkdir -p /opt
sudo wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O /opt/appimagetool
2022-03-11 02:05:11 +00:00
sudo chmod +x /opt/appimagetool
2022-03-09 23:47:31 +00:00
# Workaround AppImage Issues With Docker
2022-03-11 02:05:11 +00:00
cd /opt
sudo sed -i '0,/AI\x02/{s|AI\x02|\x00\x00\x00|}' ./appimagetool
sudo rm -rf /opt/squashfs-root /opt/appimagetool.AppDir
sudo ./appimagetool --appimage-extract
sudo rm -f ./appimagetool
2022-03-09 23:47:31 +00:00
sudo mv /opt/squashfs-root /opt/appimagetool.AppDir
2022-03-10 02:23:41 +00:00
sudo rm -f /usr/local/bin/appimagetool
2022-03-09 23:47:31 +00:00
sudo ln -s /opt/appimagetool.AppDir/AppRun /usr/local/bin/appimagetool
# Install appimage-builder
2022-04-15 01:12:42 +00:00
sudo pip3 install 'git+https://github.com/AppImageCrafters/appimage-builder.git'