Skip to content

Commit 19baca8

Browse files
authored
Merge branch 'robertkirkman:main' into main
2 parents 401879a + 57af0f8 commit 19baca8

File tree

6 files changed

+49
-12
lines changed

6 files changed

+49
-12
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,25 @@
22

33
This script builds a [termux/termux-app](https://github.com/termux/termux-app) or [termux-play-store/termux-apps/termux-app](https://github.com/termux-play-store/termux-apps/tree/main/termux-app) from source, but allows changing the package name from `com.termux` to anything else with a single command.
44

5+
## Building Termux in GitHub Actions
6+
7+
1. Fork the repository:
8+
9+
<img width="189" height="43" alt="image" src="https://github.com/user-attachments/assets/7aa63b58-b8d5-4b30-957b-fd041bee003d" />
10+
11+
2. Click the "Actions" tab and enable GitHub Actions:
12+
13+
<img width="953" height="407" alt="image" src="https://github.com/user-attachments/assets/76561301-61bd-4f58-8511-38d4486e26ac" />
14+
15+
3. Click the "Generate Termux application" workflow, then click the "Run workflow" button and type your desired settings:
16+
17+
<img width="450" height="810" alt="image" src="https://github.com/user-attachments/assets/7b914a69-7654-4150-8e68-4086a10ba3fd" />
18+
19+
4. Click the "Run workflow" button, then wait for your build to complete. If the build is successful, there will be an artifact available to download containing all possible Termux APKs for the combination of settings you selected:
20+
21+
<img width="1148" height="250" alt="image" src="https://github.com/user-attachments/assets/7bbc8338-1c9e-4a34-966f-87a65cadc471" />
22+
23+
524
## Building Termux locally
625

726
### Dependencies

build-termux.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ TERMUX_APP__PACKAGE_NAME="com.termux"
99
TERMUX_APP_TYPE="f-droid"
1010
DO_NOT_CLEAN=""
1111
TERMUX_GENERATOR_PLUGIN=""
12-
ADDITIONAL_PACKAGES=""
12+
ADDITIONAL_PACKAGES="xkeyboard-config" # for termux-x11-nightly which is always preinstalled
1313
BOOTSTRAP_ARCHITECTURES=""
1414
DISABLE_BOOTSTRAP_SECOND_STAGE=""
1515
ENABLE_SSH_SERVER=""
@@ -63,7 +63,7 @@ while (($# > 0)); do
6363
;;
6464
-a|--add)
6565
if [ $# -gt 1 ] && [ -n "$2" ] && [[ $2 != -* ]]; then
66-
ADDITIONAL_PACKAGES="$2"
66+
ADDITIONAL_PACKAGES+=",$2"
6767
shift 1
6868
else
6969
echo "[!] Option '--add' requires an argument."

f-droid-patches/bootstrap-patches/build-bootstraps.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
+pull_package() {
3939
+ local package_name=$1
4040
+
41-
+ if grep -q "Package: $package_name" "${BOOTSTRAP_ROOTFS}/${TERMUX_PREFIX}/var/lib/dpkg/status"; then
41+
+ if grep -q "Package: $package_name$" "${BOOTSTRAP_ROOTFS}/${TERMUX_PREFIX}/var/lib/dpkg/status"; then
4242
+ echo "[*] Skipping already extracted package '$package_name'..."
4343
+ return
4444
+ fi
@@ -298,7 +298,7 @@
298298

299299
# Extract all debs.
300300
- extract_debs "$TERMUX_ARCH" || return $?
301-
+ for pull_pkg in "${PACKAGES[@]}"; do
301+
+ for pull_pkg in "${PACKAGES[@]}" termux-x11-nightly; do
302302
+ pull_package "$pull_pkg"
303303
+ done
304304
+ unset pull_pkg
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/packages/libgts/build.sh b/packages/libgts/build.sh
2+
index 532f0d5..f263c56 100644
3+
--- a/packages/libgts/build.sh
4+
+++ b/packages/libgts/build.sh
5+
@@ -15,3 +15,10 @@ termux_step_host_build() {
6+
$TERMUX_PKG_SRCDIR/configure
7+
make -C src predicates_init
8+
}
9+
+
10+
+# prevents error
11+
+# /bin/bash: line 1: ./predicates_init: cannot execute binary file: Exec format error
12+
+# during repeated builds
13+
+termux_step_pre_configure() {
14+
+ rm -rf $TERMUX_HOSTBUILD_MARKER
15+
+}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
--- a/packages/opengl/build.sh
2+
+++ b/packages/opengl/build.sh
3+
@@ -6,6 +6,5 @@ TERMUX_PKG_VERSION=4.5
4+
TERMUX_PKG_AUTO_UPDATE=false
5+
TERMUX_PKG_SKIP_SRC_EXTRACT=true
6+
TERMUX_PKG_DEPENDS="libglvnd, mesa"
7+
-TERMUX_PKG_ANTI_BUILD_DEPENDS="mesa"
8+
TERMUX_PKG_METAPACKAGE=true
9+
TERMUX_PKG_PLATFORM_INDEPENDENT=true

scripts/termux_generator_steps.sh

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,10 @@ build_bootstraps() {
168168
local bootstrap_script_args=""
169169

170170
if [ -n "$ENABLE_SSH_SERVER" ]; then
171-
if [ -n "$ADDITIONAL_PACKAGES" ]; then
172-
ADDITIONAL_PACKAGES+=",openssh"
173-
else
174-
ADDITIONAL_PACKAGES="openssh"
175-
fi
171+
ADDITIONAL_PACKAGES+=",openssh"
176172
fi
177173

178-
if [ -n "${ADDITIONAL_PACKAGES}" ]; then
179-
bootstrap_script_args+=" --add ${ADDITIONAL_PACKAGES}"
180-
fi
174+
bootstrap_script_args+=" --add ${ADDITIONAL_PACKAGES}"
181175

182176
if [[ "$TERMUX_APP_TYPE" == "f-droid" ]]; then
183177
local bootstrap_script="build-bootstraps.sh"

0 commit comments

Comments
 (0)