go-bootstrap.mk 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. HOST_GO_BOOTSTRAP_ROOT = $(HOST_DIR)/usr/lib/go-$(GO_BOOTSTRAP_VERSION)
  12. HOST_GO_BOOTSTRAP_MAKE_ENV = \
  13. GOOS=linux \
  14. GOROOT_FINAL="$(HOST_GO_BOOTSTRAP_ROOT)" \
  15. GOROOT="$(@D)" \
  16. GOBIN="$(@D)/bin"
  17. define HOST_GO_BOOTSTRAP_BUILD_CMDS
  18. cd $(@D)/src && $(HOST_GO_BOOTSTRAP_MAKE_ENV) ./make.bash
  19. endef
  20. define HOST_GO_BOOTSTRAP_INSTALL_CMDS
  21. $(INSTALL) -D -m 0755 $(@D)/bin/go $(HOST_GO_BOOTSTRAP_ROOT)/bin/go
  22. $(INSTALL) -D -m 0755 $(@D)/bin/gofmt $(HOST_GO_BOOTSTRAP_ROOT)/bin/gofmt
  23. cp -a $(@D)/lib $(HOST_GO_BOOTSTRAP_ROOT)/
  24. cp -a $(@D)/pkg $(HOST_GO_BOOTSTRAP_ROOT)/
  25. # There is a known issue which requires the go sources to be installed
  26. # https://golang.org/issue/2775
  27. cp -a $(@D)/src $(HOST_GO_BOOTSTRAP_ROOT)/
  28. endef
  29. $(eval $(host-generic-package))