fix(main/golang): use Termux tmp directory as fallback when TMPDIR is not set

This commit is contained in:
Leonid Pliushch 2023-05-21 19:10:11 +03:00
parent 69ef80da89
commit 3c2a99cc06
No known key found for this signature in database
GPG Key ID: A109C088BB8EA41A
2 changed files with 13 additions and 1 deletions

View File

@ -5,7 +5,7 @@ TERMUX_PKG_MAINTAINER="@termux"
_MAJOR_VERSION=1.20
# Use the ~ deb versioning construct in the future:
TERMUX_PKG_VERSION=3:${_MAJOR_VERSION}.4
TERMUX_PKG_REVISION=1
TERMUX_PKG_REVISION=2
TERMUX_PKG_SRCURL=https://storage.googleapis.com/golang/go${TERMUX_PKG_VERSION#*:}.src.tar.gz
TERMUX_PKG_SHA256=9f34ace128764b7a3a4b238b805856cc1b2184304df9e5690825b0710f4202d6
TERMUX_PKG_DEPENDS="clang"

View File

@ -0,0 +1,12 @@
diff -uNr go/src/os/file_unix.go go.mod/src/os/file_unix.go
--- go/src/os/file_unix.go 2023-04-26 18:32:02.000000000 +0300
+++ go.mod/src/os/file_unix.go 2023-05-21 19:08:51.516090953 +0300
@@ -339,7 +339,7 @@
dir := Getenv("TMPDIR")
if dir == "" {
if runtime.GOOS == "android" {
- dir = "/data/local/tmp"
+ dir = "@TERMUX_PREFIX@/tmp"
} else {
dir = "/tmp"
}