Merge pull request #8181 from jefferyto/golang-packaging-updates
golang: packaging updates
This commit is contained in:
commit
9d1319af53
2 changed files with 11 additions and 5 deletions
|
@ -28,10 +28,12 @@ include $(GO_INCLUDE_DIR)/golang-values.mk
|
||||||
# files are installed:
|
# files are installed:
|
||||||
#
|
#
|
||||||
# * Files with one of these extensions:
|
# * 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
|
# * Files in any 'testdata' directory
|
||||||
#
|
#
|
||||||
|
# * go.mod and go.sum, in any directory
|
||||||
|
#
|
||||||
# e.g. GO_PKG_INSTALL_EXTRA:=example.toml marshal_test.toml
|
# 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
|
# Credit for this package build process (GoPackage/Build/Configure and
|
||||||
# GoPackage/Build/Compile) belong to Debian's dh-golang completely.
|
# 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
|
# for building packages, not user code
|
||||||
|
@ -153,17 +155,20 @@ define GoPackage/Build/Configure
|
||||||
sed 's|^\./||') ; \
|
sed 's|^\./||') ; \
|
||||||
\
|
\
|
||||||
if [ "$(GO_PKG_INSTALL_ALL)" != 1 ]; then \
|
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/') ; \
|
testdata=$$$$(echo "$$$$files" | grep '\(^\|/\)testdata/') ; \
|
||||||
|
gomod=$$$$(echo "$$$$files" | grep '\(^\|/\)go\.\(mod\|sum\)$$$$') ; \
|
||||||
\
|
\
|
||||||
for pattern in $(GO_PKG_INSTALL_EXTRA); do \
|
for pattern in $(GO_PKG_INSTALL_EXTRA); do \
|
||||||
extra=$$$$(echo "$$$$extra"; echo "$$$$files" | grep "$$$$pattern") ; \
|
extra=$$$$(echo "$$$$extra"; echo "$$$$files" | grep "$$$$pattern") ; \
|
||||||
done ; \
|
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) ; \
|
files=$$$$(echo "$$$$files" | grep -v '^[[:space:]]*$$$$' | sort -u) ; \
|
||||||
fi ; \
|
fi ; \
|
||||||
\
|
\
|
||||||
|
IFS=$$$$'\n' ; \
|
||||||
|
\
|
||||||
echo "Copying files from $(PKG_BUILD_DIR) into $(GO_PKG_BUILD_DIR)/src/$(GO_PKG)" ; \
|
echo "Copying files from $(PKG_BUILD_DIR) into $(GO_PKG_BUILD_DIR)/src/$(GO_PKG)" ; \
|
||||||
for file in $$$$files; do \
|
for file in $$$$files; do \
|
||||||
echo $$$$file ; \
|
echo $$$$file ; \
|
||||||
|
|
|
@ -13,7 +13,7 @@ include $(GO_INCLUDE_DIR)/golang-version.mk
|
||||||
|
|
||||||
|
|
||||||
unexport \
|
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_ENABLED \
|
||||||
CGO_CFLAGS CGO_CFLAGS_ALLOW CGO_CFLAGS_DISALLOW \
|
CGO_CFLAGS CGO_CFLAGS_ALLOW CGO_CFLAGS_DISALLOW \
|
||||||
CGO_CPPFLAGS CGO_CPPFLAGS_ALLOW CGO_CPPFLAGS_DISALLOW \
|
CGO_CPPFLAGS CGO_CPPFLAGS_ALLOW CGO_CPPFLAGS_DISALLOW \
|
||||||
|
@ -21,6 +21,7 @@ unexport \
|
||||||
CGO_FFLAGS CGO_FFLAGS_ALLOW CGO_FFLAGS_DISALLOW \
|
CGO_FFLAGS CGO_FFLAGS_ALLOW CGO_FFLAGS_DISALLOW \
|
||||||
CGO_LDFLAGS CGO_LDFLAGS_ALLOW CGO_LDFLAGS_DISALLOW \
|
CGO_LDFLAGS CGO_LDFLAGS_ALLOW CGO_LDFLAGS_DISALLOW \
|
||||||
GOARM GO386 GOMIPS GOMIPS64 \
|
GOARM GO386 GOMIPS GOMIPS64 \
|
||||||
|
GO111MODULE \
|
||||||
GOROOT_FINAL GO_EXTLINK_ENABLED GIT_ALLOW_PROTOCOL \
|
GOROOT_FINAL GO_EXTLINK_ENABLED GIT_ALLOW_PROTOCOL \
|
||||||
CC_FOR_TARGET CXX_FOR_TARGET GO_DISTFLAGS GO_GCFLAGS GO_LDFLAGS GOBUILDTIMELOGFILE GOROOT_BOOTSTRAP \
|
CC_FOR_TARGET CXX_FOR_TARGET GO_DISTFLAGS GO_GCFLAGS GO_LDFLAGS GOBUILDTIMELOGFILE GOROOT_BOOTSTRAP \
|
||||||
BOOT_GO_GCFLAGS GOEXPERIMENT GOBOOTSTRAP_TOOLEXEC
|
BOOT_GO_GCFLAGS GOEXPERIMENT GOBOOTSTRAP_TOOLEXEC
|
||||||
|
|
Loading…
Reference in a new issue