Hax4us/TermuxAlpine

Support for Termux API

mikeslattery opened this issue · 0 comments

Include script to install termux-api in the alpine environment.

One way to do this is supply an optional script, install-termux-api:

#!/bin/sh
set -eu
apk info 2>/dev/null > apk-before.txt

apk -q add git gcc make libc-dev
ln -sfn /bin/sh /usr/bin/sh
git clone -q --depth 1 https://github.com/termux/termux-api-package.git
cd termux-api-package
sed -i 's/arc4random/rand/g' termux-api.c
sed -i 's|PREFIX ?= .*$|PREFIX = /usr|' Makefile
make --silent install
cd ..

# Clean up.   Remove repo and packages that weren't previously installed.
apk info | grep -vxf apk-before.txt | xargs -r apk -q del
apk cache --purge || true
rm -rf termux-api-package apk-before.txt

This builds on Alpine x86, but is untested in TermuxAlpine.