1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
#!/usr/bin/make -f
# Do not include plan9 and windows packages that are not relevant to Debian. In
# particular, the plan9 package makes build fail when using gccgo.
export DH_GOLANG_EXCLUDES := plan9 windows
BUILDDIR := $(CURDIR)/build
%:
dh $@ --buildsystem=golang --with=golang --builddirectory=$(BUILDDIR)
override_dh_auto_configure:
dh_auto_configure -O--buildsystem=golang -O--builddirectory=$(BUILDDIR)
# Rename Go source files so older versions of gccgo on mips* can find
# them, and fix build restrictions. Endianness does not matter (for now
# at least), so remove dupes.
cd $(BUILDDIR)/src/golang.org/x/sys/unix/; \
for i in errors syscall sysnum types; do \
sed 's%^// +build .*%// +build linux,mips linux,mipsle linux,mipso32%' \
< z$${i}_linux_mips.go > z$${i}_linux_mipsx.go && \
rm z$${i}_linux_mipsle.go z$${i}_linux_mips.go && \
sed 's%^// +build .*%// +build linux,mips64 linux,mips64le linux,mipsn64%' \
< z$${i}_linux_mips64.go > z$${i}_linux_mips64x.go && \
rm z$${i}_linux_mips64le.go z$${i}_linux_mips64.go; \
done
# Sadly, the stupid arch names gccgo used until recently prevent us from
# detecting endianness. Debian has only little endian for mips64, so that is
# not an issue, but for 32-bits, while using older versions of gccgo, you'll
# need to set the appropriate tags: mips or mipsle.
ifeq ($(findstring mips,$(DEB_BUILD_ARCH)),mips)
# mipsel => mipsle, mips64el => mips64le
BUILDTAGS := $(DEB_BUILD_ARCH:el=le)
endif
ifdef BUILDTAGS
override_dh_auto_build:
dh_auto_build -O--buildsystem=golang -O--builddirectory=$(BUILDDIR) -- -tags $(BUILDTAGS)
override_dh_auto_test:
dh_auto_test -O--buildsystem=golang -O--builddirectory=$(BUILDDIR) -- -tags $(BUILDTAGS)
endif
|