Browse Source

Merge pull request #11255 from jefferyto/golang-reorg

golang: More updates
lilik-openwrt-22.03
Rosen Penev 5 years ago
committed by GitHub
parent
commit
b514a74609
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 39 additions and 65 deletions
  1. +1
    -1
      lang/golang/golang-compiler.mk
  2. +17
    -9
      lang/golang/golang-package.mk
  3. +0
    -6
      lang/golang/golang-values.mk
  4. +0
    -14
      lang/golang/golang-version.mk
  5. +15
    -9
      lang/golang/golang/Makefile
  6. +2
    -9
      utils/containerd/Makefile
  7. +2
    -8
      utils/docker-ce/Makefile
  8. +2
    -9
      utils/runc/Makefile

+ 1
- 1
lang/golang/golang-compiler.mk View File

@ -59,7 +59,7 @@ define GoCompiler/Default/Install/Bin
$(INSTALL_DATA) -p $(1)/VERSION $(2)/lib/go-$(3)/
for file in AUTHORS CONTRIBUTING.md CONTRIBUTORS LICENSE PATENTS README README.md; do \
for file in AUTHORS CONTRIBUTING.md CONTRIBUTORS LICENSE PATENTS README.md SECURITY.md; do \
if [ -f $(1)/$$$$file ]; then \
$(INSTALL_DATA) -p $(1)/$$$$file $(2)/share/go-$(3)/ ; \
fi ; \


+ 17
- 9
lang/golang/golang-package.mk View File

@ -165,7 +165,7 @@ define GoPackage/GoSubMenu
CATEGORY:=Languages
endef
define GoPackage/Environment/Default
define GoPackage/Environment/Target
GOOS=$(GO_OS) \
GOARCH=$(GO_ARCH) \
GO386=$(GO_386) \
@ -173,9 +173,23 @@ define GoPackage/Environment/Default
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)
@ -264,13 +278,7 @@ endef
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)) ; \


+ 0
- 6
lang/golang/golang-values.mk View File

@ -9,8 +9,6 @@ ifeq ($(origin GO_INCLUDE_DIR),undefined)
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
@ -209,10 +207,6 @@ endif
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


+ 0
- 14
lang/golang/golang-version.mk View File

@ -1,14 +0,0 @@
#
# 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

+ 15
- 9
lang/golang/golang/Makefile View File

@ -6,11 +6,13 @@
#
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_RELEASE:=2
PKG_RELEASE:=3
GO_SOURCE_URLS:=https://dl.google.com/go/ \
https://mirrors.ustc.edu.cn/golang/ \
@ -34,6 +36,10 @@ PKG_GO_WORK_DIR:=$(PKG_BUILD_DIR)/.go_work
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
@ -178,7 +184,7 @@ $(eval $(call Download,golang-bootstrap))
$(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)
@ -278,8 +284,9 @@ define Build/Compile
( \
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)" \
@ -289,7 +296,6 @@ define Build/Compile
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 ; \
@ -298,16 +304,16 @@ define Build/Compile
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


+ 2
- 9
utils/containerd/Makefile View File

@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=containerd
PKG_VERSION:=1.2.10
PKG_RELEASE:=2
PKG_RELEASE:=3
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE
@ -49,14 +49,7 @@ endef
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) \


+ 2
- 8
utils/docker-ce/Makefile View File

@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
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
@ -78,13 +78,7 @@ endif
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)' \


+ 2
- 9
utils/runc/Makefile View File

@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
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
@ -51,14 +51,7 @@ endef
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)


Loading…
Cancel
Save