#!/bin/sh set -ex # Automatically install box86/box64 on ARM64 SBCs # Largely based on: # https://github.com/ptitSeb/box86/blob/master/docs/COMPILE.md codedir="${CODEDIR:-$HOME/scm/pub}" box86dir="$codedir/box86" box64dir="$codedir/box64" winedir="$HOME/wine" if false ; then if [ "$(uname -m)" = "aarch64" ] ; then sudo dpkg --add-architecture armhf sudo apt update sudo apt install -y libc6:armhf sudo apt install -y gcc-arm-linux-gnueabihf # sudo apt install libc6-dev-armhf-cross # Might need if you get crt1.o errors fi fi # end if false cmakeflags="" makeopts="" _system="$(cat /sys/firmware/devicetree/base/model)" echo "Found '$_system'..." case $_system in Orange\ Pi\ 5\ Plus) cmakeflags="-DRK3588=1"; makeopts="-j4"; ;; *) echo "Unknown system, please add it"; exit 1; ;; esac if ! [ -d "$box86dir" ] ; then git clone https://github.com/ptitSeb/box86 "$box86dir" fi cd "$box86dir"; mkdir -p build; cd -; cd "$box86dir"/build cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo $cmakeflags make $makeopts sudo make install sudo systemctl restart systemd-binfmt # Now for box64 # https://github.com/ptitSeb/box64/blob/main/docs/COMPILE.md if ! [ -d "$box64dir" ] ; then git clone https://github.com/ptitSeb/box64 "$box64dir" fi cd "$box64dir"; mkdir -p build; cd -; cd "$box64dir"/build cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo $cmakeflags make $makeopts sudo make install sudo systemctl restart systemd-binfmt # Now for wine32 and wine64... # https://github.com/ptitSeb/box86/blob/master/docs/X86WINE.md # https://github.com/ptitSeb/box64/blob/main/docs/X64WINE.md # TODO, finish this part... mkdir -p "$winedir" x86winever="PlayOnLinux-wine-9.0-upstream-linux-x86" x86winedest="$winedir/${x86winever}.tar.gz" if ! [ -e "$x86winedest" ] ; then wget -O "$x86winedest" \ "https://www.playonlinux.com/wine/binaries/phoenicis/upstream-linux-x86/$x86winever.tar.gz" fi if sha256sum "$x86winedest" | grep -q 2c99f45688eeb75a9c28303223edcede700ed2b1 ; then echo "Failed to verify x86 wine package, exiting" exit 1 fi