summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-devtools/protobuf/protobuf_6.31.1.bb
diff options
context:
space:
mode:
authorRyan Eatmon <reatmon@ti.com>2025-06-25 18:56:44 -0500
committerKhem Raj <raj.khem@gmail.com>2025-06-26 07:26:20 -0700
commit8016c50f1558760a50bde9830655ae3864298b2a (patch)
treed30954e5eeb74d4fcd347062279cc20496bb56cf /meta-oe/recipes-devtools/protobuf/protobuf_6.31.1.bb
parente4c238af7d72ede166e02f3f6530389a53c27296 (diff)
downloadmeta-openembedded-8016c50f1558760a50bde9830655ae3864298b2a.tar.gz
protobuf: 5.29.5 -> 6.31.1
Refresh local patches: - 0001-examples-Makefile-respect-CXX-LDFLAGS-variables-fix-.patch Fix protobuf build error due to recent abseil-cpp update: https://git.openembedded.org/meta-openembedded/commit/?h=master&id=e8c0e64e89b565a55d4c4fefe30a90a25fbe5831 Changelog: https://github.com/protocolbuffers/protobuf/releases/tag/v31.1 Signed-off-by: Ryan Eatmon <reatmon@ti.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-devtools/protobuf/protobuf_6.31.1.bb')
-rw-r--r--meta-oe/recipes-devtools/protobuf/protobuf_6.31.1.bb123
1 files changed, 123 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/protobuf/protobuf_6.31.1.bb b/meta-oe/recipes-devtools/protobuf/protobuf_6.31.1.bb
new file mode 100644
index 0000000000..90be1179aa
--- /dev/null
+++ b/meta-oe/recipes-devtools/protobuf/protobuf_6.31.1.bb
@@ -0,0 +1,123 @@
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
13DEPENDS = "zlib abseil-cpp jsoncpp"
14DEPENDS:append:class-target = " protobuf-native"
15
16SRCREV = "74211c0dfc2777318ab53c2cd2c317a2ef9012de"
17
18SRC_URI = "git://github.com/protocolbuffers/protobuf.git;branch=31.x;protocol=https \
19 file://run-ptest \
20 file://0001-examples-Makefile-respect-CXX-LDFLAGS-variables-fix-.patch \
21 file://0001-fix-protobuf-native-build-failure-with-gcc-10.patch \
22 "
23SRC_URI:append:mipsarcho32:toolchain-clang = " file://0001-Fix-build-on-mips-clang.patch "
24
25UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>.(25\.(\d+)))"
26
27
28CVE_PRODUCT = "google:protobuf protobuf:protobuf google-protobuf protobuf-cpp"
29
30inherit cmake pkgconfig ptest
31
32PACKAGECONFIG ??= ""
33PACKAGECONFIG:class-native ?= "compiler"
34PACKAGECONFIG:class-nativesdk ?= "compiler"
35PACKAGECONFIG[python] = ",,"
36PACKAGECONFIG[compiler] = "-Dprotobuf_BUILD_PROTOC_BINARIES=ON,-Dprotobuf_BUILD_PROTOC_BINARIES=OFF"
37
38EXTRA_OECMAKE += "\
39 -Dprotobuf_BUILD_SHARED_LIBS=ON \
40 -Dprotobuf_BUILD_LIBPROTOC=ON \
41 -Dprotobuf_BUILD_TESTS=OFF \
42 -Dprotobuf_BUILD_EXAMPLES=OFF \
43 -Dprotobuf_ABSL_PROVIDER="package" \
44 -Dprotobuf_JSONCPP_PROVIDER="package" \
45"
46
47TEST_SRC_DIR = "examples"
48LANG_SUPPORT = "cpp ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python', '', d)}"
49
50CXXFLAGS:append:mipsarcho32 = " -latomic"
51CXXFLAGS:append:riscv32 = " -latomic"
52
53do_compile_ptest() {
54 mkdir -p "${B}/${TEST_SRC_DIR}"
55
56 # Add the location of the cross-compiled header and library files
57 # which haven't been installed yet.
58 cp "${B}/protobuf.pc" "${B}/${TEST_SRC_DIR}/protobuf.pc"
59 cp ${S}/${TEST_SRC_DIR}/*.cc "${B}/${TEST_SRC_DIR}/"
60 cp ${S}/${TEST_SRC_DIR}/*.proto "${B}/${TEST_SRC_DIR}/"
61 cp ${S}/${TEST_SRC_DIR}/*.py "${B}/${TEST_SRC_DIR}/"
62 cp ${S}/${TEST_SRC_DIR}/Makefile "${B}/${TEST_SRC_DIR}/"
63 # Adapt protobuf.pc
64 sed -e 's|libdir=|libdir=${PKG_CONFIG_SYSROOT_DIR}|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc"
65 sed -e 's|Cflags:|Cflags: -I${S}/src |' -i "${B}/${TEST_SRC_DIR}/protobuf.pc"
66 sed -e 's|Cflags:|Cflags: -I${WORKDIR}/recipe-sysroot${includedir} |' -i "${B}/${TEST_SRC_DIR}/protobuf.pc"
67 sed -e 's|Libs:|Libs: -L${B}|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc"
68 sed -e 's|Libs:|Libs: -L${WORKDIR}/recipe-sysroot/usr/lib |' -i "${B}/${TEST_SRC_DIR}/protobuf.pc"
69 sed -e 's|Libs:|Libs: -labsl_log_internal_check_op |' -i "${B}/${TEST_SRC_DIR}/protobuf.pc"
70 sed -e 's|Libs:|Libs: -labsl_log_internal_message |' -i "${B}/${TEST_SRC_DIR}/protobuf.pc"
71 # Adapt uf8_range.pc
72 cp "${B}/third_party/utf8_range/utf8_range.pc" "${B}/${TEST_SRC_DIR}/utf8_range.pc"
73 sed -e 's|libdir=|libdir=${PKG_CONFIG_SYSROOT_DIR}|' -i "${B}/${TEST_SRC_DIR}/utf8_range.pc"
74 sed -e 's|Libs:|Libs= -L${B}/third_party/utf8_range |' -i "${B}/${TEST_SRC_DIR}/utf8_range.pc"
75 # Until out-of-tree build of examples is supported, we have to use this approach
76 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"
77 export PKG_CONFIG_PATH="${B}/${TEST_SRC_DIR}"
78
79 # Save the pkgcfg sysroot variable, and update it to nothing so
80 # that it doesn't append the sysroot to the beginning of paths.
81 # The header and library files aren't installed to the target
82 # system yet. So the absolute paths were specified above.
83 save_pkg_config_sysroot_dir=$PKG_CONFIG_SYSROOT_DIR
84 export PKG_CONFIG_SYSROOT_DIR=
85
86 # Compile the tests
87 for lang in ${LANG_SUPPORT}; do
88 oe_runmake -C "${B}/${TEST_SRC_DIR}" ${lang}
89 done
90
91 # Restore the pkgconfig sysroot variable
92 export PKG_CONFIG_SYSROOT_DIR=$save_pkg_config_sysroot_dir
93}
94
95do_install_ptest() {
96 local olddir=`pwd`
97
98 cd "${S}/${TEST_SRC_DIR}"
99 install -d "${D}/${PTEST_PATH}"
100 for i in add_person* list_people*; do
101 if [ -x "$i" ]; then
102 install "$i" "${D}/${PTEST_PATH}"
103 fi
104 done
105 cp "${B}/${TEST_SRC_DIR}/addressbook_pb2.py" "${D}/${PTEST_PATH}"
106 cd "$olddir"
107}
108
109PACKAGE_BEFORE_PN = "${PN}-compiler ${PN}-lite"
110
111FILES:${PN}-compiler = "${bindir} ${libdir}/libprotoc${SOLIBS}"
112FILES:${PN}-lite = "${libdir}/libprotobuf-lite${SOLIBS}"
113
114# CMake requires protoc binary to exist in sysroot, even if it has wrong architecture.
115SYSROOT_DIRS += "${bindir}"
116
117RDEPENDS:${PN}-compiler = "${PN}"
118RDEPENDS:${PN}-dev += "${@bb.utils.contains('PACKAGECONFIG', 'compiler', '${PN}-compiler', '', d)}"
119RDEPENDS:${PN}-ptest = "bash ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-protobuf', '', d)}"
120
121MIPS_INSTRUCTION_SET = "mips"
122
123BBCLASSEXTEND = "native nativesdk"