diff options
| author | Ryan Eatmon <reatmon@ti.com> | 2025-06-25 18:56:44 -0500 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2025-06-26 07:26:20 -0700 |
| commit | 8016c50f1558760a50bde9830655ae3864298b2a (patch) | |
| tree | d30954e5eeb74d4fcd347062279cc20496bb56cf /meta-oe/recipes-devtools/protobuf/protobuf_6.31.1.bb | |
| parent | e4c238af7d72ede166e02f3f6530389a53c27296 (diff) | |
| download | meta-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.bb | 123 |
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 @@ | |||
| 1 | SUMMARY = "Protocol Buffers - structured data serialisation mechanism" | ||
| 2 | DESCRIPTION = "Protocol Buffers are a way of encoding structured data in an \ | ||
| 3 | efficient yet extensible format. Google uses Protocol Buffers for almost \ | ||
| 4 | all of its internal RPC protocols and file formats." | ||
| 5 | HOMEPAGE = "https://github.com/google/protobuf" | ||
| 6 | SECTION = "console/tools" | ||
| 7 | LICENSE = "BSD-3-Clause & MIT" | ||
| 8 | LIC_FILES_CHKSUM = " \ | ||
| 9 | file://LICENSE;md5=37b5762e07f0af8c74ce80a8bda4266b \ | ||
| 10 | file://third_party/utf8_range/LICENSE;md5=d4974d297231477b2ff507c35d61c13c \ | ||
| 11 | " | ||
| 12 | |||
| 13 | DEPENDS = "zlib abseil-cpp jsoncpp" | ||
| 14 | DEPENDS:append:class-target = " protobuf-native" | ||
| 15 | |||
| 16 | SRCREV = "74211c0dfc2777318ab53c2cd2c317a2ef9012de" | ||
| 17 | |||
| 18 | SRC_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 | " | ||
| 23 | SRC_URI:append:mipsarcho32:toolchain-clang = " file://0001-Fix-build-on-mips-clang.patch " | ||
| 24 | |||
| 25 | UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>.(25\.(\d+)))" | ||
| 26 | |||
| 27 | |||
| 28 | CVE_PRODUCT = "google:protobuf protobuf:protobuf google-protobuf protobuf-cpp" | ||
| 29 | |||
| 30 | inherit cmake pkgconfig ptest | ||
| 31 | |||
| 32 | PACKAGECONFIG ??= "" | ||
| 33 | PACKAGECONFIG:class-native ?= "compiler" | ||
| 34 | PACKAGECONFIG:class-nativesdk ?= "compiler" | ||
| 35 | PACKAGECONFIG[python] = ",," | ||
| 36 | PACKAGECONFIG[compiler] = "-Dprotobuf_BUILD_PROTOC_BINARIES=ON,-Dprotobuf_BUILD_PROTOC_BINARIES=OFF" | ||
| 37 | |||
| 38 | EXTRA_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 | |||
| 47 | TEST_SRC_DIR = "examples" | ||
| 48 | LANG_SUPPORT = "cpp ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python', '', d)}" | ||
| 49 | |||
| 50 | CXXFLAGS:append:mipsarcho32 = " -latomic" | ||
| 51 | CXXFLAGS:append:riscv32 = " -latomic" | ||
| 52 | |||
| 53 | do_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 | |||
| 95 | do_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 | |||
| 109 | PACKAGE_BEFORE_PN = "${PN}-compiler ${PN}-lite" | ||
| 110 | |||
| 111 | FILES:${PN}-compiler = "${bindir} ${libdir}/libprotoc${SOLIBS}" | ||
| 112 | FILES:${PN}-lite = "${libdir}/libprotobuf-lite${SOLIBS}" | ||
| 113 | |||
| 114 | # CMake requires protoc binary to exist in sysroot, even if it has wrong architecture. | ||
| 115 | SYSROOT_DIRS += "${bindir}" | ||
| 116 | |||
| 117 | RDEPENDS:${PN}-compiler = "${PN}" | ||
| 118 | RDEPENDS:${PN}-dev += "${@bb.utils.contains('PACKAGECONFIG', 'compiler', '${PN}-compiler', '', d)}" | ||
| 119 | RDEPENDS:${PN}-ptest = "bash ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-protobuf', '', d)}" | ||
| 120 | |||
| 121 | MIPS_INSTRUCTION_SET = "mips" | ||
| 122 | |||
| 123 | BBCLASSEXTEND = "native nativesdk" | ||
