From 03549d651ad0df4daace422fb94b353a5aad14fd Mon Sep 17 00:00:00 2001 From: Rex Ackermann <61972253+RexAckermann@users.noreply.github.com> Date: Thu, 18 May 2023 15:50:27 +0600 Subject: [PATCH] build: Add termux support sets the OPT_PREFIX to /data/data/com.termux/files/usr if termux is detected. --- build.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/build.sh b/build.sh index 4c09dd3..ea03188 100755 --- a/build.sh +++ b/build.sh @@ -523,6 +523,18 @@ BUILD_FILTER=() DOCS_URL="https://github.com/eth-p/bat-extras/blob/master/doc" DOCS_MAINTAINER="eth-p " +# ----------------------------------------------------------------------------- +# Use a different default prefix when running on Termux. + +if [[ "$(uname -o)" = "Android" ]] && [[ -n "${TERMUX_VERSION:-}" ]]; then + OPT_PREFIX="/data/data/com.termux/files/usr/" +else + OPT_PREFIX="/usr/local" +fi + +# ----------------------------------------------------------------------------- +# Parse arguments. + while shiftopt; do # shellcheck disable=SC2034 case "$OPT" in