sonic-buildimage/rules/protobuf.mk
Ze Gan 2f8994999b
[dash-api]: Add dash-api and related protobuf library (#14515)
Why I did it
For the DASH scenario, the APP_DB will be optimized by protobuf message for less memory consumption.

How I did it
Download the Debian package of protobuf 3.21.12 and create a corresponding rule for building it.
Add a submodule of sonic-dash-api and generated its Debian package which includes C++ library and Python library

How to verify it
Check artifacts of Azp that the protobuf-related and dash-api deb packages should be generated.

Signed-off-by: Ze Gan <ganze718@gmail.com>
2023-07-05 09:59:35 -07:00

37 lines
1.5 KiB
Makefile

# protobuf package
PROTOBUF_VERSION = 3.21.12
PROTOBUF_VERSION_FULL = $(PROTOBUF_VERSION)-3
export PROTOBUF_VERSION
export PROTOBUF_VERSION_FULL
PROTOBUF = libprotobuf32_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb
$(PROTOBUF)_SRC_PATH = $(SRC_PATH)/protobuf
SONIC_MAKE_DEBS += $(PROTOBUF)
PROTOBUF_DEV = libprotobuf-dev_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb
$(PROTOBUF_DEV)_DEPENDS = $(PROTOBUF) $(PROTOBUF_LITE)
$(eval $(call add_derived_package,$(PROTOBUF),$(PROTOBUF_DEV)))
PROTOBUF_LITE = libprotobuf-lite32_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb
$(eval $(call add_derived_package,$(PROTOBUF),$(PROTOBUF_LITE)))
PROTOC = libprotoc_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb
$(PROTOC)_RDEPENDS = $(PROTOBUF) $(PROTOBUF_LITE)
$(eval $(call add_derived_package,$(PROTOBUF),$(PROTOC)))
PROTOC32 = libprotoc32_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb
$(PROTOC32)_RDEPENDS = $(PROTOBUF) $(PROTOBUF_LITE)
$(eval $(call add_derived_package,$(PROTOBUF),$(PROTOC32)))
PROTOBUF_COMPILER = protobuf-compiler_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb
$(PROTOBUF_COMPILER)_DEPENDS = $(PROTOC32)
$(PROTOBUF_COMPILER)_RDEPENDS = $(PROTOC)
$(eval $(call add_derived_package,$(PROTOBUF),$(PROTOBUF_COMPILER)))
PYTHON3_PROTOBUF = python3-protobuf_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb
$(PYTHON3_PROTOBUF)_DEPENDS = $(PROTOBUF_DEV) $(PROTOBUF)
$(PYTHON3_PROTOBUF)_RDEPENDS = $(PROTOBUF)
$(eval $(call add_derived_package,$(PROTOBUF),$(PYTHON3_PROTOBUF)))