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