Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 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" |
| 8 | LIC_FILES_CHKSUM = "file://LICENSE;md5=37b5762e07f0af8c74ce80a8bda4266b" |
| 9 | |
| 10 | DEPENDS = "zlib" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 11 | DEPENDS:append:class-target = " protobuf-native" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 12 | |
Andrew Geissler | 6972109 | 2021-07-23 12:57:00 -0400 | [diff] [blame] | 13 | SRCREV = "909a0f36a10075c4b4bc70fdee2c7e32dd612a72" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 14 | |
Andrew Geissler | c87764f | 2020-06-27 00:16:32 -0500 | [diff] [blame] | 15 | SRC_URI = "git://github.com/protocolbuffers/protobuf.git \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 16 | file://run-ptest \ |
| 17 | file://0001-protobuf-fix-configure-error.patch \ |
| 18 | file://0001-Makefile.am-include-descriptor.cc-when-building-libp.patch \ |
| 19 | file://0001-examples-Makefile-respect-CXX-LDFLAGS-variables-fix-.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 20 | " |
| 21 | S = "${WORKDIR}/git" |
| 22 | |
| 23 | inherit autotools-brokensep pkgconfig ptest |
| 24 | |
| 25 | PACKAGECONFIG ??= "" |
| 26 | PACKAGECONFIG[python] = ",," |
| 27 | |
| 28 | EXTRA_OECONF += "--with-protoc=echo" |
| 29 | |
| 30 | TEST_SRC_DIR = "examples" |
| 31 | LANG_SUPPORT = "cpp ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python', '', d)}" |
| 32 | |
| 33 | do_compile_ptest() { |
| 34 | mkdir -p "${B}/${TEST_SRC_DIR}" |
| 35 | |
| 36 | # Add the location of the cross-compiled header and library files |
| 37 | # which haven't been installed yet. |
| 38 | cp "${B}/protobuf.pc" "${B}/${TEST_SRC_DIR}/protobuf.pc" |
| 39 | sed -e 's|libdir=|libdir=${PKG_CONFIG_SYSROOT_DIR}|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc" |
| 40 | sed -e 's|Cflags:|Cflags: -I${S}/src|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc" |
| 41 | sed -e 's|Libs:|Libs: -L${B}/src/.libs|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc" |
| 42 | export PKG_CONFIG_PATH="${B}/${TEST_SRC_DIR}" |
| 43 | |
| 44 | # Save the pkgcfg sysroot variable, and update it to nothing so |
| 45 | # that it doesn't append the sysroot to the beginning of paths. |
| 46 | # The header and library files aren't installed to the target |
| 47 | # system yet. So the absolute paths were specified above. |
| 48 | save_pkg_config_sysroot_dir=$PKG_CONFIG_SYSROOT_DIR |
| 49 | export PKG_CONFIG_SYSROOT_DIR= |
| 50 | |
| 51 | # Compile the tests |
| 52 | for lang in ${LANG_SUPPORT}; do |
| 53 | oe_runmake -C "${S}/${TEST_SRC_DIR}" ${lang} |
| 54 | done |
| 55 | |
| 56 | # Restore the pkgconfig sysroot variable |
| 57 | export PKG_CONFIG_SYSROOT_DIR=$save_pkg_config_sysroot_dir |
| 58 | } |
| 59 | |
| 60 | do_install_ptest() { |
| 61 | local olddir=`pwd` |
| 62 | |
| 63 | cd "${S}/${TEST_SRC_DIR}" |
| 64 | install -d "${D}/${PTEST_PATH}" |
| 65 | for i in add_person* list_people*; do |
| 66 | if [ -x "$i" ]; then |
| 67 | install "$i" "${D}/${PTEST_PATH}" |
| 68 | fi |
| 69 | done |
| 70 | cp "${S}/${TEST_SRC_DIR}/addressbook_pb2.py" "${D}/${PTEST_PATH}" |
| 71 | cd "$olddir" |
| 72 | } |
| 73 | |
| 74 | PACKAGE_BEFORE_PN = "${PN}-compiler ${PN}-lite" |
| 75 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 76 | FILES:${PN}-compiler = "${bindir} ${libdir}/libprotoc${SOLIBS}" |
| 77 | FILES:${PN}-lite = "${libdir}/libprotobuf-lite${SOLIBS}" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 78 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 79 | RDEPENDS:${PN}-compiler = "${PN}" |
| 80 | RDEPENDS:${PN}-dev += "${PN}-compiler" |
| 81 | RDEPENDS:${PN}-ptest = "bash ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python-protobuf', '', d)}" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 82 | |
| 83 | MIPS_INSTRUCTION_SET = "mips" |
| 84 | |
| 85 | BBCLASSEXTEND = "native nativesdk" |
| 86 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 87 | LDFLAGS:append:arm = " -latomic" |
| 88 | LDFLAGS:append:mips = " -latomic" |
| 89 | LDFLAGS:append:powerpc = " -latomic" |
| 90 | LDFLAGS:append:mipsel = " -latomic" |