@@ -37,6 +37,7 @@ menu "Host utilities"
source "package/genpart/Config.in.host"
source "package/gnupg/Config.in.host"
source "package/go/Config.in.host"
+ source "package/go-bin/Config.in.host"
source "package/go-bootstrap/Config.in.host"
source "package/goc/Config.in.host"
source "package/google-breakpad/Config.in.host"
new file mode 100644
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_HOST_GO_BIN_HOST_ARCH
+ string
+ default 386 if BR2_HOSTARCH = "x86"
+ default amd64 if BR2_HOSTARCH = "x86_64"
+ default arm64 if BR2_HOSTARCH = "arm"
new file mode 100644
@@ -0,0 +1,4 @@
+# sha256 checksum from https://go.dev/dl/
+sha256 9acc57342400c5b0c2da07b5b01b50da239dd4a7fad41a1fb56af8363ef4133f go1.19.1.linux-386.tar.gz
+sha256 acc512fbab4f716a8f97a8b3fbaa9ddd39606a28be6c2515ef7c6c6311acffde go1.19.1.linux-amd64.tar.gz
+sha256 49960821948b9c6b14041430890eccee58c76b52e2dbaafce971c3c38d43df9f go1.19.1.linux-arm64.tar.gz
new file mode 100644
@@ -0,0 +1,20 @@
+################################################################################
+#
+# go-bin
+#
+################################################################################
+
+GO_BIN_VERSION = 1.19.1
+GO_BIN_SITE = https://go.dev/dl
+GO_BIN_LICENSE = BSD-3-Clause
+GO_BIN_LICENSE_FILES = LICENSE
+
+HOST_GO_BIN_PROVIDES = host-goc
+
+HOST_GO_BIN_SOURCE = go$(GO_BIN_VERSION).linux-$(call qstrip, $(BR2_PACKAGE_HOST_GO_BIN_HOST_ARCH)).tar.gz
+
+define HOST_GO_BIN_INSTALL_CMDS
+ $(HOST_GO_INSTALL_CMDS)
+endef
+
+$(eval $(host-generic-package))
@@ -8,8 +8,32 @@ config BR2_PACKAGE_HOST_GOC
if BR2_PACKAGE_HOST_GOC
+choice
+ prompt "Go compiler variant"
+ default BR2_PACKAGE_HOST_GO_BIN
+ help
+ Select a Go compiler variant.
+
+ Default to 'host-go-bin'.
+
+config BR2_PACKAGE_HOST_GO
+ bool "host go"
+ depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
+ help
+ This package will build the go compiler for the host.
+
+config BR2_PACKAGE_HOST_GO_BIN
+ bool "host go (pre-built)"
+ help
+ This package will install pre-built versions of the compiler
+ for the host.
+
+endchoice
+
config BR2_PACKAGE_PROVIDES_HOST_GOC
string
- default "host-go"
+ # Default to host-go-bin
+ default "host-go-bin" if BR2_PACKAGE_HOST_GO_BIN
+ default "host-go" if BR2_PACKAGE_HOST_GO
endif
This package provides a pre-built version of the go compiler for the host target. This enable the user to select between the pre-built and the compiled version of the go compiler. The pre-built version will be used by default when a go compiler is required. The virtual package 'goc' creates a menu that let the user select which variant of the go compiler to use. The supported host platform for the pre-built compiler are actually the same as the one for 'go-bootstrap' no further verification are required than the one already in place. For now GO_BIN_VERSION and GO_VERSION are set the same by hand but in next version this variable should be in common. Because the order of the '.mk' file is not guaranteed this will be investigated in a next patch. Signed-off-by: Thomas Perale <thomas.perale@mind.be> --- package/Config.in.host | 1 + package/go-bin/Config.in.host | 5 +++++ package/go-bin/go-bin.hash | 4 ++++ package/go-bin/go-bin.mk | 20 ++++++++++++++++++++ package/goc/Config.in.host | 26 +++++++++++++++++++++++++- 5 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 package/go-bin/Config.in.host create mode 100644 package/go-bin/go-bin.hash create mode 100644 package/go-bin/go-bin.mk