diff --git a/packages/golang/build.sh b/packages/golang/build.sh index 4cbea00895..2a4a5b9610 100644 --- a/packages/golang/build.sh +++ b/packages/golang/build.sh @@ -2,11 +2,11 @@ TERMUX_PKG_HOMEPAGE=https://golang.org/ TERMUX_PKG_DESCRIPTION="Go programming language compiler" TERMUX_PKG_LICENSE="BSD 3-Clause" TERMUX_PKG_MAINTAINER="@termux" -_MAJOR_VERSION=1.18.3 +_MAJOR_VERSION=1.19 # Use the ~ deb versioning construct in the future: TERMUX_PKG_VERSION=3:${_MAJOR_VERSION} TERMUX_PKG_SRCURL=https://storage.googleapis.com/golang/go${_MAJOR_VERSION}.src.tar.gz -TERMUX_PKG_SHA256=0012386ddcbb5f3350e407c679923811dbd283fcdc421724931614a842ecbc2d +TERMUX_PKG_SHA256=9419cc70dc5a2523f29a77053cafff658ed21ef3561d9b6b020280ebceab28b9 TERMUX_PKG_DEPENDS="clang" TERMUX_PKG_NO_STATICSPLIT=true diff --git a/packages/golang/fix-hardcoded-etc-resolv-conf.diff b/packages/golang/fix-hardcoded-etc-resolv-conf.diff index 35df2c1d3d..badd14ed3c 100644 --- a/packages/golang/fix-hardcoded-etc-resolv-conf.diff +++ b/packages/golang/fix-hardcoded-etc-resolv-conf.diff @@ -3,40 +3,42 @@ @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. - --//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris -+//go:build aix || darwin || dragonfly || freebsd || (linux && !android) || netbsd || openbsd || solaris - + +-//go:build !js ++//go:build !js && !android + package net - + --- a/src/net/conf_android.go +++ b/src/net/conf_android.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. - --//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris + +-//go:build !js +//go:build android - + package net - -@@ -95,10 +95,10 @@ + +--- a/src/net/conf_android.go ++++ b/src/net/conf_android.go +@@ -113,10 +113,10 @@ func initConfVal() { } - + if runtime.GOOS != "openbsd" { - confVal.nss = parseNSSConfFile("/etc/nsswitch.conf") + confVal.nss = parseNSSConfFile("@TERMUX_PREFIX@/etc/nsswitch.conf") } - + - confVal.resolv = dnsReadConfig("/etc/resolv.conf") + confVal.resolv = dnsReadConfig("@TERMUX_PREFIX@/etc/resolv.conf") if confVal.resolv.err != nil && !os.IsNotExist(confVal.resolv.err) && !os.IsPermission(confVal.resolv.err) { // If we can't read the resolv.conf file, assume it -@@ -108,7 +108,7 @@ +@@ -126,7 +126,7 @@ func initConfVal() { confVal.forceCgoLookupHost = true } - + - if _, err := os.Stat("/etc/mdns.allow"); err == nil { + if _, err := os.Stat("@TERMUX_PREFIX@/etc/mdns.allow"); err == nil { confVal.hasMDNSAllow = true @@ -47,10 +49,10 @@ @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. - --//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris -+//go:build aix || darwin || dragonfly || freebsd || (linux && !android) || netbsd || openbsd || solaris - + +-//go:build !js ++//go:build !js && !android + // DNS client: see RFC 1035. // Has to be linked into package net for Dial. --- a/src/net/dnsclient_android.go @@ -58,13 +60,15 @@ @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. - --//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris + +-//go:build !js +//go:build android - + // DNS client: see RFC 1035. // Has to be linked into package net for Dial. -@@ -338,7 +338,7 @@ +--- a/src/net/dnsclient_android.go ++++ b/src/net/dnsclient_android.go +@@ -355,7 +355,7 @@ func (conf *resolverConfig) init() { // resolv.conf twice the first time. conf.dnsConfig = systemConf().resolv if conf.dnsConfig == nil { @@ -72,8 +76,8 @@ + conf.dnsConfig = dnsReadConfig("@TERMUX_PREFIX@/etc/resolv.conf") } conf.lastChecked = time.Now() - -@@ -401,7 +401,7 @@ + +@@ -427,7 +427,7 @@ func (r *Resolver) lookup(ctx context.Context, name string, qtype dnsmessage.Typ // For consistency with libc resolvers, report no such host. return dnsmessage.Parser{}, "", &DNSError{Err: errNoSuchHost.Error(), Name: name, IsNotFound: true} } @@ -82,7 +86,7 @@ resolvConf.mu.RLock() conf := resolvConf.dnsConfig resolvConf.mu.RUnlock() -@@ -578,7 +578,7 @@ +@@ -604,7 +604,7 @@ func (r *Resolver) goLookupIPCNAMEOrder(ctx context.Context, network, name strin // See comment in func lookup above about use of errNoSuchHost. return nil, dnsmessage.Name{}, &DNSError{Err: errNoSuchHost.Error(), Name: name, IsNotFound: true} } diff --git a/scripts/build/setup/termux_setup_golang.sh b/scripts/build/setup/termux_setup_golang.sh index ad1fa59e9c..fd8467934a 100644 --- a/scripts/build/setup/termux_setup_golang.sh +++ b/scripts/build/setup/termux_setup_golang.sh @@ -1,7 +1,7 @@ # Utility function for golang-using packages to setup a go toolchain. termux_setup_golang() { if [ "$TERMUX_ON_DEVICE_BUILD" = "false" ]; then - local TERMUX_GO_VERSION=go1.18.3 + local TERMUX_GO_VERSION=go1.19 local TERMUX_GO_PLATFORM=linux-amd64 local TERMUX_BUILDGO_FOLDER @@ -20,7 +20,7 @@ termux_setup_golang() { rm -Rf "$TERMUX_COMMON_CACHEDIR/go" "$TERMUX_BUILDGO_FOLDER" termux_download https://golang.org/dl/${TERMUX_GO_VERSION}.${TERMUX_GO_PLATFORM}.tar.gz \ "$TERMUX_BUILDGO_TAR" \ - 956f8507b302ab0bb747613695cdae10af99bbd39a90cae522b7c0302cc27245 + 464b6b66591f6cf055bc5df90a9750bf5fbc9d038722bb84a9d56a2bea974be6 ( cd "$TERMUX_COMMON_CACHEDIR"; tar xf "$TERMUX_BUILDGO_TAR"; mv go "$TERMUX_BUILDGO_FOLDER"; rm "$TERMUX_BUILDGO_TAR" )