diff mbox series

[1/4] package/goc: new virtual package

Message ID 20221017151726.44005-2-thomas.perale@mind.be
State Superseded
Headers show
Series Add support for using a pre-compiled Go compiler | expand

Commit Message

Thomas Perale Oct. 17, 2022, 3:17 p.m. UTC
This virtual package implement the already existing go compiler compiled
from source and shows it on the host package menu.

The usage of a virtual package on top of the go compiler enable the
supports of for multiple providers for the Go compiler.
Similarly to the rust compiler, a pre-built go compiler package will be
available in parallel to the current compiled go compiler package.

Signed-off-by: Thomas Perale <thomas.perale@mind.be>
---
 package/Config.in.host     |  1 +
 package/go/go.mk           |  2 ++
 package/goc/Config.in.host | 15 +++++++++++++++
 package/goc/goc.mk         |  7 +++++++
 4 files changed, 25 insertions(+)
 create mode 100644 package/goc/Config.in.host
 create mode 100644 package/goc/goc.mk
diff mbox series

Patch

diff --git a/package/Config.in.host b/package/Config.in.host
index f437ef680c..8c44ff0cb4 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -38,6 +38,7 @@  menu "Host utilities"
 	source "package/gnupg/Config.in.host"
 	source "package/go/Config.in.host"
 	source "package/go-bootstrap/Config.in.host"
+	source "package/goc/Config.in.host"
 	source "package/google-breakpad/Config.in.host"
 	source "package/gptfdisk/Config.in.host"
 	source "package/imagemagick/Config.in.host"
diff --git a/package/go/go.mk b/package/go/go.mk
index 9f0fbbde00..96c756cb11 100644
--- a/package/go/go.mk
+++ b/package/go/go.mk
@@ -12,6 +12,8 @@  GO_LICENSE = BSD-3-Clause
 GO_LICENSE_FILES = LICENSE
 GO_CPE_ID_VENDOR = golang
 
+HOST_GO_PROVIDES = host-goc
+
 HOST_GO_DEPENDENCIES = host-go-bootstrap
 HOST_GO_GOPATH = $(HOST_DIR)/share/go-path
 HOST_GO_HOST_CACHE = $(HOST_DIR)/share/host-go-cache
diff --git a/package/goc/Config.in.host b/package/goc/Config.in.host
new file mode 100644
index 0000000000..b0266b50ea
--- /dev/null
+++ b/package/goc/Config.in.host
@@ -0,0 +1,15 @@ 
+config BR2_PACKAGE_HOST_GOC
+	bool "host go compiler"
+	depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_ARCH_SUPPORTS
+	help
+	  Compiler for the Go language
+
+	  https://go.dev
+
+if BR2_PACKAGE_HOST_GOC
+
+config BR2_PACKAGE_PROVIDES_HOST_GOC
+	string
+	default "host-go"
+
+endif
diff --git a/package/goc/goc.mk b/package/goc/goc.mk
new file mode 100644
index 0000000000..3259618989
--- /dev/null
+++ b/package/goc/goc.mk
@@ -0,0 +1,7 @@ 
+################################################################################
+#
+# goc
+#
+################################################################################
+
+$(eval $(host-virtual-package))