diff options
| author | Jianchuan Wang <jianchuan.wang@windriver.com> | 2016-09-08 01:35:58 -0400 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2016-09-12 10:03:04 -0400 |
| commit | 5e5e09a18199108de29bfee101c7b311ef094d94 (patch) | |
| tree | 588fe3a302979bd97ca3162a61c4d4766c194b23 /recipes-devtools/protobuf/protobuf_3.0.0.bb | |
| parent | 222f8d486dceba3744dde79fd004292ea824124b (diff) | |
| download | meta-virtualization-5e5e09a18199108de29bfee101c7b311ef094d94.tar.gz | |
protobuf: uprev 3.0.0 from 2.6.1
Signed-off-by: Jianchuan Wang <jianchuan.wang@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'recipes-devtools/protobuf/protobuf_3.0.0.bb')
| -rw-r--r-- | recipes-devtools/protobuf/protobuf_3.0.0.bb | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/recipes-devtools/protobuf/protobuf_3.0.0.bb b/recipes-devtools/protobuf/protobuf_3.0.0.bb new file mode 100644 index 00000000..e1deeac8 --- /dev/null +++ b/recipes-devtools/protobuf/protobuf_3.0.0.bb | |||
| @@ -0,0 +1,97 @@ | |||
| 1 | SUMMARY = "protobuf" | ||
| 2 | DESCRIPTION = "Protocol Buffers are a way of encoding structured data in \ | ||
| 3 | an efficient yet extensible format. Google uses Protocol Buffers for \ | ||
| 4 | almost all of its internal RPC protocols and file formats." | ||
| 5 | HOMEPAGE = "http://code.google.com/p/protobuf/" | ||
| 6 | SECTION = "console/tools" | ||
| 7 | LICENSE = "BSD-3-Clause" | ||
| 8 | |||
| 9 | LIC_FILES_CHKSUM = "file://LICENSE;md5=35953c752efc9299b184f91bef540095" | ||
| 10 | |||
| 11 | PR = "r0" | ||
| 12 | EXCLUDE_FROM_WORLD = "1" | ||
| 13 | |||
| 14 | SRC_URI[md5sum] = "d4f6ca65aadc6310b3872ee421e79fa6" | ||
| 15 | SRC_URI[sha256sum] = "f5b3563f118f1d3d6e001705fa7082e8fc3bda50038ac3dff787650795734146" | ||
| 16 | SRC_URI = "https://github.com/google/protobuf/archive/v3.0.0.tar.gz;downloadfilename=protobuf-3.0.0.tar.gz\ | ||
| 17 | file://protobuf-allow-running-python-scripts-from-anywhere.patch \ | ||
| 18 | file://run-ptest \ | ||
| 19 | " | ||
| 20 | |||
| 21 | COMPATIBLE_HOST = "(x86_64|arm|aarch64).*-linux" | ||
| 22 | |||
| 23 | EXTRA_OECONF += " --with-protoc=${STAGING_BINDIR_NATIVE}/protoc" | ||
| 24 | inherit autotools setuptools ptest | ||
| 25 | |||
| 26 | DEPENDS += "protobuf-native" | ||
| 27 | |||
| 28 | PYTHON_SRC_DIR="python" | ||
| 29 | TEST_SRC_DIR="examples" | ||
| 30 | LANG_SUPPORT="cpp python" | ||
| 31 | |||
| 32 | do_compile() { | ||
| 33 | # Compile protoc compiler | ||
| 34 | base_do_compile | ||
| 35 | } | ||
| 36 | |||
| 37 | do_compile_ptest() { | ||
| 38 | # Modify makefile to use the cross-compiler | ||
| 39 | sed -e "s|c++|${CXX}|g" -i "${S}/${TEST_SRC_DIR}/Makefile" | ||
| 40 | |||
| 41 | mkdir -p "${B}/${TEST_SRC_DIR}" | ||
| 42 | |||
| 43 | # Add the location of the cross-compiled header and library files | ||
| 44 | # which haven't been installed yet. | ||
| 45 | cp "${B}/protobuf.pc" "${B}/${TEST_SRC_DIR}/protobuf.pc" | ||
| 46 | sed -e 's|libdir=|libdir=${PKG_CONFIG_SYSROOT_DIR}|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc" | ||
| 47 | sed -e 's|Cflags:|Cflags: -I${S}/src|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc" | ||
| 48 | sed -e 's|Libs:|Libs: -L${B}/src/.libs|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc" | ||
| 49 | export PKG_CONFIG_PATH="${B}/${TEST_SRC_DIR}" | ||
| 50 | |||
| 51 | # Save the pkgcfg sysroot variable, and update it to nothing so | ||
| 52 | # that it doesn't append the sysroot to the beginning of paths. | ||
| 53 | # The header and library files aren't installed to the target | ||
| 54 | # system yet. So the absolute paths were specified above. | ||
| 55 | save_pkg_config_sysroot_dir=$PKG_CONFIG_SYSROOT_DIR | ||
| 56 | export PKG_CONFIG_SYSROOT_DIR= | ||
| 57 | |||
| 58 | # Compile the tests | ||
| 59 | for lang in ${LANG_SUPPORT}; do | ||
| 60 | oe_runmake -C "${S}/${TEST_SRC_DIR}" ${lang} | ||
| 61 | done | ||
| 62 | |||
| 63 | # Restore the pkgconfig sysroot variable | ||
| 64 | export PKG_CONFIG_SYSROOT_DIR=$save_pkg_config_sysroot_dir | ||
| 65 | } | ||
| 66 | |||
| 67 | do_install() { | ||
| 68 | local olddir=`pwd` | ||
| 69 | |||
| 70 | # Install protoc compiler | ||
| 71 | autotools_do_install | ||
| 72 | |||
| 73 | # Install header files | ||
| 74 | export PROTOC="${STAGING_BINDIR_NATIVE}/protoc" | ||
| 75 | cd "${S}/${PYTHON_SRC_DIR}" | ||
| 76 | distutils_do_install | ||
| 77 | |||
| 78 | cd "$olddir" | ||
| 79 | } | ||
| 80 | |||
| 81 | do_install_ptest() { | ||
| 82 | local olddir=`pwd` | ||
| 83 | |||
| 84 | cd "${S}/${TEST_SRC_DIR}" | ||
| 85 | install -d "${D}/${PTEST_PATH}" | ||
| 86 | for i in add_person* list_people*; do | ||
| 87 | if [ -x "$i" ]; then | ||
| 88 | install "$i" "${D}/${PTEST_PATH}" | ||
| 89 | fi | ||
| 90 | done | ||
| 91 | cp "${S}/${TEST_SRC_DIR}/addressbook_pb2.py" "${D}/${PTEST_PATH}" | ||
| 92 | |||
| 93 | cd "$olddir" | ||
| 94 | } | ||
| 95 | |||
| 96 | BBCLASSEXTEND = "nativesdk" | ||
| 97 | |||
