summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-devtools/protobuf/protobuf_6.33.6.bb
diff options
context:
space:
mode:
authorKhem Raj <khem.raj@oss.qualcomm.com>2026-03-20 18:28:16 -0700
committerKhem Raj <khem.raj@oss.qualcomm.com>2026-03-20 18:29:28 -0700
commitaee9d873f746468a2ef39216fce6acc918a1712d (patch)
tree68857eb63202e71e435aa36c6c218d295e1ee3fc /meta-oe/recipes-devtools/protobuf/protobuf_6.33.6.bb
parentc40024aa116a3d3881b241d90aed018c9c61f944 (diff)
downloadmeta-openembedded-aee9d873f746468a2ef39216fce6acc918a1712d.tar.gz
protobuf: Upgrade to 6.33.6
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
Diffstat (limited to 'meta-oe/recipes-devtools/protobuf/protobuf_6.33.6.bb')
-rw-r--r--meta-oe/recipes-devtools/protobuf/protobuf_6.33.6.bb127
1 files changed, 127 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/protobuf/protobuf_6.33.6.bb b/meta-oe/recipes-devtools/protobuf/protobuf_6.33.6.bb
new file mode 100644
index 0000000000..104c0f2c63
--- /dev/null
+++ b/meta-oe/recipes-devtools/protobuf/protobuf_6.33.6.bb
@@ -0,0 +1,127 @@
1SUMMARY = "Protocol Buffers - structured data serialisation mechanism"
2DESCRIPTION = "Protocol Buffers are a way of encoding structured data in an \
3efficient yet extensible format. Google uses Protocol Buffers for almost \
4all of its internal RPC protocols and file formats."
5HOMEPAGE = "https://github.com/google/protobuf"
6SECTION = "console/tools"
7LICENSE = "BSD-3-Clause & MIT"
8LIC_FILES_CHKSUM = " \
9 file://LICENSE;md5=37b5762e07f0af8c74ce80a8bda4266b \
10 file://third_party/utf8_range/LICENSE;md5=d4974d297231477b2ff507c35d61c13c \
11"
12
13PROTOC_VERSION = "v${@d.getVar('PV').split('.', 1)[1]}"
14PROTOC_BRANCH = "${@d.getVar('PV').split('.', 2)[1]}.x"
15
16DEPENDS = "zlib abseil-cpp jsoncpp"
17DEPENDS:append:class-target = " protobuf-native"
18
19SRCREV = "6e1998413a5bca7c058b85999667893f167434bc"
20
21SRC_URI = "git://github.com/protocolbuffers/protobuf.git;branch=${PROTOC_BRANCH};protocol=https;tag=${PROTOC_VERSION} \
22 file://run-ptest \
23 file://0001-examples-Makefile-respect-CXX-LDFLAGS-variables-fix-.patch \
24 file://0001-fix-protobuf-native-build-failure-with-gcc-10.patch \
25 "
26
27UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d\.\d+\.\d+)"
28
29CVE_PRODUCT = "google:protobuf protobuf:protobuf google-protobuf protobuf-cpp"
30
31CVE_STATUS[CVE-2026-0994] = "cpe-incorrect: the vulnerability affects only python3-protobuf recipe"
32
33inherit cmake pkgconfig ptest
34
35PACKAGECONFIG ??= ""
36PACKAGECONFIG:class-native ?= "compiler"
37PACKAGECONFIG:class-nativesdk ?= "compiler"
38PACKAGECONFIG[python] = ",,"
39PACKAGECONFIG[compiler] = "-Dprotobuf_BUILD_PROTOC_BINARIES=ON,-Dprotobuf_BUILD_PROTOC_BINARIES=OFF"
40
41EXTRA_OECMAKE += "\
42 -Dprotobuf_BUILD_SHARED_LIBS=ON \
43 -Dprotobuf_BUILD_LIBPROTOC=ON \
44 -Dprotobuf_BUILD_TESTS=OFF \
45 -Dprotobuf_BUILD_EXAMPLES=OFF \
46 -Dprotobuf_ABSL_PROVIDER="package" \
47 -Dprotobuf_JSONCPP_PROVIDER="package" \
48"
49
50TEST_SRC_DIR = "examples"
51LANG_SUPPORT = "cpp ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python', '', d)}"
52
53CXXFLAGS:append:mipsarcho32 = " -latomic"
54CXXFLAGS:append:riscv32 = " -latomic"
55
56do_compile_ptest() {
57 mkdir -p "${B}/${TEST_SRC_DIR}"
58
59 # Add the location of the cross-compiled header and library files
60 # which haven't been installed yet.
61 cp "${B}/protobuf.pc" "${B}/${TEST_SRC_DIR}/protobuf.pc"
62 cp ${S}/${TEST_SRC_DIR}/*.cc "${B}/${TEST_SRC_DIR}/"
63 cp ${S}/${TEST_SRC_DIR}/*.proto "${B}/${TEST_SRC_DIR}/"
64 cp ${S}/${TEST_SRC_DIR}/*.py "${B}/${TEST_SRC_DIR}/"
65 cp ${S}/${TEST_SRC_DIR}/Makefile "${B}/${TEST_SRC_DIR}/"
66 # Adapt protobuf.pc
67 sed -e 's|libdir=|libdir=${PKG_CONFIG_SYSROOT_DIR}|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc"
68 sed -e 's|Cflags:|Cflags: -I${S}/src |' -i "${B}/${TEST_SRC_DIR}/protobuf.pc"
69 sed -e 's|Cflags:|Cflags: -I${WORKDIR}/recipe-sysroot${includedir} |' -i "${B}/${TEST_SRC_DIR}/protobuf.pc"
70 sed -e 's|Libs:|Libs: -L${B}|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc"
71 sed -e 's|Libs:|Libs: -L${WORKDIR}/recipe-sysroot/usr/lib |' -i "${B}/${TEST_SRC_DIR}/protobuf.pc"
72 sed -e 's|Libs:|Libs: -labsl_log_internal_check_op |' -i "${B}/${TEST_SRC_DIR}/protobuf.pc"
73 sed -e 's|Libs:|Libs: -labsl_log_internal_message |' -i "${B}/${TEST_SRC_DIR}/protobuf.pc"
74 # Adapt uf8_range.pc
75 cp "${B}/third_party/utf8_range/utf8_range.pc" "${B}/${TEST_SRC_DIR}/utf8_range.pc"
76 sed -e 's|libdir=|libdir=${PKG_CONFIG_SYSROOT_DIR}|' -i "${B}/${TEST_SRC_DIR}/utf8_range.pc"
77 sed -e 's|includedir=.*|includedir=${S}/third_party/utf8_range|' -i "${B}/${TEST_SRC_DIR}/utf8_range.pc"
78 sed -e 's|Libs:|Libs= -L${B}/third_party/utf8_range |' -i "${B}/${TEST_SRC_DIR}/utf8_range.pc"
79 # Until out-of-tree build of examples is supported, we have to use this approach
80 sed -e 's|../src/google/protobuf/.libs/timestamp.pb.o|${B}/CMakeFiles/libprotobuf.dir/src/google/protobuf/timestamp.pb.cc.o|' -i "${B}/${TEST_SRC_DIR}/Makefile"
81 export PKG_CONFIG_PATH="${B}/${TEST_SRC_DIR}"
82
83 # Save the pkgcfg sysroot variable, and update it to nothing so
84 # that it doesn't append the sysroot to the beginning of paths.
85 # The header and library files aren't installed to the target
86 # system yet. So the absolute paths were specified above.
87 save_pkg_config_sysroot_dir=$PKG_CONFIG_SYSROOT_DIR
88 export PKG_CONFIG_SYSROOT_DIR=
89
90 # Compile the tests
91 for lang in ${LANG_SUPPORT}; do
92 oe_runmake -C "${B}/${TEST_SRC_DIR}" ${lang}
93 done
94
95 # Restore the pkgconfig sysroot variable
96 export PKG_CONFIG_SYSROOT_DIR=$save_pkg_config_sysroot_dir
97}
98
99do_install_ptest() {
100 local olddir=`pwd`
101
102 cd "${S}/${TEST_SRC_DIR}"
103 install -d "${D}/${PTEST_PATH}"
104 for i in add_person* list_people*; do
105 if [ -x "$i" ]; then
106 install "$i" "${D}/${PTEST_PATH}"
107 fi
108 done
109 cp "${B}/${TEST_SRC_DIR}/addressbook_pb2.py" "${D}/${PTEST_PATH}"
110 cd "$olddir"
111}
112
113PACKAGE_BEFORE_PN = "${PN}-compiler ${PN}-lite"
114
115FILES:${PN}-compiler = "${bindir} ${libdir}/libprotoc${SOLIBS}"
116FILES:${PN}-lite = "${libdir}/libprotobuf-lite${SOLIBS}"
117
118# CMake requires protoc binary to exist in sysroot, even if it has wrong architecture.
119SYSROOT_DIRS += "${bindir}"
120
121RDEPENDS:${PN}-compiler = "${PN}"
122RDEPENDS:${PN}-dev += "${@bb.utils.contains('PACKAGECONFIG', 'compiler', '${PN}-compiler', '', d)}"
123RDEPENDS:${PN}-ptest = "bash ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-protobuf', '', d)}"
124
125MIPS_INSTRUCTION_SET = "mips"
126
127BBCLASSEXTEND = "native nativesdk"