File: rules

package info (click to toggle)
golang-github-pingcap-kvproto 6.1.0~alpha-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,040 kB
  • sloc: sh: 111; makefile: 34
file content (30 lines) | stat: -rwxr-xr-x 1,424 bytes parent folder | download
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
#!/usr/bin/make -f

export GOPATH ?= $(CURDIR)/debian/go
export PATH := $(GOPATH)/bin:$(PATH)

override_dh_auto_build:
	# The grpc-gateway definitions have been removed from the proto files
	# to fix the build with grpc-gateway v2.
	# Remove the stale generated gateway file.
	rm -f pkg/configpb/configpb.pb.gw.go
	# Regenerate the main pb.go file from the patched proto file.
	# The paths=source_relative option with protoc is tricky. We generate
	# the file in a temporary location and move it.
	# Remove rust-specific lines that break gogo
	sed -i '/rustproto/d' proto/configpb.proto
	# But we still need to generate rustproto itself, because other protos may depend on it.
	# Use a temp dir and move to avoid creating nested directories on re-runs.
	mkdir -p debian/.build/proto-gen
	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
	rm -f pkg/rustproto/rustproto.pb.go
	mkdir -p pkg/rustproto
	mv debian/.build/proto-gen/include/rustproto.pb.go pkg/rustproto/
	mkdir -p debian/.build/proto-gen
	protoc -I. -Iinclude --gogo_out=plugins=grpc,paths=source_relative:debian/.build/proto-gen proto/configpb.proto
	mkdir -p pkg/configpb
	mv debian/.build/proto-gen/proto/configpb.pb.go pkg/configpb/
	dh_auto_build

%:
	dh $@ --builddirectory=debian/.build/upstream --buildsystem=golang