Building tea CLI for Termux

Overview

This documents the process of building the tea CLI (official Gitea CLI tool) as a Termux package for aarch64 Android devices.

Prerequisites

Phase 1 -- Local Build

1. Clone termux-packages

git clone https://github.com/termux/termux-packages

2. Create package directory and build.sh

File: packages/tea/build.sh

Key fields:

Field Value
TERMUX_PKG_VERSION 0.14.0
TERMUX_PKG_SRCURL https://gitea.com/gitea/tea/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256 f509de217ac0e57491ffdab2750516e8c505780881529ee703b9d0c86cc652a3
TERMUX_PKG_LICENSE MIT
TERMUX_PKG_BUILD_DEPENDS golang
TERMUX_PKG_BUILD_IN_SRC true

Critical notes:

3. Build via Docker

cd termux-packages
bash scripts/run-docker.sh
# Inside container:
./build-package.sh -f -I tea

The -f flag forces rebuild, -I downloads dependencies from Termux repos instead of building them locally.

4. Result

Phase 2 -- Contribute Upstream

Submitting to termux-packages

  1. Fork https://github.com/termux/termux-packages
  2. Add packages/tea/build.sh to your fork
  3. Create PR with commit message: addpkg(main/tea): add tea CLI for Gitea servers

Packaging Policy Compliance

Known Issues Encountered

  1. Empty TERMUX_PKG_DEPENDS -- Setting TERMUX_PKG_DEPENDS= causes parse error: "depends on non-existing package". Fix: omit the line entirely.
  2. NDK not installed -- Local build fails without Android NDK. Fix: use Docker builder image instead.
  3. SSH sudo -- run-docker.sh requires TERMUX_DOCKER_USE_SUDO=1 unless user has sorted sudo permissions.

Build Time

Approximately 5-15 minutes for first build (downloading Go toolchain, fetching all Go module dependencies, cross-compilation). Subsequent builds are faster due to caching.


Revision #3
Created 10 May 2026 20:08:08 by Clive
Updated 10 May 2026 20:14:59 by James