- bootstrap_termux.sh installs pkg-config/binutils, builds with make, runs the tests and installs into Termux's $PREFIX/bin. - Makefile drops -lpthread on Android (pthreads are in bionic libc). - TUI assumes UTF-8 on Android: nl_langinfo needs API 26, Termux targets 24. All sources compile for aarch64-linux-android24 (NDK 27).
27 lines
742 B
Bash
Executable File
27 lines
742 B
Bash
Executable File
#!/data/data/com.termux/files/usr/bin/bash
|
|
# One-shot: clone, build and install CST-Agent on Android Termux.
|
|
set -euo pipefail
|
|
|
|
REPO_URL="${CST_AGENT_REPO:-https://git.whcself.xyz/WHC/CST-agent.git}"
|
|
DIR="${1:-CST-agent}"
|
|
|
|
echo "==> Termux packages"
|
|
pkg install -y git clang make pkg-config binutils libcurl ncurses
|
|
|
|
if [[ ! -f "$DIR/Makefile" ]]; then
|
|
echo "==> git clone $REPO_URL -> $DIR"
|
|
git clone "$REPO_URL" "$DIR"
|
|
fi
|
|
cd "$DIR"
|
|
|
|
echo "==> build"
|
|
make -j"$(nproc 2>/dev/null || echo 4)"
|
|
make check || echo "warning: some tests failed (see above)"
|
|
|
|
echo "==> install to $PREFIX/bin"
|
|
make install
|
|
|
|
echo
|
|
echo "OK: run 'cst-agent' inside a project directory."
|
|
echo "The first start asks for the provider and its API key and saves them."
|