go-bootstrap.mk 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. ################################################################################
  2. #
  3. # go-bootstrap
  4. #
  5. ################################################################################
  6. GO_BOOTSTRAP_VERSION = 1.4.2
  7. GO_BOOTSTRAP_SITE = https://storage.googleapis.com/golang
  8. GO_BOOTSTRAP_SOURCE = go$(GO_BOOTSTRAP_VERSION).src.tar.gz
  9. GO_BOOTSTRAP_LICENSE = BSD-3c
  10. GO_BOOTSTRAP_LICENSE_FILES = LICENSE
  11. # To build programs that need cgo support the toolchain needs to be
  12. # available, so the toolchain is not needed to build host-go-bootstrap
  13. # itself, but needed by other packages that depend on
  14. # host-go-bootstrap.
  15. HOST_GO_BOOTSTRAP_DEPENDENCIES = toolchain
  16. HOST_GO_BOOTSTRAP_ROOT = $(HOST_DIR)/usr/lib/go-$(GO_BOOTSTRAP_VERSION)
  17. HOST_GO_BOOTSTRAP_MAKE_ENV = \
  18. GOOS=linux \
  19. GOROOT_FINAL="$(HOST_GO_BOOTSTRAP_ROOT)" \
  20. GOROOT="$(@D)" \
  21. GOBIN="$(@D)/bin"
  22. define HOST_GO_BOOTSTRAP_BUILD_CMDS
  23. cd $(@D)/src && $(HOST_GO_BOOTSTRAP_MAKE_ENV) ./make.bash
  24. endef
  25. define HOST_GO_BOOTSTRAP_INSTALL_CMDS
  26. $(INSTALL) -D -m 0755 $(@D)/bin/go $(HOST_GO_BOOTSTRAP_ROOT)/bin/go
  27. $(INSTALL) -D -m 0755 $(@D)/bin/gofmt $(HOST_GO_BOOTSTRAP_ROOT)/bin/gofmt
  28. cp -a $(@D)/lib $(HOST_GO_BOOTSTRAP_ROOT)/
  29. cp -a $(@D)/pkg $(HOST_GO_BOOTSTRAP_ROOT)/
  30. # There is a known issue which requires the go sources to be installed
  31. # https://golang.org/issue/2775
  32. cp -a $(@D)/src $(HOST_GO_BOOTSTRAP_ROOT)/
  33. endef
  34. $(eval $(host-generic-package))