| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
export GOPATH ?= $(CURDIR)/debian/go |
| 4 |
export PATH := $(GOPATH)/bin:$(PATH) |
| 5 |
|
| 6 |
override_dh_auto_build: |
| 7 |
# The grpc-gateway definitions have been removed from the proto files |
| 8 |
# to fix the build with grpc-gateway v2. |
| 9 |
# Remove the stale generated gateway file. |
| 10 |
rm -f pkg/configpb/configpb.pb.gw.go |
| 11 |
# Regenerate the main pb.go file from the patched proto file. |
| 12 |
# The paths=source_relative option with protoc is tricky. We generate |
| 13 |
# the file in a temporary location and move it. |
| 14 |
# Remove rust-specific lines that break gogo |
| 15 |
sed -i '/rustproto/d' proto/configpb.proto |
| 16 |
# But we still need to generate rustproto itself, because other protos may depend on it. |
| 17 |
# Use a temp dir and move to avoid creating nested directories on re-runs. |
| 18 |
mkdir -p debian/.build/proto-gen |
| 19 |
protoc -I. -Iinclude --gogo_out=paths=source_relative,Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor:debian/.build/proto-gen include/rustproto.proto |
| 20 |
rm -f pkg/rustproto/rustproto.pb.go |
| 21 |
mkdir -p pkg/rustproto |
| 22 |
mv debian/.build/proto-gen/include/rustproto.pb.go pkg/rustproto/ |
| 23 |
mkdir -p debian/.build/proto-gen |
| 24 |
protoc -I. -Iinclude --gogo_out=plugins=grpc,paths=source_relative:debian/.build/proto-gen proto/configpb.proto |
| 25 |
mkdir -p pkg/configpb |
| 26 |
mv debian/.build/proto-gen/proto/configpb.pb.go pkg/configpb/ |
| 27 |
dh_auto_build |
| 28 |
|
| 29 |
%: |
| 30 |
dh $@ --builddirectory=debian/.build/upstream --buildsystem=golang |