[Pkg-golang-commits] [golang] 03/27: - Build empty golang-go and golang-src packages on architectures without golang support and depend on gccgo instead (see Debian bug #780355)
Michael Hudson-Doyle
mwhudson-guest at moszumanska.debian.org
Tue Mar 1 02:57:32 UTC 2016
This is an automated email from the git hooks/post-receive script.
mwhudson-guest pushed a commit to branch gbp
in repository golang.
commit 5f73e6ae6adaec5d7be6eebd77db126034614a17
Author: Michael Hudson-Doyle <michael.hudson at canonical.com>
Date: Fri Feb 12 10:12:50 2016 +1300
- Build empty golang-go and golang-src packages on architectures without
golang support and depend on gccgo instead (see Debian bug #780355)
---
debian/control | 7 ++++---
debian/rules | 23 +++++++++++++++++++++++
2 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/debian/control b/debian/control
index 06aa418..b660a7e 100644
--- a/debian/control
+++ b/debian/control
@@ -18,11 +18,12 @@ Standards-Version: 3.9.6
Homepage: https://golang.org
Package: golang-go
-Architecture: amd64 arm64 armel armhf i386 ppc64 ppc64el
+Architecture: any
Depends: golang-src (>= ${source:Version}),
${misc:Depends},
${perl:Depends},
- ${shlibs:Depends}
+ ${shlibs:Depends},
+ gccgo [!armel !armhf !amd64 !i386 !arm64 !ppc64 !ppc64el]
Breaks: golang-go-darwin-386,
golang-go-darwin-amd64,
golang-go-freebsd-386,
@@ -73,7 +74,7 @@ Description: Go programming language compiler, linker, compiled stdlib
pre-compile the standard library inside GOROOT for cross-compilation to work.
Package: golang-src
-Architecture: amd64 arm64 armel armhf i386 ppc64 ppc64el
+Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}
Description: Go programming language - source files
The Go programming language is an open source project to make programmers more
diff --git a/debian/rules b/debian/rules
index 268db73..4c697e0 100755
--- a/debian/rules
+++ b/debian/rules
@@ -11,6 +11,14 @@ ifeq (ppc64, $(DEB_HOST_ARCH_CPU))
RUN_TESTS := false
endif
+DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
+golang_archs = armel armhf amd64 i386 arm64 ppc64 ppc64el
+IS_GOLANG_ARCH := true
+ifeq (,$(filter $(DEB_HOST_ARCH),$(golang_archs)))
+ IS_GOLANG_ARCH := false
+ RUN_TESTS := false
+endif
+
%:
+dh --parallel $(opt_no_act) $@
@@ -42,6 +50,7 @@ override_dh_install-indep:
dh_install --fail-missing
override_dh_install-arch:
+ifeq (true, $(IS_GOLANG_ARCH))
dh_install --fail-missing
# Remove Plan9 rc(1) scripts
find debian/golang-src/usr/share/go/src -type f -name '*.rc' -delete
@@ -50,20 +59,34 @@ override_dh_install-arch:
# Touch built and installed files and directories to have same timestamp
touch debian/golang-go/usr/lib/go/pkg
find debian/golang-go/usr/lib/go/pkg -exec touch -r $(CURDIR)/debian/golang-go/usr/lib/go/pkg {} \;
+endif
override_dh_strip:
# strip disabled as golang upstream doesn't support it and it makes go
# crash. See http://bugs.debian.org/717172
+override_dh_installdeb:
+ dh_installdeb
+ifeq (false, $(IS_GOLANG_ARCH))
+ : # these are empty dependency packages
+ rm -f debian/golang-go/DEBIAN/p*
+ rm -rf debian/golang-go/usr/share/man
+ install -d -m 755 debian/golang-src/usr/share/go/src
+ install -d -m 755 debian/golang-src/usr/share/go/include
+ install -d -m 755 debian/golang-src/usr/share/go/test
+endif
+
override_dh_shlibdeps:
dh_shlibdeps -Xtestdata -Xtest
override_dh_auto_build-arch:
+ifeq (true, $(IS_GOLANG_ARCH))
[ -f VERSION ] || echo "debian snapshot +$$(dpkg-parsechangelog -SVersion)" > VERSION
export GOROOT_BOOTSTRAP=$$(env -i go env GOROOT) \
&& cd src \
&& $(CURDIR)/debian/helpers/goenv.sh \
bash ./make.bash --no-banner
+endif
opt_no_act :=
ifneq (,$(findstring n,$(MAKEFLAGS)))
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-golang/golang.git
More information about the pkg-golang-commits
mailing list