CATEGORY:=Languages
endef
-define GoPackage/Environment/Default
+define GoPackage/Environment/Target
GOOS=$(GO_OS) \
GOARCH=$(GO_ARCH) \
GO386=$(GO_386) \
GOMIPS=$(GO_MIPS) \
GOMIPS64=$(GO_MIPS64) \
CGO_ENABLED=1 \
+ CC=$(TARGET_CC) \
+ CXX=$(TARGET_CXX) \
CGO_CFLAGS="$(filter-out $(GO_CFLAGS_TO_REMOVE),$(TARGET_CFLAGS))" \
CGO_CPPFLAGS="$(TARGET_CPPFLAGS)" \
- CGO_CXXFLAGS="$(filter-out $(GO_CFLAGS_TO_REMOVE),$(TARGET_CXXFLAGS))"
+ CGO_CXXFLAGS="$(filter-out $(GO_CFLAGS_TO_REMOVE),$(TARGET_CXXFLAGS))" \
+ CGO_LDFLAGS="$(TARGET_LDFLAGS)"
+endef
+
+define GoPackage/Environment/Build
+ GOPATH=$(GO_PKG_BUILD_DIR) \
+ GOCACHE=$(GO_PKG_CACHE_DIR) \
+ GOENV=off
+endef
+
+define GoPackage/Environment/Default
+ $(call GoPackage/Environment/Target) \
+ $(call GoPackage/Environment/Build)
endef
GoPackage/Environment=$(call GoPackage/Environment/Default)
define GoPackage/Build/Compile
( \
cd $(GO_PKG_BUILD_DIR) ; \
- export GOPATH=$(GO_PKG_BUILD_DIR) \
- GOCACHE=$(GO_PKG_CACHE_DIR) \
- GOENV=off \
- GOROOT_FINAL=$(GO_TARGET_ROOT) \
- CC=$(TARGET_CC) \
- CXX=$(TARGET_CXX) \
- $(call GoPackage/Environment) ; \
+ export $(call GoPackage/Environment) ; \
\
echo "Finding targets" ; \
targets=$$$$(go list $(GO_PKG_BUILD_PKG)) ; \
GO_INCLUDE_DIR:=$(dir $(lastword $(MAKEFILE_LIST)))
endif
-include $(GO_INCLUDE_DIR)/golang-version.mk
-
# Unset environment variables
# There are more magic variables to track down, but ain't nobody got time for that
GO_ARCH_DEPENDS:=@(aarch64||arm||i386||i686||mips||mips64||mips64el||mipsel||powerpc64||x86_64)
-GO_TARGET_PREFIX:=/usr
-GO_TARGET_VERSION_ID:=$(GO_VERSION_MAJOR_MINOR)
-GO_TARGET_ROOT:=$(GO_TARGET_PREFIX)/lib/go-$(GO_TARGET_VERSION_ID)
-
# ASLR/PIE
+++ /dev/null
-#
-# Copyright (C) 2018 Jeffery To
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-ifeq ($(origin GO_INCLUDE_DIR),undefined)
- GO_INCLUDE_DIR:=$(dir $(lastword $(MAKEFILE_LIST)))
-endif
-
-
-GO_VERSION_MAJOR_MINOR:=1.13
-GO_VERSION_PATCH:=7
#
include $(TOPDIR)/rules.mk
-include ../golang-version.mk
+
+GO_VERSION_MAJOR_MINOR:=1.13
+GO_VERSION_PATCH:=7
PKG_NAME:=golang
PKG_VERSION:=$(GO_VERSION_MAJOR_MINOR)$(if $(GO_VERSION_PATCH),.$(GO_VERSION_PATCH))
PKG_GO_HOST_CACHE_DIR:=$(PKG_GO_WORK_DIR)/host_cache
PKG_GO_TARGET_CACHE_DIR:=$(PKG_GO_WORK_DIR)/target_cache
+PKG_GO_PREFIX:=/usr
+PKG_GO_VERSION_ID:=$(GO_VERSION_MAJOR_MINOR)
+PKG_GO_ROOT:=$(PKG_GO_PREFIX)/lib/go-$(PKG_GO_VERSION_ID)
+
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/go-$(PKG_VERSION)
HOST_BUILD_PARALLEL:=1
$(eval $(call GoCompiler/AddProfile,Bootstrap,$(BOOTSTRAP_BUILD_DIR),,bootstrap,$(GO_HOST_OS_ARCH)))
$(eval $(call GoCompiler/AddProfile,Host,$(HOST_BUILD_DIR),$(HOST_GO_PREFIX),$(HOST_GO_VERSION_ID),$(GO_HOST_OS_ARCH),$(HOST_GO_INSTALL_SUFFIX)))
-$(eval $(call GoCompiler/AddProfile,Package,$(PKG_BUILD_DIR),$(GO_TARGET_PREFIX),$(GO_TARGET_VERSION_ID),$(GO_OS_ARCH),$(PKG_GO_INSTALL_SUFFIX)))
+$(eval $(call GoCompiler/AddProfile,Package,$(PKG_BUILD_DIR),$(PKG_GO_PREFIX),$(PKG_GO_VERSION_ID),$(GO_OS_ARCH),$(PKG_GO_INSTALL_SUFFIX)))
define Host/Prepare
$(call Host/Prepare/Default)
( \
cd $(PKG_BUILD_DIR)/bin ; \
+ export $(call GoPackage/Environment/Target) ; \
$(CP) go go-host ; \
- GOROOT_FINAL=$(GO_TARGET_ROOT) \
+ GOROOT_FINAL=$(PKG_GO_ROOT) \
GOCACHE=$(PKG_GO_TARGET_CACHE_DIR) \
GOENV=off \
GO_GCC_HELPER_CC="$(TARGET_CC)" \
CXX=g++ \
PKG_CONFIG=pkg-config \
PATH=$(HOST_GO_ROOT)/openwrt:$$$$PATH \
- $(call GoPackage/Environment) \
./go-host install -a $(if $(PKG_GO_ENABLE_PIE),-buildmode=pie) std cmd ; \
retval=$$$$? ; \
rm -f go-host ; \
endef
define Package/golang/install
- $(call GoCompiler/Package/Install/Bin,$(1)$(GO_TARGET_PREFIX))
- $(call GoCompiler/Package/Install/BinLinks,$(1)$(GO_TARGET_PREFIX))
+ $(call GoCompiler/Package/Install/Bin,$(1)$(PKG_GO_PREFIX))
+ $(call GoCompiler/Package/Install/BinLinks,$(1)$(PKG_GO_PREFIX))
endef
define Package/golang-doc/install
- $(call GoCompiler/Package/Install/Doc,$(1)$(GO_TARGET_PREFIX))
+ $(call GoCompiler/Package/Install/Doc,$(1)$(PKG_GO_PREFIX))
endef
define Package/golang-src/install
- $(call GoCompiler/Package/Install/Src,$(1)$(GO_TARGET_PREFIX))
+ $(call GoCompiler/Package/Install/Src,$(1)$(PKG_GO_PREFIX))
endef
# src/debug contains ELF executables as test data
PKG_NAME:=containerd
PKG_VERSION:=1.2.10
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE
GO_PKG_INSTALL_ALL:=1
MAKE_PATH:=$(GO_PKG_WORK_DIR_NAME)/build/src/$(GO_PKG)
-MAKE_VARS += \
- GOPATH=$(GO_PKG_BUILD_DIR) \
- GOCACHE=$(GO_PKG_CACHE_DIR) \
- GOTMPDIR=$(GO_PKG_TMP_DIR) \
- GOROOT_FINAL=$(GO_TARGET_ROOT) \
- CC=$(TARGET_CC) \
- CXX=$(TARGET_CXX) \
- $(call GoPackage/Environment)
+MAKE_VARS += $(call GoPackage/Environment)
MAKE_FLAGS += \
DESTDIR="$(PKG_INSTALL_DIR)" \
VERSION=$(PKG_VERSION) \
PKG_NAME:=docker-ce
PKG_VERSION:=19.03.5
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=components/cli/LICENSE components/engine/LICENSE
define Build/Compile
( \
- export GOPATH=$(GO_PKG_BUILD_DIR) \
- GOCACHE=$(GO_PKG_CACHE_DIR) \
- GOTMPDIR=$(GO_PKG_TMP_DIR) \
- GOROOT_FINAL=$(GO_TARGET_ROOT) \
- CC=$(TARGET_CC) \
- CXX=$(TARGET_CXX) \
- $(call GoPackage/Environment) \
+ export $(call GoPackage/Environment) \
GITCOMMIT=$(PKG_SOURCE_VERSION) \
DOCKER_GITCOMMIT=$(PKG_SOURCE_VERSION) \
DOCKER_BUILDTAGS='$(BUILDTAGS)' \
PKG_NAME:=runc
PKG_VERSION:=1.0.0-rc8+91-3e425f80
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE
GO_PKG_INSTALL_ALL:=1
MAKE_PATH:=$(GO_PKG_WORK_DIR_NAME)/build/src/$(GO_PKG)
-MAKE_VARS += \
- GOPATH=$(GO_PKG_BUILD_DIR) \
- GOCACHE=$(GO_PKG_CACHE_DIR) \
- GOTMPDIR=$(GO_PKG_TMP_DIR) \
- GOROOT_FINAL=$(GO_TARGET_ROOT) \
- CC=$(TARGET_CC) \
- CXX=$(TARGET_CXX) \
- $(call GoPackage/Environment)
+MAKE_VARS += $(call GoPackage/Environment)
MAKE_FLAGS += \
COMMIT=$(PKG_SOURCE_VERSION)