Browse Source

Merge pull request #8181 from jefferyto/golang-packaging-updates

golang: packaging updates
lilik-openwrt-22.03
Hannu Nyman 6 years ago
committed by GitHub
parent
commit
9d1319af53
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 5 deletions
  1. +9
    -4
      lang/golang/golang-package.mk
  2. +2
    -1
      lang/golang/golang-values.mk

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

@ -28,10 +28,12 @@ include $(GO_INCLUDE_DIR)/golang-values.mk
# files are installed:
#
# * Files with one of these extensions:
# .go, .c, .cc, .h, .hh, .proto, .s
# .go, .c, .cc, .cpp, .h, .hh, .hpp, .proto, .s
#
# * Files in any 'testdata' directory
#
# * go.mod and go.sum, in any directory
#
# e.g. GO_PKG_INSTALL_EXTRA:=example.toml marshal_test.toml
#
#
@ -77,7 +79,7 @@ include $(GO_INCLUDE_DIR)/golang-values.mk
# Credit for this package build process (GoPackage/Build/Configure and
# GoPackage/Build/Compile) belong to Debian's dh-golang completely.
# https://anonscm.debian.org/cgit/pkg-go/packages/dh-golang.git
# https://salsa.debian.org/go-team/packages/dh-golang
# for building packages, not user code
@ -153,17 +155,20 @@ define GoPackage/Build/Configure
sed 's|^\./||') ; \
\
if [ "$(GO_PKG_INSTALL_ALL)" != 1 ]; then \
code=$$$$(echo "$$$$files" | grep '\.\(c\|cc\|go\|h\|hh\|proto\|s\)$$$$') ; \
code=$$$$(echo "$$$$files" | grep '\.\(c\|cc\|cpp\|go\|h\|hh\|hpp\|proto\|s\)$$$$') ; \
testdata=$$$$(echo "$$$$files" | grep '\(^\|/\)testdata/') ; \
gomod=$$$$(echo "$$$$files" | grep '\(^\|/\)go\.\(mod\|sum\)$$$$') ; \
\
for pattern in $(GO_PKG_INSTALL_EXTRA); do \
extra=$$$$(echo "$$$$extra"; echo "$$$$files" | grep "$$$$pattern") ; \
done ; \
\
files=$$$$(echo "$$$$code"; echo "$$$$testdata"; echo "$$$$extra") ; \
files=$$$$(echo "$$$$code"; echo "$$$$testdata"; echo "$$$$gomod"; echo "$$$$extra") ; \
files=$$$$(echo "$$$$files" | grep -v '^[[:space:]]*$$$$' | sort -u) ; \
fi ; \
\
IFS=$$$$'\n' ; \
\
echo "Copying files from $(PKG_BUILD_DIR) into $(GO_PKG_BUILD_DIR)/src/$(GO_PKG)" ; \
for file in $$$$files; do \
echo $$$$file ; \


+ 2
- 1
lang/golang/golang-values.mk View File

@ -13,7 +13,7 @@ include $(GO_INCLUDE_DIR)/golang-version.mk
unexport \
GOARCH GOBIN GOCACHE GODEBUG GOHOSTARCH GOOS GOPATH GORACE GOROOT GOTMPDIR GCCGO \
GOARCH GOBIN GOCACHE GODEBUG GOFLAGS GOHOSTARCH GOOS GOPATH GORACE GOROOT GOTMPDIR GCCGO \
CGO_ENABLED \
CGO_CFLAGS CGO_CFLAGS_ALLOW CGO_CFLAGS_DISALLOW \
CGO_CPPFLAGS CGO_CPPFLAGS_ALLOW CGO_CPPFLAGS_DISALLOW \
@ -21,6 +21,7 @@ unexport \
CGO_FFLAGS CGO_FFLAGS_ALLOW CGO_FFLAGS_DISALLOW \
CGO_LDFLAGS CGO_LDFLAGS_ALLOW CGO_LDFLAGS_DISALLOW \
GOARM GO386 GOMIPS GOMIPS64 \
GO111MODULE \
GOROOT_FINAL GO_EXTLINK_ENABLED GIT_ALLOW_PROTOCOL \
CC_FOR_TARGET CXX_FOR_TARGET GO_DISTFLAGS GO_GCFLAGS GO_LDFLAGS GOBUILDTIMELOGFILE GOROOT_BOOTSTRAP \
BOOT_GO_GCFLAGS GOEXPERIMENT GOBOOTSTRAP_TOOLEXEC


Loading…
Cancel
Save