#  Binary SBCL on Android (and Termux too)
vit01 (mira, 1) → vit01  –  14:42:31 2016-07-01

Quick installation of SBCL on Termux and some other Android systems
Does not require root access on your phone (only on PC)

Part 1 (desktop system)

====
# You can find these packages easily for your own distribution
sudo pacman -S qemu-static qemu-arch-extra-static binfmt-qemu-static

mkdir archey
cd archey

wget -c http://ru.mirror.archlinuxarm.org/os/ArchLinuxARM-armv7-latest.tar.gz
tar xvf *.tar.gz

mv ArchLinuxARM-armv7-latest.tar.gz ..

cp /usr/bin/qemu-arm-static ./usr/bin/

# Both pacman and sbcl can't run without locale support
echo "en_US.UTF-8 UTF-8" > ./etc/locale.gen
echo "ru_RU.UTF-8 UTF-8" >> ./etc/locale.gen

# If you haven't got systemd, update binfmt rules for qemu-arm-static some other way instead
sudo systemctl start systemd-binfmt.service

# For correct chroot into arch
git clone https://projects.archlinux.org/arch-install-scripts.git
cd arch-install-scripts
make
cp arch-chroot ..
cd ..

sudo ./arch-chroot . /bin/bash
locale-gen
pacman -S sbcl
exit

cd ..

# Easy way; slow and overheaded, but you'll eventually get full archlinux chroot!
tar cvJf archey.tar.xz archey/

# Complex way; you can save some free space on your storage by doing this
mkdir new-root
cd new-root

mkdir -p ./usr/{lib,bin,share}

cp -r ../archey/usr/lib/sbcl/ ./usr/lib

cp -r ../archey/usr/share/locale ./usr/share/
cp -r ../archey/usr/share/i18n ./usr/share/
cp -r ../archey/usr/bin/sbcl ./usr/bin/
cp -r ../archey/usr/share/sbcl-source/ ./usr/share/

ln -s ./usr/lib .

cp ../archey/usr/lib/ld* ./usr/lib/
cp ../archey/lib/libgcc* ./usr/lib/
cp ../archey/lib/libssl* ./usr/lib/
cp ../archey/lib/libcrypto* ./usr/lib/
cp ../archey/lib/libdl* ./usr/lib/
cp ../archey/lib/libz* ./usr/lib/
cp ../archey/lib/libm* ./usr/lib/
cp ../archey/lib/libc.* ./usr/lib

cd ..
tar cvJf new-root.tar.xz new-root/
====


Part 2 (mobile phone)

Move your archive in Termux's $HOME
Unzip: tar xvf your-archive.tar.xz
Now you have "mini-chroot" to use with proot program to transparently execute sbcl