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