From 835f45a30d973ab5004cc700780580bbd985baf3 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Sat, 15 Jun 2024 17:17:32 +0200 Subject: [PATCH] termux-app: Setup the TERMUX_VERSION env variable --- termux-app/build.gradle.kts | 6 +++++- .../src/main/java/com/termux/app/TermuxShellUtils.java | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/termux-app/build.gradle.kts b/termux-app/build.gradle.kts index 3349de8c..6ee74e07 100644 --- a/termux-app/build.gradle.kts +++ b/termux-app/build.gradle.kts @@ -66,6 +66,10 @@ android { } } + buildFeatures { + buildConfig = true + } + compileOptions { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 @@ -161,7 +165,7 @@ task("downloadPrebuilt") { downloadFile("src/main/cpp/bootstrap-aarch64.zip", "https://bootstrap.termux.net/bootstrap-aarch64-v$bootstrapVersion.zip", "1829d0a082aaadddd6bb67be56b07a71a3414928982abf0f32898e18323700a7") downloadFile("src/main/cpp/bootstrap-x86_64.zip", "https://bootstrap.termux.net/bootstrap-x86_64-v$bootstrapVersion.zip", "fd899704f6b8351fefd477d89f8c6ef3163ef2572d7cfdf29b85fb3f0e497fa5") - val prootVersion = "5.1.107-65"; + val prootVersion = "5.1.107-65" downloadFile("src/main/jniLibs/arm64-v8a/libproot-loader.so", "https://bootstrap.termux.net/libproot-loader-aarch64-$prootVersion.so", "23cbee2320ed6f55ec4c47d50573a3ee59163f84c6e1bfaf7fb67049f71a2b59") downloadFile("src/main/jniLibs/x86_64/libproot-loader.so", "https://bootstrap.termux.net/libproot-loader-x86_64-$prootVersion.so", "bf69995d5c9d35591197ce61f6046e80116858334109bf9b6ea9d787ca2fe256") downloadFile("src/main/jniLibs/arm64-v8a/libproot-loader32.so", "https://bootstrap.termux.net/libproot-loader32-aarch64-$prootVersion.so", "8e0d7fbdc5937886c272a3ef7c2c1d1b62ab51dcfc542b938675bf05baf4a83a") diff --git a/termux-app/src/main/java/com/termux/app/TermuxShellUtils.java b/termux-app/src/main/java/com/termux/app/TermuxShellUtils.java index 165d2832..6a135ab4 100644 --- a/termux-app/src/main/java/com/termux/app/TermuxShellUtils.java +++ b/termux-app/src/main/java/com/termux/app/TermuxShellUtils.java @@ -5,6 +5,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import com.termux.BuildConfig; import com.termux.terminal.TerminalSession; import com.termux.terminal.TerminalSessionClient; @@ -106,6 +107,7 @@ public static String[] setupEnvironment(boolean failsafe) { environment.put("COLORTERM", "truecolor"); environment.put("PREFIX", TermuxConstants.PREFIX_PATH); environment.put("TERM", "xterm-256color"); + environment.put("TERMUX_VERSION", BuildConfig.VERSION_NAME); putToEnvIfInSystemEnv(environment, "ANDROID_ART_ROOT"); putToEnvIfInSystemEnv(environment, "ANDROID_ASSETS"); putToEnvIfInSystemEnv(environment, "ANDROID_DATA");