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" |
| 11 | DEPENDS_append_class-target = " protobuf-native" |
| 12 | |
Andrew Geissler | 4b7c115 | 2020-11-30 19:55:29 -0600 | [diff] [blame] | 13 | SRCREV = "2514f0bd7da7e2af1bed4c5d1b84f031c4d12c10" |
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 | eef6386 | 2021-01-29 15:58:13 -0600 | [diff] [blame] | 20 | file://0001-fix-m4-pthread-update.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 21 | " |
| 22 | S = "${WORKDIR}/git" |
| 23 | |
| 24 | inherit autotools-brokensep pkgconfig ptest |
| 25 | |
| 26 | PACKAGECONFIG ??= "" |
| 27 | PACKAGECONFIG[python] = ",," |
| 28 | |
| 29 | EXTRA_OECONF += "--with-protoc=echo" |
| 30 | |
| 31 | TEST_SRC_DIR = "examples" |
| 32 | LANG_SUPPORT = "cpp ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python', '', d)}" |
| 33 | |
| 34 | do_compile_ptest() { |
| 35 | mkdir -p "${B}/${TEST_SRC_DIR}" |
| 36 | |
| 37 | # Add the location of the cross-compiled header and library files |
| 38 | # which haven't been installed yet. |
| 39 | cp "${B}/protobuf.pc" "${B}/${TEST_SRC_DIR}/protobuf.pc" |
| 40 | sed -e 's|libdir=|libdir=${PKG_CONFIG_SYSROOT_DIR}|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc" |
| 41 | sed -e 's|Cflags:|Cflags: -I${S}/src|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc" |
| 42 | sed -e 's|Libs:|Libs: -L${B}/src/.libs|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc" |
| 43 | export PKG_CONFIG_PATH="${B}/${TEST_SRC_DIR}" |
| 44 | |
| 45 | # Save the pkgcfg sysroot variable, and update it to nothing so |
| 46 | # that it doesn't append the sysroot to the beginning of paths. |
| 47 | # The header and library files aren't installed to the target |
| 48 | # system yet. So the absolute paths were specified above. |
| 49 | save_pkg_config_sysroot_dir=$PKG_CONFIG_SYSROOT_DIR |
| 50 | export PKG_CONFIG_SYSROOT_DIR= |
| 51 | |
| 52 | # Compile the tests |
| 53 | for lang in ${LANG_SUPPORT}; do |
| 54 | oe_runmake -C "${S}/${TEST_SRC_DIR}" ${lang} |
| 55 | done |
| 56 | |
| 57 | # Restore the pkgconfig sysroot variable |
| 58 | export PKG_CONFIG_SYSROOT_DIR=$save_pkg_config_sysroot_dir |
| 59 | } |
| 60 | |
| 61 | do_install_ptest() { |
| 62 | local olddir=`pwd` |
| 63 | |
| 64 | cd "${S}/${TEST_SRC_DIR}" |
| 65 | install -d "${D}/${PTEST_PATH}" |
| 66 | for i in add_person* list_people*; do |
| 67 | if [ -x "$i" ]; then |
| 68 | install "$i" "${D}/${PTEST_PATH}" |
| 69 | fi |
| 70 | done |
| 71 | cp "${S}/${TEST_SRC_DIR}/addressbook_pb2.py" "${D}/${PTEST_PATH}" |
| 72 | cd "$olddir" |
| 73 | } |
| 74 | |
| 75 | PACKAGE_BEFORE_PN = "${PN}-compiler ${PN}-lite" |
| 76 | |
| 77 | FILES_${PN}-compiler = "${bindir} ${libdir}/libprotoc${SOLIBS}" |
| 78 | FILES_${PN}-lite = "${libdir}/libprotobuf-lite${SOLIBS}" |
| 79 | |
| 80 | RDEPENDS_${PN}-compiler = "${PN}" |
| 81 | RDEPENDS_${PN}-dev += "${PN}-compiler" |
| 82 | RDEPENDS_${PN}-ptest = "bash ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python-protobuf', '', d)}" |
| 83 | |
| 84 | MIPS_INSTRUCTION_SET = "mips" |
| 85 | |
| 86 | BBCLASSEXTEND = "native nativesdk" |
| 87 | |
| 88 | LDFLAGS_append_arm = " -latomic" |
| 89 | LDFLAGS_append_mips = " -latomic" |
| 90 | LDFLAGS_append_powerpc = " -latomic" |
| 91 | LDFLAGS_append_mipsel = " -latomic" |